Question 4 -- 20 points

Suppose you have a system with 32-bit pointers and 4 megabytes of memory partitioned into 4096-byte pages. The system employs an inverted page table combined with the ``second chance'' (clock) page replacement algorithm. Assume that there is no page sharing between processes.

Answer the following questions:

  1. Describe what page table entries should look like. How many bits should be in each page table entry, and what are they for? How many page table entries should there be in the page table?
  2. In the absence of a TLB, describe how a virtual address is translated into a physical address for a memory-resident page. How can this be made more efficient without adding a TLB?
  3. In order to make such a scheme efficient enough to use on a real machine, you need a TLB. Describe what this is, and how it works.
  4. What needs to occur on a context switch?
  5. Describe what happens when a page fault occurs for a non-resident page. What extra data structures need to be maintained?