Page 3 of 3

Re: Debugging the OS with VirtualBox

Posted: Wed Mar 24, 2021 3:38 pm
by Bonfra
Octocontrabass wrote: Oh, how about that, interrupts are enabled. Did you forget to disable interrupts before switching to long mode? Some BIOS calls require interrupts to be enabled and will not disable them before returning to your code.
That explains a lot of things... I've added a CLI before entering long mode and now it works! The kernel successfully boots up and everything works. Thanks a lot!

Re: Debugging the OS with VirtualBox

Posted: Wed Mar 24, 2021 5:40 pm
by sj95126
Octocontrabass wrote:
sj95126 wrote:This pattern (data cpl0, code cpl0, data cpl3, code cpl3) matches your 64-bit GDT but apparently it thinks you've set 16-bit segments.
I think it's just displaying them wrong. It shows the appropriate bits are set to put the CPU in 64-bit mode.
Sure enough, it's displaying them wrong. I made my kernel deliberately triple fault, and it shows my gdt entries as 16-bit as well. My gdt does not and never has contained anything but 64-bit entries, so it's definitely a bug.