CS 208 s21 — Lab 5 Overview; Virtual Memory: Four Problems
Table of Contents
1 Video
Here is a video lecture for the material outlined below. It contains sections on
- introduction (0:00)
- going over lab 5 writeup (0:44)
- going over lab 5 starter code (15:52)
- explicit free list coalescing (26:00)
- virtual memory intro (30:30)
- virtual memory: four problems (34:22)
The Panopto viewer has table of contents entries for these sections. Link to the Panopto viewer: https://carleton.hosted.panopto.com/Panopto/Pages/Viewer.aspx?id=e0ac8e93-4221-4804-bd46-ac59010e07da
2 Lab 5 Overview
3 The Memory We've Been Working With is an Illusion
- Programs refer to virtual memory addresses
movq (%rdi),%rax
- Conceptually memory is just a very large array of bytes
- System provides private address space to each process
- However…
- We probably don’t have 2w bytes of physical memory
- We certainly don’t have 2w bytes of physical memory for every program
- Programs should not interfere with one another
- Except in certain cases where they want to share code or data
4 Problems We Need to Solve When it Comes to Memory:
4.1 Problem 1: How Does Everything Fit?
4.2 Problem 2: Where Does Everything Go?
4.3 Problem 3: How to Protect One Process From Another?
4.4 Problem 4: How Do Processes Share Memory?
4.5 Solution: Add a Layer of Indirection
- each process gets it's own virtual address space
- each byte of physical memory has
- one physical address (PA)
- zero, one, or more virtual addresses (VAs)
- VAs can map to memory, disk, or nowhere (if unused)