13.07.2015 Views

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Paging 99example simple, these virtual machines are tiny: Each has a virtual main store of threepages. The figure shows the page tables maintained by V to manage the two virtualspaces, as well as a picture of main store as seen from V’s point of view. The only fieldsshown in the page tables are Page Frame and Present. Residing in P 1 is an ordinaryoperating system, which currently supports two processes, D 1 and D 2 . Together, theyoccupy all the main store available to P 1 . (In a more realistic example, we would have toleave some room in that store for P 1 ’s kernel as well.) <strong>An</strong>other operating system residesin P 2 , and it has only one client, process E 1 .Let us imagine that D 1 is currently executing. None of the five page tables shownis appropriate for the hardware to use. When D 1 refers to page 0, that should map topage 2 of P 1 , which is in page frame 6 of the main store. Similarly, D 1 ’s page 1 shouldmap to page 0 of P 1 , which is page 8 of main store. In other words, the proper page tablefor D 1 is a composite of the tables for D 1 and P 1 . In mathematical terms, this page tablecomposes the mappings specified by tables D 1 and P 1 . If P 1 were also a virtualizing kernel,more adjacent levels of the virtual-machine hierarchy would need to be composed.0 101012D 1virtual storeD 2virtual storeE 1virtual storeD1 page frame pres.0 2 Y1 0 YD0 1 21 1 0D 1 D 2 D 1P 1virtual store2 page frame pres.0n1 1 YE1012page frame120pres.YYY0 1 22 0 1E 1 E 1 E 1P 2virtual storeP 2P 1 page frame pres.page frame pres.0 8 Y0n12 6nY1242YY0 1 2 3 4 5 6 7 8 92 1 2 0P 2 P 2 P 1 P 1V physical storeFigure 3.17 Two levels of address translation

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!