Boot loader
From Linux 101, The beginner's guide to all things Linux.
Boot loaders are an important part of the startup process. This is the step where the hardware calls on the software to decide what to do.
At the beginning of your harddrive is the master boot record or MBR. It is an important 512-bytes that is not as powerful as an operating system, but tells the computer where the operating system kernel is on the hard drive.
Because the MBR is restricted to 512 bytes, modern boot loaders are done in stages. That is, the MBR may point to a program (of sorts) that tells the computer how to read from the harddrive's filesystem(s). Then it loads another program to tell it how to extract compressed data. Then it points to another that says the actual kernel is at this location on the harddrive. Then using the previous stages, it has enough information to read from the harddrive at the right place, decompress the kernel image and place it into memory, then call the kernel's initialization process.
That's probably not the actual process any boot loader uses, but a good enough example of how it could be. In the old days starting computers could be done without stages, but not anymore. You could consider this staged design to be a clever trick by computer scientists to get around the old 512 byte restriction.
There are two popular boot loaders for linux, GRUB and LILO.
Because of their importance to the system (without a boot loader, an operating system cannot start), boot loaders are prone to be attacked by viruses. Many motherboard creators now have set up protections against writing to the special boot sector (another popular term for the MBR) on the harddrive, but even that is not likely to be 100% secure. This is also one of those reasons why running programs as root without the need can be dangerous -- do not want it to have the potential to write to this special part of the harddrive.
|
Note: If you have a corrupt MBR that is not a sign that the rest of the data on your machines has also gone bad. You may be able to recover that data. So if you break the MBR, you should attempt to fix it before re-installing any operating system. |

