GPF for Paging?

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
Cjmovie

GPF for Paging?

Post by Cjmovie »

It seems that I can enable paging fine and dandy - But as soon as I call a function (or do a jmp or call at all, I'm assuming) I get a GPF.
I'm guessing this has to do with a bad table/directory/etc., in other words I'm guessing that my entries are bad. Could this be the case, or something else? Just for completness, I've added this:

Image
Cjmovie

Re:GPF for Paging?

Post by Cjmovie »

Wikipedia said that enabling paging while disabling protection...what the heck is that?

Anyways, I figured it had something to do with the mapping. I put I debugger Print and PrintHexInt function inside the mapper, turns out I was taking the Linear Page Number and Dividing it by 4096, not 1024, to get the table index...hehehe

Cool, I solved my own problem!

So to test the paging, I wrote a string ("This is virtual, so virtual!") to 0x600000 (6th MB starting point) and then mapped that to 0x500000 (5th MB starting point) and called Print((char*)0x500000);, and it works! It prints out the string that *really* isn't there!
Crazed123

Re:GPF for Paging?

Post by Crazed123 »

Linear Page Number? Meaning the number of the page, not its address in memory? Yeah, you do "number % 1024" to get the table index.
Cjmovie

Re:GPF for Paging?

Post by Cjmovie »

Yes, I do a kind of addressing as found on LBA drives etc.

I address pages either as what address they modify in memory or the number when put linear, eg. 0-1023 is in page table #1, 1024-2047 are in page table #2.
Post Reply