Virtual Memory
1
Virtual Memory 1 Learning to Play Well With Others (Physical) - - PowerPoint PPT Presentation
Virtual Memory 1 Learning to Play Well With Others (Physical) Memory malloc(0x20000) 0x10000 (64KB) Stack Heap 0x00000 Learning to Play Well With Others (Physical) Memory 0x10000 (64KB) Stack Stack Heap Heap 0x00000 Learning to Play
1
0x00000 0x10000 (64KB) Stack Heap (Physical) Memory malloc(0x20000)
Stack Heap (Physical) Memory Stack Heap 0x00000 0x10000 (64KB)
Stack Heap Virtual Memory 0x00000 0x10000 (64KB) Physical Memory 0x00000 0x10000 (64KB) Stack Heap Virtual Memory 0x00000 0x10000 (64KB)
Stack Heap Virtual Memory 0x00000 0x400000 (4MB) Physical Memory 0x00000 0x10000 (64KB) Stack Heap Virtual Memory 0x00000 0xF000000 (240MB) Disk (GBs)
physical addresses.
6
Physical Address Space Virtual Address Space 232 - 1 230 – 1 (or whatever) Stack We need to keep track of this mapping… Heap
8
Virtual Page Number Page Offset (log(page size)) Virtual address (32 bits) Physical address (32 bits) Page Offset (log(page size)) Virtual-to-physical map Physical Page Number
9
10
heap is at the “bottom”
11
12
Level 1 Page Table Level 2 Page Tables
Data Pages
Parts of the map that exist Root of the Current Page Table
p1
p2
Virtual Address (Processor Register)
Parts that don’t p1 p2 offset
11 12 21 22 31
10-bit L1 index 10-bit L2 index
Adapted from Arvind and Krste’s MIT Course 6.823 Fall 05
14
15
to access it very quickly (i.e., in one clock cycle)
lookaside buffer” or “TLB”
16
walkers” -- specialized state machines that can load page table entries into the TLB without OS intervention
big-A architecture.
its own format.
17