Overview

In our previous readings, we learned that processes provide the illusion of a single, large, and private address space despite the fact that physical memory (DRAM) is shared amongst many processes. In this reading we’ll learn about virtual memory, a system that not only helps to provide this illusion but also has many other benefits.

Required Reading

Sections 9.1-9.5 (pp. 802-813) from the course textbook.

Learning Objectives

BASIC Learning Objectives

Each student will be responsible for learning and demonstrating proficiency in the following objectives PRIOR to the class meeting. The reading quiz will test these objectives.

  1. Compare and contrast systems that use physical addressing and those that use virtual addressing.
  2. Describe the following three subsets of virtual pages: unallocated, cached, uncached.
  3. Describe why DRAM caches are organized as they are (e.g. fully associative).
  4. Describe the roles of the operating system, the memory management unit (MMU), and the page table in Virtual Memory.
  5. Given the size of a page and the virtual address size, calculate the number of page table entries (PTEs).
  6. Given a page table entry and a type of access (e.g. user mode read), determine whether a segmentation fault will occur.

ADVANCED Learning Objectives

The following objectives should be mastered by each student DURING and FOLLOWING the class session through active work and practice.

  1. Compare and contrast SRAM and DRAM caches.
  2. Given a page table entry, determine whether the virtual page is on the disk, in physical memory, or has not yet been allocated.
  3. Describe the relationship(s) between locality, the working set, and thrashing in virtual memory.
  4. Describe how virtual memory simplifies the following: linking, loading, sharing, and memory allocation.

Pre-class Exercises

These exercises are geared towards mastering the BASIC learning objectives listed above. You are expected to submit them before class and it is highly recommended that you complete them before attempting the reading quiz.

  1. What is the difference between an unallocated virtual page and an uncached virtual page?

  2. What is the relationship between the memory management unit (MMU) and the page table?

  3. Calculate the number of page table entries for the following scenarios. Make sure you show your work.

  4. Assume that you have the following page table entries.

    VP # Valid Read Write SUP
    0 0 1 1 0
    1 0 1 0 0
    2 1 1 0 1

    For each of the following accesses, determine whether it will result in a page fault, a segmentation fault, both, or neither. Explain why.