Writing an OS Kernel from Scratch | Windows GPT+UEFI Boot: ESP Partition, NVRAM Boot Entries & Secure Boot Explained

The previous chapter covered MBR+BIOS mode Windows boot, where the System Reserved partition is the core anchor — BOOTMGR and BCD live in that 100MB FAT32 partition, and BIOS finds it via the MBR active partition flag.

But if you bought a brand-name machine after 2014 (ThinkPad, Dell, HP desktops), it’s likely not in MBR mode anymore — it uses GPT+UEFI. The System Reserved partition disappears, replaced by an ESP (EFI System Partition). Boot entries are no longer managed by “active partition flags” but by NVRAM (non-volatile memory) boot entries.

These two modes aren’t just “different partition table formats” — they’re completely different boot philosophies:

Feature MBR+BIOS GPT+UEFI
Partition table location LBA 0 (512 bytes mixed) LBA 1 (GPT Header) + LBA 2-33 (Partition table)
Boot marker MBR 0x80 active bit NVRAM BootOrder (flash, not on disk)
Boot manager location System Reserved (FAT32, 100MB) ESP (FAT32, ≥100MB)
Boot file format BOOTMGR (16-bit real mode) bootmgfw.efi (64-bit PE/COFF)
Secure Boot None Secure Boot (signature chain verification)
Multi-boot GRUB writes MBR + chain loading GRUB writes ESP + NVRAM entries
Disk capacity limit 2TB (32-bit LBA) 8ZB (64-bit LBA, no limit)

This chapter completely dissects the Windows GPT+UEFI boot chain — what’s in the ESP partition, how NVRAM BootOrder works, the Secure Boot signature chain, and all related tools.

Last modified: 2025年11月26日

Author

Comments

Write a Reply or Comment

Your email address will not be published.