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.
BIOS / UEFI
Power On Self Test (POST). Initializes hardware. Finds the boot device.
Bootloader (GRUB)
Loads the Kernel and Initial RAM Disk (initrd) into memory.
The Kernel
Decompresses itself. Initializes drivers. Mounts the Root Filesystem.
Init (Systemd)
PID 1. Starts system services (Network, UI, SSH) in parallel.
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 (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
.efiexecutables 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:
- Let the user select an OS (or kernel version).
- Load the kernel image (
vmlinuz) into memory. - Load the initrd (Initial RAM Disk) into memory.
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.
Decompressed & Running
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.