Free — no signup required

Stage 3: The Kernel Initializes

2 min read

The Kernel Takes Control

When GRUB jumps to the kernel entry point, the Linux kernel begins its own initialization sequence. At this point, the kernel is running in a minimal environment — no filesystem, no processes, no system calls. It must build all of that from scratch.

The kernel initialization sequence proceeds roughly as follows:

1. Decompress itself. The kernel image on disk (vmlinuz) is compressed. The vmlinuz file is actually a self-extracting archive — it contains a small decompressor that unpacks the real kernel into RAM before execution begins. The z in vmlinuz stands for compressed (like gzip).

2. Set up the CPU. The kernel configures the CPU's operating mode (switching from the 16-bit "real mode" that BIOS uses to 64-bit "long mode"), sets up memory management (paging tables), and initializes the interrupt descriptor table so the CPU knows how to handle hardware interrupts.

3. Detect and initialize hardware. The kernel probes for CPUs, memory, buses (PCI, USB), and begins loading built-in drivers. This entire process is logged to the kernel ring buffer, readable via dmesg — every device the kernel finds and every driver it loads, each line timestamped with seconds elapsed since kernel start (e.g., [0.000000]), covering everything from the initial memory map and ACPI tables through PCI bus enumeration and network protocol registration.

4. Mount the initramfs. Before the kernel can access the real root filesystem, it needs to solve a fundamental problem — which brings us to the next stage.

This is one of 18 chapters

Every chapter is free — Kubernetes, Terraform, SRE, distributed systems, and more — with fast daily review built in.

Sign up free