4 ms·
As someone else who wrote an operating system, I initialized the GDT in the bootloader as well. The goal was to get into long mode ASAP, so I just did it in ass
by Blackthorn 9y ago
As someone else who wrote an operating system, I initialized the GDT in the bootloader as well. The goal was to get into long mode ASAP, so I just did it in assembler.
Don't just take my word for it. Grub does it too. Example: https://github.com/coreos/grub/blob/40e2f6fd353061fdb3ec4dd6be4b32f8f4aaf55f/grub-core/boot/i386/qemu/boot.S https://github.com/coreos/grub/blob/40e2f6fd353061fdb3ec4dd6...