Page 1 of 1

Creating a 64-Bit Kernel

Posted: Sat Feb 25, 2012 4:00 am
by Rudster816
http://wiki.osdev.org/Creating_a_64-bit ... ual_Memory

I'm pretty sure those address's given are wrong, because linear address's are limited to 48 bits. I believe they should be:

0x0000 FFFF 7FFF FFFF -> 0x0000 FFFF FFFF FFFF

as thats the upper 2GB of memory. I'd correct it, but I'm not adventurous enough to actually confirm that's what Linux does.

Re: Creating a 64-Bit Kernel

Posted: Sat Feb 25, 2012 4:23 am
by bluemoon
No. See Canonical form addresses (google is your friend).

Re: Creating a 64-Bit Kernel

Posted: Sun Feb 26, 2012 3:28 am
by linguofreak
Rudster816 wrote:I'm pretty sure those address's given are wrong, because linear address's are limited to 48 bits.


They're right (and the addresses you suggest would cause a general protection fault), because of the specific way in which the addresses are limited to 48 bits: The upper 16 bits must match the high bit of the lower 48 bits. So you have valid addresses from 0x0000 0000 0000 0000 through 0x0000 7FFF FFFF FFFF, and from 0xFFFF 8000 0000 0000 through 0xFFFF FFFF FFFF FFFF, but the addresses from 0x0000 8000 0000 0000 through 0xFFFF 7FFF FFFF FFFF are invalid.