Boot process in Linux

The various steps involved in Boot process of Linux are :

Foot view of booting process


BIOS

It stands for Basic Input/output system. It is the first thing initialized as you power on your system. It performs system integrity check. It also determines all the list of bootable devices available in the system. BIOS load the boot loader program. So in general, BIOS loads and executes the MBR boot loader.

MBR


MBR


It stands for Master Boot Record. It is the first sector of the hard disk with a size of 512 bytes. The First 446 bytes are primary boot loader, 64 bytes for partition table and 2 bytes for MBR validation time stamp. It contains the information about GRUB. So in general MBR loads ad executes the GRUB boot loader.

Note: since MBR is unaware of the file system concept so it cannot load the kernel directly. So it requires GRUB which is used with the details of the file system in /boot/grub.conf and fil system drivers.

GRUB

It stands for Grand Unified Bootloader. GRUB just loads and executes kernel and initrd images.

Below is a sample of grub.conf file in ubuntu 16.04

GRUB
 If you have multiple kernel images installed on your system, you can choose which one to be executed. GRUB displays a splash screen, waits for few seconds, if you don’t enter anything, it loads the default kernel image as specified in the grub configuration file. You may have noticed it if your system is dual booted.

Kernel


Kernel is a compressed image file and its location is specifies in the grub configuration file. A linux kernel is responsible for handling process management, memory management, users, inter process communicatin etc. it is not used by user. It just maintain a good environment for program to run.

Init is the first program to run of linux and kernel executes the /sbin/init program. So it the heart of operating system. Initrd is used by kernel as a temporary file system until kernel is booted and the real  root sysem is mounted. Thus,, it mounts the root file system which is specified in grub file.

Init


It executes the system to boot into the run levels as specified in /etc/ininttab




You can use below command to check the current run level details.

who -r
Depending on your default init level setting, the system will execute the programs from one of the following directories.

·         Run level 0 – /etc/rc.d/rc0.d/
·         Run level 1 – /etc/rc.d/rc1.d/
·         Run level 2 – /etc/rc.d/rc2.d/
·         Run level 3 – /etc/rc.d/rc3.d/
·         Run level 4 – /etc/rc.d/rc4.d/
·         Run level 5 – /etc/rc.d/rc5.d/
·         Run level 6 – /etc/rc.d/rc6.d/


In each run level, there are some files which starts with S and K. file name starting from S are used during startup and  file name starting from K are used during shutdown to kill the app.There is some number next to file names which indicate the sequence of execution


Related Posts Plugin for WordPress, Blogger...