linuxgizmo
Wednesday, January 9, 2008
Linux Boot Process
In this topic, we can see how linux boots.

There are basically 4 stages for linux or any other O/S to boot. Let's me explain it short and sweet.

a) BIOS (Basic Input Output System):

i) POST:

When an system boots the first thing our computer dose is, checking for all the peripherals connected with it. It will send signal to keyboard, mouse, etc, and check for all the devices are connected with it or not. That process of sending signal and checking is called as Power On Self Test. This is the first and foremost process of any computers.

ii) MBR:

When BIOS loads into the memory it goes and check for the master IDE. That is primary partition (hdx1-4 or sdx 1-4). It loads what ever the program resides on the first sector on this device called MBR AKA Master Boot Recorder. This MBR is only 512 byte in size and contains machine code called Boot Loader. You can see what's in that first 512 byte of hard disk by:

# dd if=/dev/hda of=mbr.bin bs=512 count=1
# od -xa mbr.bin

b) Boot Loader:

Once the control reaches Boot Loader (GRUB) loads. There are two kind of boot loaders, linux version 7.2 and before lilo was the default boot loader. It was called as linux loader. where it has been replaced by GRUB. I will have a separate topic about GRUB. The grub.conf will look like this:

root (hd0,0)
kernel /boot/vmlinux ro root=LABEL=/ rhgb quite
initrd /boot/initrd.2.4.img

c) Kernel and Initrd Image:

Now the control moves to kernel, our kernel initialise & configure computer's memory and other hardware, including processors, i/o sub systems, then mount the root in ro(read only) mode.Then decompresses the initrd image and mounts it. Now the initrd image load all the necessary modules, it also loads virtual memory space like LVM, RAID. Now the control
passes to the first process of the linux system called init process. where it is called as the parent and grand parent for all the process /sbin/init.

d) Init:

The last level of Linux Boot process is Init state. The first script init runs is /etc/rc.d/rc.sysinit. This script will set the env. path, starts the swap space, check the filesystem. Then it runs /etc/inittab file. This file consists of the run level information. If you are in run level 5 your x windows will be spawned.
posted by Venkat Raman V @ 12:11 PM  
0 Comments:
Post a Comment
<< Home
 
Come Lets Share LINUX Info.
Select Topics
  • CORE LINUX
  • APACHE
  • Solved Errors
  • Scripts
Watz HOT