GRUB consists of three stages:
When GRUB stage 2 is loaded is reads /boot/grub/menu.lst. In addition to individual menu entries this file contains parameters to specify
Once the initial screen is shown the user can select to display the menu, can select a menu item, can edit the commands associated with a menu entry, or can enter a command mode where commands can be typed directly by the keyboard. The most common choice is to let the default menu entry be selected.
Here is a typical menu entry for loading a Linux system:
title Red Hat Enterprise Linux ES (2.6.9-42.ELsmp) root (hd0,0) kernel /vmlinuz-2.6.9-42.ELsmp ro root=/dev/VolGroup00/LogVol00 rhgb quiet initrd /initrd-2.6.9-42.ELsmp.img
As mentioned above, the title command specifies the text to be displayed in the menu.
The root command specifies which disk and partition contains the kernel and initrd files.
The kernel command loads the kernel into memory. The first word following "kernel" specifies the filename of the file containing the kernel. All words following the filename are parameters that are passed to the kernel when it is started.
The initrd command specifies an "initialization RAM disk" (thus the name initrd). This file contains a simple file-system structure and a series of files to be loaded by the kernel. These files consist of drivers and other dynamic modules that must be loaded by the kernel early in the boot process. Because the file-system module as well as disk drivers might be loaded as dynamic modules, the kernel cannot use either file system or disk driver to load these components. The kernal has built into it a simple-minded file system for the express purpose of reading this RAM disk.
Thus GRUB loads the initrd into memory, and passes its address to the kernel. The kernel then process that file system during system initialization.
Once the kernel and initrd are read into memory, GRUB transfers control to the kernel.
Next: The Kernel