3 ms·
Hi there, I'm left wondering if you started this [1] from scratch or used a sample OS project? I don't understand why'd you initialize the GDT in the bootloader
by gonmf 9y ago
Hi there, I'm left wondering if you started this [1] from scratch or used a sample OS project? I don't understand why'd you initialize the GDT in the bootloader.
[1] https://github.com/kbrsh/arc https://github.com/kbrsh/arc
- Blackthorn 9y agoAs 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...
- kbr 9y agoI started it from scratch. I mainly reference a book about the implementations of operating systems. I initialize a basic GDT in the bootloader because it is essential. Without it, you cannot run the OS in long mode, which will unlock the capabilities of a 64 bit system.
- 5_minutes 9y agoCome on.