Page fault after IRQ, yet no paging enabled yet?

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.
Post Reply
User avatar
Lionel
Member
Member
Posts: 117
Joined: Fri Jul 16, 2010 2:16 pm
Libera.chat IRC: ryanel
Location: California

Page fault after IRQ, yet no paging enabled yet?

Post 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:Image
Thanks,
Lionel
User avatar
darkinsanity
Member
Member
Posts: 45
Joined: Wed Sep 17, 2008 3:59 am
Location: Germany

Re: Page fault after IRQ, yet no paging enabled yet?

Post by darkinsanity »

Interrupt 13 is not fired on a page fault. What you got is a General Protection Fault.
User avatar
Lionel
Member
Member
Posts: 117
Joined: Fri Jul 16, 2010 2:16 pm
Libera.chat IRC: ryanel
Location: California

Re: Page fault after IRQ, yet no paging enabled yet?

Post 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!
User avatar
Lionel
Member
Member
Posts: 117
Joined: Fri Jul 16, 2010 2:16 pm
Libera.chat IRC: ryanel
Location: California

Re: Page fault after IRQ, yet no paging enabled yet?

Post by Lionel »

Wait, actually everything I looked at didn't make sense in my case. Oh how I hate being stuck...
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Re: Page fault after IRQ, yet no paging enabled yet?

Post 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 :)
User avatar
serviper
Member
Member
Posts: 31
Joined: Sat Jul 16, 2011 6:05 am
Location: China
Contact:

Re: Page fault after IRQ, yet no paging enabled yet?

Post by serviper »

Perhaps there is something wrong with your IDT entries. Fire a software interrupt to make sure your IDT works.
User avatar
Lionel
Member
Member
Posts: 117
Joined: Fri Jul 16, 2010 2:16 pm
Libera.chat IRC: ryanel
Location: California

Re: Page fault after IRQ, yet no paging enabled yet?

Post by Lionel »

serviper:Yes, software interrupts work correctly.
pcmattman: Working on it.
User avatar
Lionel
Member
Member
Posts: 117
Joined: Fri Jul 16, 2010 2:16 pm
Libera.chat IRC: ryanel
Location: California

Re: Page fault after IRQ, yet no paging enabled yet?

Post by Lionel »

Update:
Here's a screen of the registers:
Image
And no, I don't have anything other than that dump to go off of.
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: Page fault after IRQ, yet no paging enabled yet?

Post by gerryg400 »

Lionel wrote:Update:
Here's a screen of the registers:
Image
And no, I don't have anything other than that dump to go off of.
SS is NULL.
If a trainstation is where trains stop, what is a workstation ?
LindusSystem
Member
Member
Posts: 63
Joined: Sat Apr 28, 2012 9:41 am
Location: Earth -> Asia

Re: Page fault after IRQ, yet no paging enabled yet?

Post by LindusSystem »

I had made the same silly error, I mapped Exceptions from 1 to 32 not 0 to 31. :D
I used to get strange exceptions.After 5days,I came to know that in my IDT it starts from 0!!
Anyone has a idea of making a ntfs bootsector?if yes PM me , plz.
Post Reply