TExcelTAD
Home › Operating Systems: Linux & Windows › The Windows Boot Process

The Windows Boot Process

From pressing the power button to seeing the lock screen, a Windows 11 PC runs through a chain of programs. Each stage loads, checks and then hands control to the next one. Knowing that chain helps you fix machines that won't start, understand what Secure Boot and BitLocker actually protect, and compare Windows with the Linux boot process.

The chain at a glance

text
 Power on
   |
 UEFI firmware ............ POST, initialise RAM/CPU/devices, read boot entries from NVRAM
   |   Secure Boot: check signature of the next file
 \EFI\Microsoft\Boot\bootmgfw.efi   Windows Boot Manager (on the EFI System Partition)
   |   reads the BCD store (boot menu, which OS, options)
 \Windows\System32\winload.efi      Windows OS Loader
   |   loads ntoskrnl.exe, hal.dll, the SYSTEM registry hive, boot-start drivers
 ntoskrnl.exe ............. kernel initialisation (phase 0, phase 1), starts drivers
   |
 smss.exe ................. Session Manager: page file, environment, sessions
   |-- csrss.exe + wininit.exe (session 0) -> services.exe, lsass.exe
   |-- csrss.exe + winlogon.exe (session 1) -> LogonUI -> userinit -> explorer.exe

Windows 11 requires UEFI with Secure Boot capability and a TPM 2.0. The old BIOS + MBR path (with bootmgr and winload.exe) still exists for older systems, but new installations always use UEFI and a GPT disk.

Stage 1: UEFI firmware

The firmware tests the hardware (POST), then looks at its boot entries stored in NVRAM. The default Windows entry points to a file on the EFI System Partition (ESP), a small FAT32 partition (usually 100–260 MB) that every OS on the disk shares:

text
ESP (FAT32)
 +- EFI
     +- Boot\bootx64.efi             fallback loader used when NVRAM entries are missing
     +- Microsoft\Boot\bootmgfw.efi  Windows Boot Manager
     +- Microsoft\Boot\BCD           Boot Configuration Data (a registry-format hive)
     +- ubuntu\shimx64.efi           a Linux distro's loader can live next to it

Stage 2: Windows Boot Manager and the BCD

bootmgfw.efi reads the BCD store: which operating systems exist, which one is the default, the timeout, and options such as safe mode or kernel debugging. You view and edit it with bcdedit from an elevated prompt (sample output — yours will differ):

cmd
C:\Windows\System32>bcdedit /enum {current}

Windows Boot Loader
-------------------
identifier              {current}
device                  partition=C:
path                    \WINDOWS\system32\winload.efi
description             Windows 11
locale                  en-US
recoverysequence        {4f1d3c7a-0b2e-11ef-9a3c-8c1645d2e7b1}
displaymessageoverride  Recovery
recoveryenabled         Yes
isolatedcontext         Yes
allowedinmemorysettings 0x15000075
osdevice                partition=C:
systemroot              \WINDOWS
resumeobject            {4f1d3c79-0b2e-11ef-9a3c-8c1645d2e7b1}
nx                      OptIn
bootmenupolicy          Standard
hypervisorlaunchtype    Auto

hypervisorlaunchtype Auto means the Hyper-V hypervisor starts before Windows (needed for WSL 2, Hyper-V and virtualization-based security). If a boot fails repeatedly, the boot manager starts the Windows Recovery Environment (WinRE) from the recoverysequence entry instead.

Stage 3: winload.efi

The OS loader is the last program that uses firmware services. It:

  1. loads ntoskrnl.exe and hal.dll into memory,
  2. loads the SYSTEM registry hive to learn which drivers are marked boot-start,
  3. loads those drivers (storage, file system, the ELAM early-launch anti-malware driver),
  4. if BitLocker is on, gets the volume key (see below),
  5. calls ExitBootServices and jumps into the kernel.

Stage 4: the kernel

ntoskrnl.exe initialises in two phases. Phase 0 runs on one CPU with interrupts off: memory manager, object manager, basic structures. Phase 1 starts the other processors, the I/O manager and Plug and Play, which loads the system-start drivers. The ELAM driver gets to classify every following boot driver as good, bad or unknown before it is initialised. Finally the kernel creates the first user-mode process, smss.exe.

Stage 5: user mode comes up

smss.exe creates the page file, sets environment variables, and starts sessions: session 0 gets csrss.exe and wininit.exe (which starts services.exe and lsass.exe), session 1 gets csrss.exe and winlogon.exe, which shows the logon UI. After you sign in, userinit.exe runs logon scripts and starts explorer.exe, your desktop. The Windows NT Architecture lesson describes these processes.

The model below replays the stages and prints a timeline (the durations are made-up but realistic for an SSD laptop):

python · try it yourself
stages = [
    ("UEFI firmware (POST)",          2.10),
    ("Boot Manager + BCD",            0.35),
    ("winload: kernel, HAL, drivers", 0.90),
    ("kernel phase 0 + phase 1",      1.40),
    ("smss, csrss, wininit",          0.60),
    ("services.exe auto-start",       2.30),
    ("winlogon -> lock screen",       0.80),
]
t = 0.0
for name, secs in stages:
    print(f"{t:5.2f}s  {name}")
    t += secs
print(f"{t:5.2f}s  ready for sign-in")
firmware = stages[0][1]
print(f"firmware share: {firmware / t:.0%}")
 0.00s  UEFI firmware (POST)
 2.10s  Boot Manager + BCD
 2.45s  winload: kernel, HAL, drivers
 3.35s  kernel phase 0 + phase 1
 4.75s  smss, csrss, wininit
 5.35s  services.exe auto-start
 7.65s  winlogon -> lock screen
 8.45s  ready for sign-in
firmware share: 25%

Task Manager's Startup apps page shows a "Last BIOS time", which is exactly the first line of that timeline: time spent in firmware before Windows got control.

Secure Boot: a chain of signatures

Secure Boot is a UEFI feature. The firmware holds databases of trusted keys (db) and revoked hashes or certificates (dbx). It only runs a boot loader whose signature chains to a key in db and that is not listed in dbx. The boot manager then checks winload.efi, which checks the kernel and boot drivers. Linux distributions boot with Secure Boot on through shim, a small loader signed by Microsoft's third-party UEFI CA that then checks the distro's own GRUB and kernel.

python · try it yourself
TRUSTED = {"Microsoft Windows Production PCA", "Microsoft UEFI CA"}
REVOKED = {"bootmgr-2022-vulnerable"}

chain = [
    ("bootmgfw.efi", "Microsoft Windows Production PCA", "bootmgr-2025"),
    ("winload.efi",  "Microsoft Windows Production PCA", "winload-2025"),
    ("ntoskrnl.exe", "Microsoft Windows Production PCA", "nt-2025"),
]

def secure_boot(chain):
    for name, signer, build in chain:
        if build in REVOKED:
            return f"STOP: {name} is in dbx (revoked)"
        if signer not in TRUSTED:
            return f"STOP: {name} signed by untrusted '{signer}'"
        print(f"ok   {name:<13} signed by {signer}")
    return "boot continues"

print(secure_boot(chain))
print()
tampered = chain[:1] + [("winload.efi", "Evil Corp", "rootkit")] + chain[2:]
print(secure_boot(tampered))
print()
old = [("bootmgfw.efi", "Microsoft Windows Production PCA", "bootmgr-2022-vulnerable")]
print(secure_boot(old))
ok   bootmgfw.efi  signed by Microsoft Windows Production PCA
ok   winload.efi   signed by Microsoft Windows Production PCA
ok   ntoskrnl.exe  signed by Microsoft Windows Production PCA
boot continues

ok   bootmgfw.efi  signed by Microsoft Windows Production PCA
STOP: winload.efi signed by untrusted 'Evil Corp'

STOP: bootmgfw.efi is in dbx (revoked)

Check the state on a real PC from an elevated PowerShell (or in msinfo32 under "Secure Boot State"):

powershell
PS C:\Users\ada> Confirm-SecureBootUEFI
True

Measured boot, the TPM and BitLocker

Secure Boot blocks untrusted code. Measured boot records what ran: before each stage starts the next, it hashes it and extends a Platform Configuration Register (PCR) in the TPM: PCR = SHA256(PCR || SHA256(component)). A PCR can only be extended, never set, so its final value is a fingerprint of the whole boot sequence.

BitLocker encrypts the volume with a key that is sealed by the TPM to specific PCR values (by default PCR 7, the Secure Boot policy, and PCR 11, BitLocker's own boot-manager measurements). If the boot chain changes (a different loader, Secure Boot turned off, the disk moved to another PC), the PCRs differ, the TPM refuses to unseal, and Windows asks for the 48-digit recovery key.

python · try it yourself
import hashlib

def extend(pcr, component):
    measurement = hashlib.sha256(component.encode()).digest()
    return hashlib.sha256(pcr + measurement).digest()

def measure(components):
    pcr = bytes(32)                      # PCRs start as all zeros
    for c in components:
        pcr = extend(pcr, c)
    return pcr

good = ["secureboot=on", "db=Microsoft", "bootmgfw.efi v2025"]
sealed_to = measure(good)
print("sealed to PCR value", sealed_to.hex()[:16], "...")

for label, chain in [
    ("normal boot", good),
    ("Secure Boot off", ["secureboot=off", "db=Microsoft", "bootmgfw.efi v2025"]),
    ("same parts, other order", ["db=Microsoft", "secureboot=on", "bootmgfw.efi v2025"]),
]:
    pcr = measure(chain)
    result = "unseal key, boot" if pcr == sealed_to else "ask for recovery key"
    print(f"{label:<24} {pcr.hex()[:16]}  -> {result}")
sealed to PCR value 6805522103e193c0 ...
normal boot              6805522103e193c0  -> unseal key, boot
Secure Boot off          49838c0a86514133  -> ask for recovery key
same parts, other order  91b1dde4aa87f543  -> ask for recovery key

Notice the third case: even the order of measurements changes the final value. Check BitLocker with manage-bde -status from an elevated prompt (sample output — yours will differ):

cmd
C:\Windows\System32>manage-bde -status C:
Volume C: [Windows]
[OS Volume]

    Size:                 475.83 GB
    BitLocker Version:    2.0
    Conversion Status:    Used Space Only Encrypted
    Percentage Encrypted: 100.0%
    Encryption Method:    XTS-AES 128
    Protection Status:    Protection On
    Lock Status:          Unlocked
    Identification Field: Unknown
    Key Protectors:
        TPM
        Numerical Password

Tip: Before updating firmware or changing Secure Boot settings, run manage-bde -protectors -disable C: (BitLocker resumes after the next reboot), and always know where your recovery key is stored (your Microsoft account or your organisation's Entra ID).

Fast startup and recovery

Fast startup (on by default) makes "Shut down" a partial hibernation: user sessions are closed, but the kernel session is saved to hiberfil.sys and restored at the next boot, skipping driver initialisation. A Restart always does a full boot, which is why "have you tried restarting?" fixes more than "shut down and power on". When Windows fails to start twice in a row, it boots WinRE, where Startup Repair, System Restore and a command prompt are available. Holding Shift while clicking Restart gets you there on purpose.

Stage Windows Linux
Firmware UEFI UEFI
Boot loader Windows Boot Manager (bootmgfw.efi) + BCD shim + GRUB 2 or systemd-boot
Kernel loader winload.efi GRUB loads vmlinuz + initramfs
First user process smss.exe systemd (PID 1)
Services services.exe (SCM) systemd units
Disk encryption BitLocker (TPM) LUKS (optionally TPM via systemd-cryptenroll)

Learn more: The Linux Boot Process · Windows Services · The Windows Registry

Test yourself

Which file is the Windows Boot Manager on a UEFI system?

  1. winload.efi
  2. bootmgfw.efi
  3. ntoskrnl.exe
  4. smss.exe

What is the difference between Secure Boot and measured boot?

  1. They are the same thing
  2. Secure Boot blocks unsigned loaders; measured boot records hashes of what ran in TPM PCRs
  3. Secure Boot encrypts the disk; measured boot checks signatures
  4. Measured boot only exists on Linux

Why does BitLocker ask for the recovery key after Secure Boot is turned off?

  1. The disk is corrupted
  2. The PCR values differ from the ones the key was sealed to, so the TPM refuses to release it
  3. Secure Boot stores the password
  4. The BCD store was deleted