1
1
VirtualMemory
2
MemoryManagementUnit
ThepositionandfunctionoftheMMU
3
- VirtualMemory
– Dividedintoequal sized – A isa translationbetween
- Apageandaframe
- Apageandnull
– Mappingsdefinedat runtime
- Theycanchange
– Addressspacecan haveholes – Processdoesnot havetobe contiguousin physicalmemory
- PhysicalMemory
– Dividedinto equal sized
- 7
6 5 4 3 2 1 15 14 13 12 11 10 9 8 1 12 10 2 3 11 VirtualAddress Space PhysicalAddress Space
Paging
1 2 3 4 5 6 7
4
TypicalAddress SpaceLayout
- Stackregionisattop,
andcangrowdown
- Heaphasfreespaceto
growup
- Textistypicallyread only
- Kernelisinareserved,
protected,sharedregion
- 0 thpagetypicallynot
used,why? 7 6 5 4 3 2 1 15 14 13 12 11 10 9 8 VirtualAddress Space Kernel Stack Shared Libraries BSS (heap) Data Text (Code)
5
- Aprocessmay
beonlypartially resident
– AllowsOSto storeindividual pagesondisk – Savesmemory forinfrequently useddata&code
- Whathappensif
weaccessnon resident memory?
1 15 5 3 13 VirtualAddress Space PhysicalAddress Space 7 6 5 4 3 2 1 15 14 13 12 11 10 9 8 14 10 6 4 2 Disk : logicallypresent :Not mapped,dataondisk
6
2 4 13 4 1 3 13 Proc1Address Space
Physical AddressSpace
7 6 5 3 1 15 14 13 12 11 10 9 8 4 2 7 6 5 3 1 15 14 13 12 11 10 9 8 4 2 Proc2Address Space 3 15 15 1 2 14 14 Disk
Currently running