13.07.2015 Views

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Paging 971 type2 PageFrameNumber = 0 .. 2 21 - 1;3 Protection = (NNNN, NNNR, NNNW, NNRR, NNRW, NNWW, NRRR,4 NRRW, NRWW, NWWW, RRRR, RRRW, RRWW, RWWW, WWWW);5 PageTableEntry =6 record { 32 bits long }7 Present : Boolean; { bit [0] }8 Protection : Protection; { bits [1..3] }9 Dirty : Boolean; { bit [4] }10 PageFrame : PageFrameNumber; { bits [15..35] }11 end;12 var13 KernelBaseRegister : PageFrameNumber; { in a register}14 { base of the kernel page table, which is contiguous in physical store }15 KernelLength : integer;16 { Maximum kernel page accessible }17 ProcessBaseRegister0, ProcessBaseRegister1 : integer; { 30 bits}18 { interpreted in kernel virtual space }19 ProcessLength0, ProcessLength1 : integer;20 { Maximum process page accessible }Figure 3.16 shows the tables and the translation algorithm for a reference made bya process. This figure does not specify whether access is through page table 0 or pagetable 1. As in the previous figures, Figure 3.16 shows the checks that are made. Theseare the traps that can occur:abcdefThe page table entry for this page is located beyond the end of kernel space.The kernel does not have the read permission for the appropriate page of the processpage table.The appropriate page of the page table is missing.The page is beyond the end of process space. (This check is made by comparingall the bits of Page against ProcessLength.)The process does not have access permission for the type of access it is trying tomake on this page.The desired page is missing.Of these, trap b is a kernel error, traps a, d, and e are process errors, and traps c and f areordinary page faults that are treated by swapping in the necessary pages. The VAXarchitecture makes these tests in the order d, a, b, c, e, f.6.5 Paging in virtual machinesIn Chapter 1, we saw how a virtual machine operating system provides a processinterface that appears identical to the hardware interface. We turn now to a subject wedeferred then, how storage management fits into virtual machine operating systems.The most significant issue is how to emulate address-translation tables. For thesake of concreteness, we will discuss paging, although the same issues arise for any ofthe other storage management mechanisms we have seen. Each virtual machine P i runningunder the control of a single virtualizing kernel V needs to access what it considersto be the true address-translation tables, since virtual machines are meant to look just like

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

Saved successfully!

Ooh no, something went wrong!