Linux Boot Process

Omkar kadamOmkar kadam
2 min read

The boot process is a crucial sequence of events that occurs when a computer is powered on, allowing it to initialize the operating system and prepare for user interaction. Let's walk through the key stages of the boot process.

Boot Process ------------

BIOS :

1] BIOS stands for Basic Input Output System

2] BIOS is first program that executed which is stored in read-only memory on motherboard of computer

3] perform POST (power-on self-test) verify the hardware components and peripheral components to ensure if computer is in working condition

4] check bootable devices like hard disk, pendrives etc.

5] Transfers the controls to first sector of device i.e. MBR

MBR :

1] MBR stands for Master Boot Record

2] Its of 512 bytes, MBR is first sector of any bootable device contains machine code instructions to boot a machine and having following info -Boot loader (446 bytes) -Partition table (64 bytes) -Error checking (2 bytes)

3] It will load boot loader into memory and handover to it

GRUB :

1] Grub stands for Grand Unified Bootloader

2] load /boot/grub2/grub.cfg at boot time ------(in grub 2 booting related information is stored)

3] Main job is to load kernel and initrd/initfrms image into memory

4] Once load kernel in ram, it passes control to it

KERNEL:

1] First kernel is loaded into read-only mode

2] initramfs/initrd gets decompressed and then it first loads temproary file system

3] Initrd then detects and load the drivers from temproary filesystem to load actual file system i.e. root file system.

4] Once main filesystem is mounted, kernel initialize the first process init/systemD

[Linux Kernel is the central core of the os and it is the first program loaded on the system starts up. While system starting kernel loads all the necessary Kernel Modules and Drives from initrd.img to load system first process systemd in Linux 7. It mounts the root file system as specified in the “root=” in grub.conf.

SYSTEMD

1] First service loaded with PID 1 2

] starts all required process

3] To bring the system to the run level/targets (0/6)

4] you can find different runlevels files under /usr/lib/systemd/system then simply do ls -l runlevel*

9
Subscribe to my newsletter

Read articles from Omkar kadam directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Omkar kadam
Omkar kadam