Results 1 to 7 of 7
im not a linux guru but i do use and study linux OS at school writing scripts and learning different commands, etc. But my question, why is that i can ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 01-15-2010 #1
- Join Date
- Jan 2010
Linux File System question
im not a linux guru but i do use and study linux OS at school writing scripts and learning different commands, etc. But my question, why is that i can install linux, for ex. Ubuntu on 1 pc and plug it in another pc with different hardwar/setup and it will boot/run perfectly? Im sure i learned this in school and has to do with the file system and how everything is treated as a file, etc. but i totally forgot and its been bugging me. feel free to use "tech language" as i will understand and to contrast why i cant do this with windows os. thanks!
- 01-15-2010 #2
Hi and Welcome !
why is that i can install linux, for ex. Ubuntu on 1 pc and plug it in another pc with different hardwar/setup and it will boot/run perfectly?
In Windows OS, installer configures OS according to the available hardware and one has to install Drivers for most of hardware parts after OS installation. There is no need of such drivers in Linux except a few Graphics Cards (Nvidia/ATI) and Wireless cards.
When you plug-in Harddisk in a new machine having different Hardware, Linux boots up fine most of the time.
- 01-15-2010 #3
Indeed, the answer is the kernel.
The whole point of an operating system is generally to abstract away the hardware. If I write a program for any operating system, my program does not care that you have a 3 GB Seagate SATA hard drive connected to the IDE1 port formatted as ext4. It simply knows that it can write a file. The bit of the computer that takes "print 'hello' to a file" and changes it to "write the following bytes to the 300th block of the first IDE port's drive" is the kernel.
So having said that, how is it that the kernel can deal with new hardware? This is done via drivers. In fact, Linux and Windows deal with the problem fairly similarly, and the main difference is in how drivers are handled. In each case, if you plug in a new piece of hardware, the kernel needs to see if it understands the hardware. It does this by employing a driver. In Linux, we tend to use a kernel that contains every driver available (unless you have compiled your own kernel and slimmed it down), which means that new formats and new styles of hardware are already understood. On Windows, you might have to go and find the new driver. But even on my old Linux box, where I had a very minimalist kernel, I would have had to recompile the kernel to add, for instance, ext4 support.
Does that make sense?
- 01-15-2010 #4
also, you have to understand the MS purposefully does not want you to do this, and even if they were identical in hardware otherwise it would not work, since they tie the install to one machine to prevent piracy
- 01-16-2010 #5
- Join Date
- Jan 2010
Ok so the main reason why i can pop my linux hdd in any pc and it will run boot/smoothly most of the time with very minor issues is becasue the linux kernal already has many reloaded drivers for various hardware? so everytime a new kernal comes out it has new drivers? in the long run wont the kernal take up alot of space?
thanks for all the replys
- 01-16-2010 #6
My understanding of it (flawed though it may be) is that the drivers themselves are present in the kernel itself, but upon boot, only the necessary drivers and modules are actually loaded.
So while the kernel file itself may get slightly larger, it shouldn't have any real effect on the 'working kernel'.
- 01-16-2010 #7
support for hardware is achieved in 2 ways, either it is inbuilt to kernel or as modules, most drivers are compiled as module so they aren't loaded unless needed, but some things are inbuilt because they need to be and it actually makes kernel smaller as modules have additional overhead, but if you compile all drivers in it will take up more space than only loading modules you need