Page 1 of 1

3GB address

Posted: Sun Dec 25, 2011 10:07 pm
by skandalOS
Hello,
in my Framework where I'm working is something
which I have no idea why it is so...

There is a function in MemoryManager like:

get3GBAddressOfPPN(physical_page_number)
{
return (3U*1024U*1024U*1024U) + (physical_page_number * page_size); // page_size = 4096
}

which gives you a 3 GB Address of a given page frame.

So, why is there the concept of getting 3 GBAddress, you are here limited for addressing only up to 1 GB (area between 3gb-4gb)
so what happens if need more than 1 GB for addressing or > 1GB/PAGE_SIZE = 262143 Pages respectively.

for example:
get3GBAddressofPPN(262144) ==> here you get 0x0 as address

This was a little example so that I could explain my problem, I hope you understood it...so you can ignore the codes above

my aim is to get some theoretical information

thanks

Re: 3GB address

Posted: Mon Dec 26, 2011 3:15 am
by Combuster
You can't map all memory for writing into kernel space on a 32-bit system.

There is no real need to have it all mapped either: either it's user data and you can access it in the user range (0-3g in your case), or it's kernel data and you map it whenever you allocate it. Anything not mapped belongs to a different process and therefore should not normally be accessible from other tasks (and you may temporarily map pages when crossing that boundary).