Page 1 of 1
How to map to 0xffffffff80000000 - -> 0xffffffffffffffff
Posted: Thu Feb 12, 2015 11:19 am
by markq
According this this tutorial (
http://wiki.osdev.org/Creating_a_64-bit ... ual_Memory) the linux kernel maps physical memory starting from 0x0 to the region 0xffffffff80000000 - -> 0xffffffffffffffff which is -2gb. I have setup up the PML4, PDPT, PD and PT tables but these only maps to positive virtual memory addresses. How do you map to negative virtual addresses? Do I have to flip like a sign bit some where?
Re: How to map to 0xffffffff80000000 - -> 0xffffffffffffffff
Posted: Thu Feb 12, 2015 11:41 am
by kzinti
There is no such thing as a negative (virtual or not) address. That address range is expressed as hexadecimal unsigned numbers.
Re: How to map to 0xffffffff80000000 - -> 0xffffffffffffffff
Posted: Thu Feb 12, 2015 11:46 am
by markq
kzinti wrote:There is no such thing as a negative (virtual or not) address. That address range is expressed as hexadecimal unsigned numbers.
Hi,
I can see that it's address expressed as hexadecimal unsigned number, but even with PML4 I can only map 256 TB and not enough to reach 0xffffffff80000000. If I want to map to 0xffffffff80000000 which entrie(s) should I fill in the PML4 table?
Re: How to map to 0xffffffff80000000 - -> 0xffffffffffffffff
Posted: Thu Feb 12, 2015 11:50 am
by Combuster
markq wrote:not enough to reach 0xffffffff80000000.
The second half of PML4 maps the last TBs of virtual memory. You actually can't map the
middle addresses, but 0xffffffffffffffff is perfectly fine.
Re: How to map to 0xffffffff80000000 - -> 0xffffffffffffffff
Posted: Fri Feb 13, 2015 9:40 am
by JAAman
btw:
this is explained in the Intel 1:3.3.7
Its not often I refer to volume 1, but it doesn't seem to be mentioned in 3... though it is shown in the figures accompanying 3A:3.10.1 & 3.10.2 (and referred to without explanation in 3A:5.15.13 -- the chapter 5 section describing #GP)