Linux Boot Process

 1. POST :

booting Linux begins in the BIOS at address 0xFFFF0.
It starts POST : to check the hardware & local device enumeration and initialization.

BIOS has 2 parts:
1. POST code and
2. Runtime services  (BIOS runtime searches for devices that are both active and bootable)

BIOS looks MBR in hardisk and its loads the content of MBR to memory (RAM).and then it passes the control to MBR.

MBR :MBR contains the primary boot loader.
     The MBR is a 512-byte sector,
     Located in the first sector on the disk (sector 1 of cylinder 0, head 0).

2. STAGE 1 Boot loader:

MBR is a 512-byte image containing both program code and a small partition table.

first 446 bytes : Primary boot loader (contains both executable code and error message text)
Next 64 Bytes   : The partition table (contains a record for each of four partitions )
Last 2 Bytes : The magic number (0xAA55) : (magic number serves as a validation check of the MBR.)

Job of the primary boot loader is to find and load the secondary boot loader (stage 2)

3.Stage 2 boot loader:

Task at this stage is to load the Linux kernel and optional initial RAM disk.

The first & second-stage boot loaders are called Linux Loader (LILO) or GRand Unified Bootloader (GRUB).

GRUB can load a Linux kernel from an ext2 or ext3 file system.  
GRUB : Understands file systems and configuration lives in /boot/grub/menu.lst or /boot/boot/menu.lst

Stage 1 (MBR) boots a stage 1.5 boot loader that understands the particular file system containing the Linux kernel image.

Once stage 2 loaded, GRUB can, upon request, display a list of available kernels (defined in /etc/grub.conf)

Default kernel image and initrd image are loaded into memory. then the stage 2 boot loader invokes the kernel image.

4. Kernel :

Kernel initialize the devices and Loads initrd.

Kernel executes  /linuxrc to mount the root file system.And then it runs /sbin.init

/sbin/init reads the content of /etc/inittab and run the boot scripts @ /etc/rc.d/rc.sysinit.

/etc/rc.d.rc.sysinit :It loads modules, check root FS and mount RW, mount local FS, setup network, and mount remote FS.

Finally based on the /etc/inittab entry system switches to default runlevel.


Post a Comment

Blogger Tips and TricksLatest Tips And TricksBlogger Tricks