Address-translation

So, at runtime, the process looks up a virtual address which is, say, 9,192 bytes from 0, that is, its virtual address: va = 9192 = 0x000023E8. If each page is 4,096 bytes in size, this implies the va address is on the third page (page #2), at an offset of 1,000 bytes from the start of that page.

So, with one level of indirection, we have: va = (page, offset) = (2, 1000).

Aha! Now we can see how address-translation works: the OS sees that the process wants an address in page 2. It does a lookup on the PT for that process, and finds that page 2 maps to page frame 5. To calculate the physical address shown as follows:

pa = (pf * PAGE_SIZE) + offset   = (5 * 4096) + 1000   = 21480 = 0x000053E8

Voila!

The system now places the ...

Get Hands-On System Programming with Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.