Quote:
Originally Posted by kailas
Can someone please let me know how is the process memory layout on x86_64?
Does it load ELFs on the same entry point i.e. 0x8048000?
|
Hi kailas,
x86-64 uses "canonical form", with 48 bits assigned for virtual address space.
Bits 48 through 63 of any virtual address must be copies of bit 47 , or the
processor will raise an exception. Canonical form addresses run from 0 through
00007FFF`FFFFFFFF, and from FFFF8000`00000000 through FFFFFFFF`FFFFFFFF, for a
total of 256 TB of usable virtual address space.
The virtual address space layout is shown below.
Code:
ffffffff`ffffffff _____________
| |
| region 2 |
ffff8000`00000000 |____________|
| |
| Unused |
| Space |
| |
00007fff`ffffffff |____________|
| |
| region 1 |
00000000`00000000 |____________|
The only NaNs that get included in the Virtual Address Space are the +ve NaNs,
(below is the NaN format)
Code:
______________________________________________________________________
| | |
|1| 11111111111 | Non Zero Fraction (f)
|_|_________________|__________________________________________________
63 62 52 51 0
My Question:
We have tried to create a shared memory segment (in Linux). I could attach the
shared memory on addresses that belong to the (Region 1) as shown above.
Code:
#define SEGMENT_SIZE 1000000
for the SEGMENT_SIZE, addresses that could be attached to the segment were ...
0x6ffffffff000 then 0x700000000000 then 0x700000001000 ......
0x7ffffff00000 then 0x7ffffff01000 then 0x7ffffff02000 then 0x7ffffff03000 ..... 0x7ffffff0a000
No addresses beyond this could be attached.
Quote:
(WIKIPEDIA)
many operating systems take the higher-addressed half of the address space
(named kernel space) for themselves and leave the lower-addressed half (user
space) for application code, user mode stacks, heaps, and other data
regions.
|
Does anyone know why I could not attach an address in the (Region 2 - as shown above) to the
shared memory segment ??
-regmee