Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>A CPU that provides virtual memory lets you set up a mapping of the memory addresses as the CPU sees it to physical memory addresses , typically this is done by a harware unit called the MMU. </p> <p>The OS kernel can program that MMU, typically not down to the individual addresses, but rather in units of pages (4096 bytes is common). This means the MMU can be programmed to translate e.g. virtual addresses 0x1000-0x2000 to be translated to physical address 0x20000-0x21000.</p> <p>The OS keeps one set of these mapping per process, and before it schedules a process to run, it loads that mapping into the MMU before it switches control back to the process. This enables different mappings for different processes, and nothing stops those mappings from mapping the same virtual address to a different physical address. </p> <p>All this is transparent as far as the program is concerned, it just executes instructions on the CPU, and as the CPU has been set to virtual memory mode (paged mode), every memory access is translated by the MMU before it goes out on the physical bus to the memory.</p> <p>The actual implementation details are complicated, but here's some references that might provide more insight;</p> <ul> <li><a href="http://wiki.osdev.org/Paging" rel="noreferrer">http://wiki.osdev.org/Paging</a></li> <li><a href="http://www.usenix.org/event/usenix99/full_papers/cranor/cranor.pdf" rel="noreferrer">http://www.usenix.org/event/usenix99/full_papers/cranor/cranor.pdf</a></li> <li><a href="http://ptgmedia.pearsoncmg.com/images/0131453483/downloads/gorman_book.pdf" rel="noreferrer">http://ptgmedia.pearsoncmg.com/images/0131453483/downloads/gorman_book.pdf</a></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload