This simplifies the hardware design and moves the policy into the operating system, a standard RISC approach. The argument against software refill is that it is more expensive than performing TLB misses in hardware. The MIPS R2000 and R3000 have software-based TLB refill mechanisms. TLB misses result in a PageFaultException and must be resolved by a student-provided TLB miss handler. While the page tables help manage virtual pages, virtual memory also requires physical page management.
Physical pages can be either in use or free.
If a page fault occurs when there are no longer any free physical pages, one page must be selected via a replacement policy. This victim page is swapped out of memory and the physical page previously occupied by the victim is used to store the contents of the new page being swapped in. The textbook covers several page replacement policies. The clock algorithm is easy to implement and gives reasonable performance results. The figure below suggests one possible abstraction of a Nachos virtual memory implementation.