Debugging the OS with VirtualBox

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
Bonfra
Member
Member
Posts: 270
Joined: Wed Feb 19, 2020 1:08 pm
Libera.chat IRC: Bonfra
Location: Italy

Re: Debugging the OS with VirtualBox

Post 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!
Regards, Bonfra.
sj95126
Member
Member
Posts: 151
Joined: Tue Aug 11, 2020 12:14 pm

Re: Debugging the OS with VirtualBox

Post 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.
Post Reply