Linux Startup Process - Boot Loader Phase

Boot Loader Phase

The boot loader phase varies by platform. Since the earlier phases are not specific to the OS, the boot process is considered to start:

  • For x86 or x86-64: when the partition boot sector code is executed in real mode and loads the first stage boot loader (typically a part of LILO or GRUB).

From that point, the boot process continues as follows:

The first stage boot loader (in the MBR or the volume boot record) loads the remainder of the boot loader, which typically gives a prompt asking which operating system (or type of session) the user wishes to initialize. LILO and GRUB differ in some ways:

  • Under LILO, the map installer, lilo, reads the configuration file /etc/lilo.conf to identify the available bootable systems (it is executed from a running Linux system). The configuration file can include data such as boot partition and kernel pathname for each, as well as customized options if needed. To be precise, /etc/lilo.conf is prior-parsed and used to create fixed-offset information saved in the boot sector and the map file, which will be used at the next boot. This information is discovered by asking the Linux kernel, at map installer time, where (e.g. on which disk sectors) the object of interest (such as an initrd, a kernel image file, or the like) is stored. At boot time, the default or selected operating system is loaded into RAM, a minimal initial file system is possibly set up in RAM from an image file ("initrd"), and along with the appropriate parameters, control is passed to the newly loaded kernel. LILO does not "understand" file systems, so it uses raw disk offsets and the BIOS to load any needed code or data based on data in the boot sector and map file. It cannot "find" /etc/lilo.conf at boot time because it does not understand file systems; instead it searches fixed locations on the disk memorized the last time the LILO map installer (lilo) was run to generate new offsets in the boot sector and the map file image. Boot time LILO logic loads the menu code, and then, depending on the lilo.conf directives used to make the map file, along with any user interaction, loads either the boot sector for another system such as Microsoft Windows, or the kernel image for Linux.
  • GRUB by contrast does have understanding of the common ext2, ext3 and ext4 file systems. Because GRUB stores its data in a configuration file rather than the MBR and contains a command-line interface, it is often easier to rectify or modify GRUB if misconfigured or corrupt.

Read more about this topic:  Linux Startup Process

Famous quotes containing the words boot and/or phase:

    The best quality tea must have creases like the leathern boot of Tartar horsemen, curl like the dewlap of a mighty bullock, unfold like a mist rising out of a ravine, gleam like a lake touched by a zephyr, and be wet and soft like a fine earth newly swept by rain.
    Lu Yu (d. 804)

    I had let preadolescence creep up on me without paying much attention—and I seriously underestimated this insidious phase of child development. You hear about it, but you’re not a true believer until it jumps out at you in the shape of your own, until recently quite companionable child.
    Susan Ferraro (20th century)