Skip to content

[M1] boot.asm: BIOS boot, real mode → protected mode → long mode, GDT setup #2

Description

@mitsuakki

Core boot transition. Covers: 16-bit real mode entry, enabling the A20 line, loading a GDT with flat 32-bit segments, switching to protected mode, building minimal identity-mapped page tables (required for long mode), loading a 64-bit GDT, and jumping to long mode. This is the single densest piece of the whole project.

Resources:

  • OSDev wiki: Setting Up Long Mode
  • OSDev wiki: A20 Line
  • OSDev wiki: GDT Tutorial
  • Intel SDM Vol. 3A, Chapter 9 (System Programming: initialization and mode switching)
  • Decision point: write your own boot sector (full control, more work) vs use GRUB + Multiboot2 (skips real/protected mode entirely, GRUB hands you 32-bit protected mode already). If you want to actually learn the real → protected → long transition, skip GRUB.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions