Translation from linear address space to physical address space when paging is turned off

jj1984

Member
OK, in modern 64-bit Intel systems, processors, while in the 64-bit sub-mode of the IA-32e mode (I suppose what most people just call 64-bit mode), have a linear address space of 2^64 bytes.

Now, current computers can't reach all 2^64 addresses, but I think that they use the bottom 2^48.

That is, the theoretical linear address space is 0 to (2^64) - 1, but the actual current linear address space is 0 to (2^48) - 1.

But, 2^48 is still a huge number, 281,474,976,710,656 to be exact; that's over 281 trillion.

Now, computers don't come with anything close to that amount of RAM (NSA hardware excluded).

Further, if I have paging turned off and can't rely on swapping out with a non-volatile memory device to extend the physical address space, then linear addresses directly become physical addresses with no further manipulation.

So, what happens if my 64-bit computer running in 64-bit mode with paging turned off has 6 GB of RAM, but a process that's running upon it puts 7,000,000,000 (7 billion in decimal) or something greater but less than (2^48) - 1 on the address bus in an attempt to read or write or execute?

Obviously, 7,000,000,000 > 6 binary billion.

Thanks.
 

Cromewell

Administrator
Staff member
In assembly you get all ones if you try to read. Writes go off into nowhere. Executes will not do what you want ;)
 

Cromewell

Administrator
Staff member
A seg fault is when you ask for memory that isn't yours. Things like trying to write to a freed pointer or writing to a null address. It's easier to show how to get one in C.
Code:
int *seg = NULL;
*seg = 0;
Or something like this will eventually do it.
Code:
int main(void)
{
  main();
  return 0;
}
Keep in mind, any reasonably modern kernel is going to try to protect memory as best it can. To try and read outrageously high memory ranges you'll want to be running in or around the bootloader. You won't want to be booted into anything reasonable.

I wouldn't suggest writing into those same ranges unless you are absolutely sure no device is living there for IO.
 
Top