Tuesday 11 June 2013

linux booting process step by step

In this topic we will discuss indepth of Linux Boot Sequence.How a linux system boots?
How computer startup?
Booting is a bootstrapping process that starts operating systems when the user turns on a computer system
A boot sequence is the set of operations the computer performs when it is switched on that load an operating system

 
Booting sequence

1.Turn on

2.CPU jumps to address of BIOS (0xFFFF0)

3.BIOS runs POST (Power-On Self Test)

4.Find bootable devices

5.Loads and executes boot sector form MBR

6.Load OS
   BIOS (Basic Input/OutputSystem)


BIOS refers to the software code run by a computer when first powered on
The primary function of BIOS is code program embedded on a chip that recognizes and controls various devices that make up the computer.

 Boot loader

MBR (Master Boot Record) 

OS is booted from a hard disk, where the Master Boot Record (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)

After the MBR is loaded into RAM, the BIOS yields control to it. 
 The first 446 bytes are the primary boot loader, which contains both executable code and error message text

 Other boot loader (Several OS)
bootman
GRUB
LILO
NTLDR
XOSL
BootX
loadlin
who are responsible for the booting process.
       1.BIOS(Basic Input/Output System)
        2.MBR(Master Boot Record)
        3.LILO or GRUB
             LILO:-LInux LOader
             GRUB:-GRand Unified Bootloader
        4.Kernel
        5.init
        6.Run Levels
1.BIOS:
      i.When we power on BIOS performs a Power-On Self-Test (POST) for all of the different hardware components in the system to make sure everything is working properly
2.MBR
     i. Normally we use multi-level boot loader.Here MBR means I am referencing to DOS MBR
ii.Afer BIOS executes a valid DOS MBR,the DOS MBR will search for a valid primary partition marked as bootable on the hard disk.
3.LILO
     i.LILO is a linux boot loader which is too big to fit into single sector of 512-bytes.
GRUB
     i.GRUB MBR consists of 446 bytes of primary bootloader code and 64 bytes of the partition table.
4.Kernel
     i.Once GRUB or LILO transfers the control to Kernel,the Kernels does the following tasks
  • Intitialises devices and loads initrd module
  • mounts root filesystem 
5.Init
     i.The kernel, once it is loaded, finds init in sbin(/sbin/init) and executes it.

6.Runlevel
     i.There are 7 run levels in which the linux OS runs and different run levels serves for different purpose.The descriptions are
given below.
  • 0  – halt (shut down)
  • 1  – Single user mode
  • 2  – Multiuser, without NFS (The same as 3, if you don’t have networking)
  • 3  – Full multiuser mode
  • 4  – unused
  • 5  – X11
  • 6  – Reboot

No comments:

Post a Comment