Linux memory uses the flat model of protected mode, which bypasses Intel's segment memory management, as the segment selector for all processes points to GDT, and only four of the GDT are useful:
The code is as follows |
Copy Code |
. Quad 0X00CF9A000000FFFF/* 0x10 kernel 4GB Code at 0x00000000 * * . Quad 0X00CF92000000FFFF/* 0x18 kernel 4GB data at 0x00000000 * * . Quad 0X00CFFA000000FFFF/* 0x23 user 4GB Code at 0x00000000 * * . Quad 0X00CFF2000000FFFF/* 0x2b user 4GB data at 0x00000000 * *
|
The base of each segment descriptor is 0, the size is 4G, only the difference of permissions.
Also said that the virtual address in Linux after the section-type management of the map into a linear address, the value of the unchanged.
Linux Real memory management is based on page management, in the case of Level two page table: the subscript of the high 10-bit of the linear address is used to locate the page table, the middle 10-bit subscript for PT is used to locate the page table entry, and the lower 12 bit is the page offset address.