Translating Linear Address to Physical

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
I'm heaving difficulties understanding the way Linux translate linear address into physical one. Let me spread out my understanding of the process, and please correct me where I'm wrong !!! and explain me what I miss !!!

1) Linux uses the same base address (0x0) for both CS and DS. Each segment spans 4MB of memory.
2) Given logical address (i.e SEG:OFFSET) the segment is used as an index to an entry either in the GDT or LDT
3) The system then takes the base address noted in the segment descriptor (pointed by the given selector) and adds it the offset from earlier step. Considering base address is always 0x0, we get that the offset is our linear address under all circumstances.
4) At this point we take our linear address (which is effectively our offset) and translate it using paging mechanism. 10 bit for directory index, 10 bits for page table and 12 bits for offset within the page.

What I don't understand is how can we manage the linear address to 'have the right value' such that the paging will work as we expect it to. After all we take the offset and split it into (10, 10, 12) bits values. How can I be sure that this split will work and the given page directory, page table and page offset will have the correct values? What makes this magic works?


--
Respectfully yours,

Doron Bleiberg
E-Mail: kernel.doron@xxxxxxxxx

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux