Page 1 of 1

Enabling page in qemu cause trifault, but not in real hw

Posted: Tue Mar 30, 2021 4:34 am
by clementttttttttt
For some reason, my operating system suddenly started to triple fault on the enable page code in qemu, but not in bochs or on my own computer, and google didn't really helped, as usual. Everything looks fine to me, page directory table is aligned to 0x20 and page directory is aligned to 0x1000(I'm using PAE and 2MIB pages).

Re: Enabling page in qemu cause trifault, but not in real hw

Posted: Tue Mar 30, 2021 5:44 am
by iansjack
clementttttttttt wrote:page table is aligned to 0x20 and page directory is aligned to 0x1000(I'm using PAE).
Not quite sure what you mean here. All tables in the page-table hierarchy should be page (0x1000) aligned.

Re: Enabling page in qemu cause trifault, but not in real hw

Posted: Tue Mar 30, 2021 6:32 am
by clementttttttttt
Changed all alignments to 0x1000, still no luck.

Re: Enabling page in qemu cause trifault, but not in real hw

Posted: Tue Mar 30, 2021 6:40 am
by iansjack
Then I'd suggest that you use gdb to debug it. Set a break point where you think the triple fault is happening and see what is going wrong. You can use "info memory" in the emu monitor to see if the page mapping is reasonable.

Re: Enabling page in qemu cause trifault, but not in real hw

Posted: Wed Mar 31, 2021 1:00 am
by clementttttttttt
oh nevermind, it's just a typo in the map page function, i accidentally made it map 50 pages instead of 5 pages