COS 318: Operating Systems
Virtual Memory and Address
Translation
2
Today’s Topics
Midterm Results
Virtual Memory
Virtualization
Protection
Address Translation
Base and bound
Segmentation
Paging
Translation look-ahead buffer
Repair working groups
Midterm Results (Avg = 31.18)
3
0
5
10
15
20
25
30
35
40
45
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
Midterm Grading
Problem 1 (Lars Bonge)
Main issue: Need to know OS overheads better
Problem 2 (Shi Li)
Main issue: A few students do not know about calculation
Problem 3 (Kai Li)
Main issue: Spooling does not eliminate deadlocks of shared
data
Problem 4 (Nick Johnson)
Main issue: A few students do not remember the idioms of
Mesa-style monitor!
All graders are outside 105 from 2:50pm to 3:00pm
4
5
The Big Picture
DRAM is fast, but relatively expensive
$25/GB
20-30ns latency
10-80GB’s/sec
Disk is inexpensive, but slow
$0.2-1/GB (100 less expensive)
5-10ms latency (200K-400K times slower)
40-80MB/sec per disk (1,000 times less)
Our goals
Run programs as efficiently as possible
Make the system as safe as possible
CPU
Memory
Disk
6
Issues
Many processes
The more processes a system can handle, the better
Address space size
Many small processes whose total size may exceed memory
Even one process may exceed the physical memory size
Protection
A user process should not crash the system
A user process should not do bad things to other processes
7
Consider A Simple System
Only physical memory
Applications use physical
memory directly
Run three processes
emacs, pine, gcc
What if
gcc has an address error?
emacs writes at x7050?
pine needs to expand?
emacs needs more memory
than is on the machine?
OS
pine
emacs
gcc
Free
x0000
x2500
x5000
x7000
x