log/2026-07-21-eos
Date2026-07-21
Projecteos
Typenote
Subject

eos defines and loads its own GDT

eos no longer runs on the segments that GRUB leaves behind. The kernel now defines its own GDT and loads it at boot.

The table has three entries: the null descriptor, a code segment and a data segment. Both segments are flat: base 0, with a limit of 4 GB.

The loader disables interrupts, runs lgdt, and loads the data selector into ds, es, fs, gs and ss. It sets the stack pointer directly after ss. A far jump then loads the code selector into cs.

The commit is df92949.

j older · k newer · q back to the log