Trouble Loading GDT
Posted: Sat Aug 05, 2017 12:30 pm
I've been working through creating a simple kernel and I'm loading my GDT now. I used GRUB as my bootloader.
My goal is to setup a flat memory model. However, I am having quite some trouble getting it to load. I am using QEMU and it is triple faulting.
I load the GDT from my kernel by calling the gdt_init() function.
I've discovered the problem lies with instruction in load_gdt(). Everything up to that point "works." I suspect this might be due to an error in setting up my GDT, but I'm not sure where I went wrong.
RESOLVED: The issue was me failing to pass the gdt pointer correctly on the stack when loading it.
My goal is to setup a flat memory model. However, I am having quite some trouble getting it to load. I am using QEMU and it is triple faulting.
I load the GDT from my kernel by calling the gdt_init() function.
I've discovered the problem lies with instruction in load_gdt(). Everything up to that point "works." I suspect this might be due to an error in setting up my GDT, but I'm not sure where I went wrong.
RESOLVED: The issue was me failing to pass the gdt pointer correctly on the stack when loading it.