ChazZeromus
Visitor
|
IRET generates #GP after #PF - 2008/06/17 14:21
In my kernel(x86), at the beginning a paging check is done. The first 3 4mb pages are for the kernel and are marked present like they should be. And the 4th page is just like the first 3 but except it is not marked present and so are the other ones after it. This page setup is done before the page test. The page test writes a value to the first dword in the 4th page to test the page fault exception. It does what it does. And it sets the present flag in the page entry that generated the PF, and it invalidates the page entry so all accesses to the page will have updated page entry information in the TLB. Then all of the sudden, instead of returning to the instruction the generated the PF and restarting the instruction it generated a general-protection exception with the error code saying that a invalidated selector was loaded. I dumped the beginning stack of which the processor pushes information onto when an interrupt is generated and found out that a segment register is loading a word from the saved eip register that the CPU pushed onto the stack. I've searched the address that generated the GP, and found out that the iret instruction that returns the interrupt handler is loading a register with a saved eip on the stack. I have no clue why its doing this. I really need help, I've tried everything!
The kernel is loaded at 0x10000, maybe there's something at that address that a memory-mapped I/O address is referencing and interfering. I need some help.
|