Online Book Reader

Home Category

UNIX System Administration Handbook - Evi Nemeth [21]

By Root 2622 0
initial power-on sequence and the loading of the kernel. On traditional hardware, this is a straightforward process that merits only a few lines of description.

PC booting, on the other hand, is a lengthy ordeal that requires quite a bit of background information to understand. If you don’t need to deal with PCs, you might want to jump ahead to page 22.

How a PC is different from proprietary hardware


When a machine boots, it begins by executing code stored in ROMs. The exact location and nature of this code varies, depending on the type of machine you have. On a machine designed explicitly for UNIX, the code is typically firmware that knows how to use the devices connected to the machine, how to talk to the network on a basic level, and how to understand disk-based filesystems. Such omniscient firmware is very convenient for system administrators. For example, you can just type in the filename of a new kernel, and the firmware will know how to locate and read that file.

On PCs, this initial boot code is generally called a BIOS (Basic Input/Output System), and it is extremely simplistic compared to the firmware of a UNIX machine. Actually, a PC has several levels of BIOS: one for the machine itself, one for the video card, and one for the SCSI card if the system has one.

The built-in BIOS knows about some of the devices that live on the motherboard, typically the IDE controller (and disks), keyboard, serial ports, and parallel ports. SCSI cards are usually only aware of the devices that are connected to them. Working out the conflicts and interactions among all these various BIOSes can be a real nightmare. In many cases, mass confusion reigns supreme over which BIOS gets to choose what device to try to boot from.

The PC boot process


Modern BIOSes are a little smarter than they used to be. They usually allow you to enter a configuration mode at boot time by holding down one or two special keys; better BIOSes have even hit upon the innovation of telling you what those special keys are so you don’t have to look them up in the manual.

The BIOS will normally let you select which devices you want to try to boot from, which sounds more promising than it actually is. You can usually specify something like, “Try to boot off the floppy, then try to boot off the CD-ROM, then try to boot off the hard disk.” Unfortunately, the BIOS is generally limited to booting from the first IDE CD-ROM drive or the first IDE hard disk. If you have been very, very good over the previous year, Santa might even provide you with a BIOS that acknowledges the existence of SCSI cards.

We would like to offer you some useful guidance for negotiating this quagmire. Alas, it is impossible; this phase of the boot process is entirely under the control of the hardware manufacturers and their wretched BIOSes. You will have to negotiate with them for succor.

Once your machine has figured out what device to boot from, it will try to load the first 512 bytes of the disk. This 512-byte segment is known as the Master Boot Record or MBR. The MBR contains a program that tells the computer from which disk partition to load a secondary boot program (the “boot loader”). For more information on PC-style disk partitions and the MBR, refer to Chapter 8, Adding a Disk.

The default MBR is a simple program that tells the computer to get its boot loader from the first partition on the disk. Both Linux and FreeBSD provide a more sophisticated MBR that knows how to deal with multiple operating systems and kernels.

Once the MBR has chosen the partition to boot from, it tries to load the boot loader specific to that partition. The boot loader is then responsible for loading the kernel.

LILO: the Linux boot loader


LILO is both incredibly complex and incredibly stupid. It provides many advanced facilities that most other boot loaders lack, but it’s also missing some simple features.

LILO comes with almost all Linux distributions, including Red Hat. When you first install the system, Red Hat’s installation scripts will plonk down a copy of LILO with the

Return Main Page Previous Page Next Page

®Online Book Reader