Writing an OS Kernel from Scratch | Windows Boot Manager vs GRUB: A Complete Analysis of Two Boot Loaders
From 360 to 362, we covered the BIOS/UEFI → MBR/GPT → GRUB boot chain. GRUB is the standard bootloader for Linux, but Windows uses a completely different system — BOOTMGR (Boot Manager) and BCD (Boot Configuration Data).
Have you ever wondered about these questions:
- What exactly is inside Windows’ “System Reserved” partition?
- Why does reinstalling Windows overwrite GRUB, but the reverse doesn’t happen?
- What does the
bcdeditcommand actually modify? - Why can Windows 10/11 boot from a VHD file without needing a virtual disk?
- What’s the difference between GRUB 1 and GRUB 2? Why are some systems still using GRUB 1?
Today, we’ll deeply dissect these two boot loaders — Windows’ BOOTMGR + BCD, and the evolution history of GRUB’s Stage 1/Stage 2.
Windows Boot Loader: The Complete BOOTMGR Chain
Three Firmware Modes, Three Boot Chains
Windows’ boot chain is determined by the firmware type:
Legacy BIOS + MBR:
POST → MBR(0x7C00) → BOOTMGR(C:BootBOOTMGR) → {BCD in C:}
UEFI + GPT (Most Common):
POST → UEFI → NVRAM BootOrder → EFIMicrosoftBootootmgfw.efi
→ BCD(C:BootBCD) → winload.efi → ntoskrnl.exe
Legacy BIOS + GPT (Rare):
POST → MBR(Protective) → BIOS Boot Partition (GRUB/BOOTMGR coexist)
→ BOOTMGR → BCDWe’ll focus on the most common UEFI + GPT chain.
What Is BOOTMGR
BOOTMGR is Windows’ Boot Manager, a 32-bit compressed executable (with NTFS compression enabled). Its responsibilities are:
- Read the BCD (Boot Configuration Data)
- Display the boot menu (if there are multiple boot entries)
- Load the Windows boot loader (winload.exe / winload.efi)
BOOTMGR File Location (UEFI mode):
C:EFIMicrosoftBootootmgfw.efi
BCD File Location:
C:BootBCD (under ESP root's Boot directory in UEFI mode)
BOOTMGR Dependent System Files:
C:WindowsSystem32winload.efi ← The actual Windows kernel loader
C:WindowsSystem32
toskrnl.exe ← The Windows kernel itselfSystem Reserved Partition
When installing Windows on an MBR disk, Windows automatically creates a 100MB System Reserved partition (also called the “system partition”). This partition contains:
System Reserved Partition Contents:
├── Boot ← Boot folder
│ ├── BCD ← Boot Configuration Data
│ ├── BOOTMGR ← Windows Boot Manager
│ ├── fonts ← Boot fonts (Chinese, etc.)
│ └── Resources ← Boot animation resources
└── System Volume Information ← Locked metadata directoryPurpose: Even if Windows’ C: drive is damaged or reformatted, the BOOTMGR + BCD in the System Reserved partition remain intact, allowing the boot repair environment (WinRE) to start. This is also why Windows 10/11 installation defaults to checking “Create a system partition for Windows” — it’s not wasted space… [truncated]
Comments