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:
GPF for Paging?
Re:GPF for Paging?
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!
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!
Re:GPF for Paging?
Linear Page Number? Meaning the number of the page, not its address in memory? Yeah, you do "number % 1024" to get the table index.
Re:GPF for Paging?
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.
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.