Creating a 64-Bit Kernel

All about the OSDev Wiki. Discussions about the organization and general structure of articles and how to use the wiki. Request changes here if you don't know how to use the wiki.
Post Reply
Rudster816
Member
Member
Posts: 141
Joined: Thu Jun 17, 2010 2:36 am

Creating a 64-Bit Kernel

Post 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.
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: Creating a 64-Bit Kernel

Post by bluemoon »

No. See Canonical form addresses (google is your friend).
linguofreak
Member
Member
Posts: 509
Joined: Wed Mar 09, 2011 3:55 am

Re: Creating a 64-Bit Kernel

Post 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.
Post Reply