Booting a Linux system turns a powered-off machine into a multi-user, networked operating environment in seconds. While exact details vary across processor architectures, firmware types, and distributions, a standard x86_64 Linux boot follows five distinct stages: hardware initialization, firmware handoff, bootloader execution, kernel initialization, and service manager startup.
1. Firmware Initialization (BIOS or UEFI)
Pressing the power button sends electricity to the motherboard and resets the CPU. On x86_64 hardware, the processor starts in a low-level mode and jumps to a fixed reset vector pointing into non-volatile memory—either legacy BIOS or modern UEFI.
Firmware runs a Power-On Self-Test to verify basic hardware such as system memory, clocks, and buses. Next, firmware locates a bootable device:
- BIOS reads the first 512-byte sector—the Master Boot Record—from a configured disk and jumps to its bootstrap code.
- UEFI reads the GUID Partition Table, mounts the EFI System Partition, and executes an
.efiapplication such as a boot manager or bootloader directly.
2. The Bootloader Stage
Because the Linux kernel is too large to fit inside a legacy boot sector and expects the system to be in a specific CPU state, a bootloader bridges firmware and the kernel. Common bootloaders include GNU GRUB, systemd-boot, and U-Boot on embedded boards.
The bootloader presents a boot menu (if configured), reads kernel command-line parameters from /proc/cmdline, loads the compressed kernel image (often vmlinuz) into memory, and loads an initial RAM filesystem (initramfs or initrd) if needed. It then switches the CPU into the required execution mode (such as 64-bit long mode on x86_64) and transfers control to the kernel entry point.
3. Kernel Decompression and Early Initialization
Once invoked, the compressed kernel image runs a small decompression stub that unpacks the core kernel into high memory and jumps to startup_64 (on x86_64). Early architecture-specific setup configures page tables, interrupts, and console output so boot messages appear early.
Next, start_kernel() in the Linux kernel source initializes core subsystems:
- Memory management sets up page allocators and slab caches.
- Schedulers and timers enable multitasking and clock interrupts.
- Device and filesystem layers register drivers, virtual filesystems (
procfs,sysfs,devtmpfs), and block storage support.
If an initramfs archive was loaded, the kernel unpacks it into a temporary root filesystem in RAM. This early user space loads storage, RAID, encryption (dm-crypt), or network drivers required to reach the real root filesystem, then pivots (switch_root) onto the permanent root partition.
4. PID 1 and Init Systems
After mounting the real root filesystem, the kernel executes the first user-space program—traditionally /sbin/init, or a path passed via init= on the kernel command line. This process receives Process ID 1 (PID 1) and becomes the ancestor of all user-space processes.
Modern Linux distributions predominantly use systemd as PID 1, while some distributions or specialized setups use OpenRC, runit, or BSD-style init scripts. Using systemd, PID 1 reads unit files from /etc/systemd/system and /usr/lib/systemd/system, builds a dependency graph, mounts remaining filesystems, brings up networking, and starts background daemons in parallel.
5. Reaching the Target State
As services start, systemd converges on a target unit—such as multi-user.target for a text/server console or graphical.target for a display manager and desktop session. Device nodes appear dynamically under /dev via systemd-udevd, system logs route through journald and rsyslog, and login prompts (getty) or graphical greeters become ready for user sessions.
Sources
- The Linux Kernel Organization. The Linux Kernel documentation. https://www.kernel.org/ and https://www.kernel.org/doc/html/latest/
- Free Software Foundation. GNU GRUB Manual. https://www.gnu.org/software/grub/ and https://www.gnu.org/software/grub/manual/grub/html_node/BIOS-installation.html
- Unified Extensible Firmware Interface Forum. UEFI Specifications. https://uefi.org/specifications/
- systemd Project / freedesktop.org. systemd Documentation and Man Pages. https://systemd.io/ and https://www.freedesktop.org/software/systemd/man/latest/systemd-boot.html
- Linux man-pages project. init(1) — Linux manual page. https://man7.org/linux/man-pages/man1/init.1.html
- U-Boot Documentation. Das U-Boot — the Universal Boot Loader. https://docs.u-boot.org/
- Arch Wiki. Master Boot Record. https://wiki.archlinux.org/title/Master_Boot_Record
- Gentoo Wiki. OpenRC. https://wiki.gentoo.org/wiki/OpenRC