Page 1 of 1
Page fault after IRQ, yet no paging enabled yet?
Posted: Sun May 20, 2012 5:01 pm
by Lionel
Hi Again!
This is actually kinda weird behavior for my kernel.
See, everything is going along fine, the GDT, IDT, and then the PIT are setup. Then the kernel starts interrupts. Oh look it gets one! Yay, can't wait for the next... wait. Is that... a page fault!? How could this happen, I haven't even setup paging yet! Ok, the overly dramatic explanation aside, that is what happens. It's actually quite peculiar that a page fault happens, and returns a error code, when paging hasn't been setup yet. I do suspect that the pit isn't getting remapped correctly. Is that assumption correct?
Here's a screenshot:
Thanks,
Lionel
Re: Page fault after IRQ, yet no paging enabled yet?
Posted: Sun May 20, 2012 5:12 pm
by darkinsanity
Interrupt 13 is not fired on a page fault. What you got is a
General Protection Fault.
Re: Page fault after IRQ, yet no paging enabled yet?
Posted: Sun May 20, 2012 5:16 pm
by Lionel
Oh, must have got the names of the interrupts mixed up...
Well, now that I did a quick search, I now know what to do, thanks!
Re: Page fault after IRQ, yet no paging enabled yet?
Posted: Sun May 20, 2012 5:55 pm
by Lionel
Wait, actually everything I looked at didn't make sense in my case. Oh how I hate being stuck...
Re: Page fault after IRQ, yet no paging enabled yet?
Posted: Sun May 20, 2012 7:06 pm
by pcmattman
Do you have any more information to work from than what you've shown on your QEMU screenshot (eg, extra data on the serial line)?
If not, you may want to start dumping registers (including EIP and the CRn registers, and EFLAGS) so you can at least nail down what code is causing the GPF.
Otherwise, carry on
Re: Page fault after IRQ, yet no paging enabled yet?
Posted: Sun May 20, 2012 7:35 pm
by serviper
Perhaps there is something wrong with your IDT entries. Fire a software interrupt to make sure your IDT works.
Re: Page fault after IRQ, yet no paging enabled yet?
Posted: Sun May 20, 2012 8:00 pm
by Lionel
serviper:Yes, software interrupts work correctly.
pcmattman: Working on it.
Re: Page fault after IRQ, yet no paging enabled yet?
Posted: Sun May 20, 2012 8:42 pm
by Lionel
Update:
Here's a screen of the registers:
And no, I don't have anything other than that dump to go off of.
Re: Page fault after IRQ, yet no paging enabled yet?
Posted: Sun May 20, 2012 8:47 pm
by gerryg400
Lionel wrote:Update:
Here's a screen of the registers:
And no, I don't have anything other than that dump to go off of.
SS is NULL.
Re: Page fault after IRQ, yet no paging enabled yet?
Posted: Sun May 20, 2012 10:56 pm
by LindusSystem
I had made the same silly error, I mapped Exceptions from 1 to 32 not 0 to 31.
I used to get strange exceptions.After 5days,I came to know that in my IDT it starts from 0!!