The Relay Race

Booting a computer is like a relay race. No single program knows how to do everything. Instead, control is passed from one specialized program to the next, each more complex than the last, until the Operating System is fully loaded.

We call this the Boot Chain.

1

BIOS / UEFI

Power On Self Test (POST). Initializes hardware. Finds the boot device.

2

Bootloader (GRUB)

Loads the Kernel and Initial RAM Disk (initrd) into memory.

3

The Kernel

Decompresses itself. Initializes drivers. Mounts the Root Filesystem.

4

Init (Systemd)

PID 1. Starts system services (Network, UI, SSH) in parallel.

5

User Space

Login prompt or Graphical Interface (GNOME/KDE).

Quick Reference: The 5 Stages

Stage Key Responsibility Critical Files/Paths
1. BIOS/UEFI Hardware Check & Boot Device Selection MBR / EFI Partition
2. Bootloader Load Kernel & Initrd into RAM /boot/grub/grub.cfg
3. Kernel Initialize Drivers & Mount Root FS /boot/vmlinuz, /boot/initrd.img
4. Init Start System Services (PID 1) /sbin/init, /etc/systemd/system/
5. User Space Login & UI /bin/login, /usr/bin/gnome-shell

Stage 1: The Awakening (BIOS/UEFI)

When you press the power button, the CPU has no instructions in its cache. It is hardwired to look at a specific memory address on the motherboard (the Reset Vector).

BIOS vs UEFI:
  • BIOS (Legacy): Reads the first 512 bytes (MBR) of the disk. Very limited.
  • UEFI (Modern): Can read a special partition (EFI System Partition) formatted as FAT32. It loads .efi executables directly.

Once the hardware is checked (POST), the firmware looks for a bootloader.

Stage 2: The Chooser (GRUB)

The Grand Unified Bootloader (GRUB) is what you see when you dual-boot. Its job is simple but crucial:

  1. Let the user select an OS (or kernel version).
  2. Load the kernel image (vmlinuz) into memory.
  3. Load the initrd (Initial RAM Disk) into memory.
Why initrd? The kernel needs drivers to read the hard disk (e.g., ext4, NVMe). But those drivers are on the hard disk! The initrd is a tiny, temporary filesystem loaded into RAM that contains just enough drivers to mount the real disk.

Stage 3: The Brain Wakes Up (Kernel)

Control is passed to the kernel. This is where the magic happens.

High Mem User Space (Empty for now)
Kernel Space Kernel Image (vmlinuz)
Decompressed & Running
RAM Disk initrd / initramfs
Temporary Root Filesystem

The kernel performs hardware detection, loads necessary drivers from the initrd, and finally mounts the real root filesystem (/) as read-only.

Stage 4: The First Process (Systemd)

Once the root filesystem is mounted, the kernel executes the first program: /sbin/init (usually a link to systemd).

This process always gets PID 1. If it dies, the system crashes (Kernel Panic).

Systemd looks for the default.target (usually graphical.target) and starts services in parallel:

  • Mounting filesystems (/etc/fstab)
  • Starting Networking
  • Starting Audio/Video
  • Starting the Login Manager (GDM/LightDM)

Interactive Boot Log Simulator

Watch a simulated kernel boot sequence. This is what dmesg shows you.

Conclusion

From a cold piece of metal to a fully interactive graphical environment in seconds. The Linux boot process is a marvel of engineering, handling thousands of hardware variations with a unified, modular approach.

← Back to Blog