Skip to main content
Be Bitwise

Boot Process Compared

Linux vs Windows Internals Compared · Operating Systems track

8 min read

In this module

From Power Button to Desktop

Booting is the choreography that takes a cold machine from "no power" to "blinking cursor". Linux and Windows both follow the same rough arc — firmware, bootloader, kernel, init — but the details look almost nothing alike once you zoom in. Knowing this dance pays off when you're chasing a boot failure, reasoning about pre-OS security (Secure Boot, measured boot), or mapping the attack surface that exists before the kernel is even up.

Firmware: BIOS vs UEFI

Both operating systems start with firmware:

UEFI (Unified Extensible Firmware Interface) has more or less buried legacy BIOS. UEFI brings Secure Boot for signed bootloaders, GPT support (which lets you actually use disks bigger than 2 TB), and a single standardised boot procedure that vendors are supposed to follow.

The EFI System Partition (ESP)

Both OSes share the ESP — a small FAT32 partition that hosts every bootloader the firmware can hand control to:

text
EFI System Partition (ESP):
/EFI/
├── BOOT/
│ └── BOOTX64.EFI ← Default fallback bootloader
├── Microsoft/
│ └── Boot/
│ └── bootmgfw.efi ← Windows Boot Manager
├── ubuntu/
│ └── grubx64.efi ← GRUB bootloader
└── fedora/
└── shimx64.efi ← Fedora's Secure Boot shim

Linux Boot Process

text
UEFI → GRUB → Linux Kernel → initramfs → systemd → Desktop

GRUB (Grand Unified Bootloader)

GRUB is what most Linux distros ship. It pops up a menu, drops the kernel and initramfs into memory, and jumps:

text
GRUB configuration (/boot/grub/grub.cfg):
menuentry 'Ubuntu' {
linux /vmlinuz-6.2.0 root=/dev/sda2 ro quiet splash
initrd /initrd.img-6.2.0
}

GRUB really only cares about two files:

  1. vmlinuz — the compressed Linux kernel itself
  2. initrd/initramfs — a compressed mini-filesystem packed with early-boot drivers

Linux Kernel Initialisation

text
1. Kernel decompresses itself
2. Architecture-specific setup (page tables, GDT, IDT)
3. Initialise core subsystems:
- Memory management (zones, buddy allocator, slab)
- Scheduler
- VFS (Virtual File System)
- Device model
4. Mount initramfs as temporary root (/)
5. Execute /init from initramfs

initramfs

The initramfs is the bare minimum needed to wake up the disks and mount the real root:

text
initramfs contents:
/init ← Shell script or systemd
/bin/busybox ← Basic utilities
/lib/modules/ ← Kernel modules for:
ext4.ko ← Filesystem driver
ahci.ko ← SATA driver
nvme.ko ← NVMe driver
dm-crypt.ko ← Disk encryption
raid456.ko ← Software RAID
/etc/ ← Configuration

The init script sniffs out the hardware, modprobes whichever drivers it needs, decrypts encrypted volumes, brings up RAID arrays, and finally mounts the real root. Then switch_root (which deletes the initramfs contents and makes the real root /; older setups used pivot_root) and an exec hand control over to the system's actual init.

Why initramfs Exists

The kernel cannot contain every possible driver compiled in - that would make it enormous. Instead, drivers are kernel modules (.ko files). But to load modules from disk, the kernel needs disk drivers and filesystem drivers, which are themselves modules. initramfs breaks this chicken-and-egg problem by providing a RAM-based filesystem with the necessary drivers already loaded.

systemd Initialisation

With the real root mounted, systemd (running as PID 1) picks up:

text
systemd (PID 1)
├── default.target (typically graphical.target)
│ ├── multi-user.target
│ │ ├── NetworkManager.service
│ │ ├── sshd.service
│ │ ├── cron.service
│ │ └── ... other services
│ └── display-manager.service (GDM, LightDM)
│ └── graphical login → user session

systemd organises everything into units — services, sockets, mounts, targets — with explicit dependencies between them. Anything whose dependencies are satisfied runs in parallel, which is why modern Linux boots feel quick compared with the SysV days.

Windows Boot Process

text
UEFI → bootmgfw.efi → winload.efi → ntoskrnl.exe → SMSS → wininit + Winlogon → Desktop

Windows Boot Manager (bootmgfw.efi)

The Windows Boot Manager pulls its instructions from the Boot Configuration Data (BCD) store and shows a chooser if more than one Windows install is registered:

text
BCD Store (conceptual):
├── {bootmgr}
│ └── description = "Windows Boot Manager"
├── {current}
│ ├── device = partition=C:
│ ├── path = \Windows\system32\winload.efi
│ ├── description = "Windows 11"
│ └── systemroot = \Windows
└── {recovery}
└── ... recovery environment ...

winload.efi

winload.efi does the pre-kernel heavy lifting:

text
1. Read BCD configuration
2. Load ntoskrnl.exe (the kernel) into memory
3. Load hal.dll (Hardware Abstraction Layer)
4. Load boot-start drivers (from HKLM\SYSTEM\CurrentControlSet\Services
where Start=0)
5. Load the SYSTEM registry hive
6. Initialise Secure Boot verification
7. Transfer control to ntoskrnl.exe

Kernel Initialisation (ntoskrnl.exe)

text
1. Initialise HAL (interrupt controller, timers)
2. Initialise Memory Manager (page tables, pools)
3. Initialise Object Manager (namespace)
4. Initialise Security Reference Monitor
5. Initialise Process Manager
6. Initialise I/O Manager
7. Start system-start drivers (Start=1)
8. Create Session 0
9. Start SMSS (Session Manager) as first user-mode process

SMSS → wininit and Winlogon → Desktop

text
SMSS (Session Manager):
├── Create paging files, load the rest of the registry
├── Session 0 (services, no interactive desktop)
│ ├── csrss.exe (Windows subsystem process for Session 0)
│ └── wininit.exe
│ ├── services.exe (SCM)
│ │ └── Start auto-start services
│ └── lsass.exe (authentication)
└── Session 1 (first interactive session)
├── csrss.exe (Session 1)
└── winlogon.exe
├── Display logon screen (LogonUI.exe)
└── After logon: userinit.exe starts explorer.exe (user shell)

Boot Security: Who Checks Whom

UEFI Secure Boot keeps its trust anchors in firmware variables. The Platform Key (PK) belongs to the machine's owner, usually the OEM, and authorises changes to the Key Exchange Keys (KEK). KEKs authorise updates to db, the list of certificates and hashes allowed to boot, and to dbx, the list of things that are explicitly revoked. On most PCs, db trusts Microsoft certificates and not much else.

That's awkward for Linux, so distros ship shim: a tiny first-stage loader signed by Microsoft's third-party UEFI CA. Shim carries the distro's own certificate and checks GRUB and the kernel against it, plus any Machine Owner Keys (MOK) the user has enrolled. Windows doesn't need the detour, as bootmgfw.efi is signed by a certificate already in db.

Secure Boot verification (solid arrows) on each OS. Every stage is also measured into the TPM before it runs.

Secure Boot enforces: a failed signature check stops the boot. Measured boot records. Before each stage runs, the stage before it hashes it and extends that hash into a TPM Platform Configuration Register (PCR). Nothing gets blocked, but the final PCR values summarise exactly what ran, so BitLocker or a LUKS setup bound to the TPM can refuse to release the disk key if anything changed. The TPM side of this is covered in Trusted Platform Modules.

Signatures only prove who built a binary, not that it's bug-free. BootHole (CVE-2020-10713, 2020) was a buffer overflow in GRUB2's config-file parser: an attacker who could edit grub.cfg got code execution inside a signed, trusted bootloader. BlackLotus (seen in the wild in 2023) went after Windows by loading an older, legitimately signed boot manager vulnerable to CVE-2022-21894. Both stories have the same moral: the fix is revoking the old binaries through dbx, and rolling out a dbx update without bricking machines is slow, careful work.

Side-by-Side Comparison

PhaseLinuxWindows
FirmwareUEFI/BIOSUEFI/BIOS
BootloaderGRUB, systemd-bootbootmgfw.efi
Kernel loaderGRUB loads vmlinuzwinload.efi loads ntoskrnl.exe
Early rootinitramfs (RAM-based)None: winload loads the boot-start drivers straight from disk
Init systemsystemd (PID 1)SMSS → wininit (services, LSASS) and Winlogon (logon)
Service managersystemd unitsSCM (services.exe)
Boot config/boot/grub/grub.cfgBCD store
RecoveryGRUB rescue, live USBWinRE (Windows Recovery)

Tracing boot from the power button to a working desktop fills in a picture you can't get any other way — where the trust boundaries actually sit, which components run with no oversight at all, and which are the natural footholds for an attacker who reaches the machine before login. That picture looks different on every OS, and the gaps are rarely where people expect.