Page 1 of 1

Paging faults when accessing last 3 bytes of last page

Posted: Wed Mar 14, 2012 7:14 am
by max
Hey guys,

I'm currently developing my memory management system. Now I set up the kernels page directory with one page table, identity mapping the first 4 Mebibyte of memory.

Now when activating paging, I am able to access the memory from 0x000000 to 0x3FFFFC, but when I want to use 0x3FFFFD, 0x3FFFFE or 0x3FFFFF I get a page fault.

So I just set up the directory, zero each entry, then set up the first table, map 4MiB and enable paging. Do you have an idea whats wrong with it (allocator.getPage() returns a value higher than 0x400000 representing a free memory area)?

http://pastebin.com/Ts4SJt5v

Thanks in advance :)

Re: Paging faults when accessing last 3 bytes of last page

Posted: Wed Mar 14, 2012 7:17 am
by Solar
\me holds his eyes closed, trying to nail this one without looking at the code

Could it be that your "access" is accessing an int (4 bytes)?

Re: Paging faults when accessing last 3 bytes of last page

Posted: Wed Mar 14, 2012 7:19 am
by max
You are right, thank you very much for your help.

Problem solved :D

Re: Paging faults when accessing last 3 bytes of last page

Posted: Wed Mar 14, 2012 8:35 am
by Kevin
You seem to have serious trouble with the idea that data has a length. ;)