Professional Documents
Culture Documents
7memory Management
7memory Management
OS
USER Processes
or
USER Processes
OS
CPU Actual
address address
+4000
USER Processes
11999 15999
8K
OS
01111111111111
10000000000000
8K
USER Processes
11111111111111
Problems:
Loading non-residence part of OS, may exceed page-0
If OS is small then memory wastage
NIT Rourkela Dr. Ma nma th N. Sahoo (CS) 5
Limit Register
Limit register stores the size of the OS
0000 LimitReg=4000
OS
3999
0000 4000 CPU Actual
address address
+LimitReg
USER Processes
11999 15999
P2
1999 6999
0000 7000
P3
0999 7999
CPU actual
address
MMU
Noncontiguous
Parts of a process can be allocated non-contiguous chunks
of memory
MAT MFT
P1 1
Partition# Process# Partition# Availability
0 OS 0 0
P2 2
1 P1 1 0
2 P2 2 0
P3 3
3 P3 3 0
4 - 4 1
5 1 4
5 -
6 - 6 1
7 - 7 1 5
MAT MFT
Partition# Process# Partition# Availability
0 OS 0 0
1 - 1 1
2 - 2 1
3 - 3 1
4 - 4 1
5 - 5 1
6 - 6 1
7 - 7 1
8000 63999
+ No internal fragmentation
+ Degree of multiprogramming is no longer limited by the no. of partitions.
- External fragmentation still exists
n-k k
Page# Frame#
NIT Rourkela 33
Page Table Structure
Most modern computer systems support 32bit or 64bit logical
address.
Consider a system with 32bit logical address, and page size of 4K
20 12
# of entries in PMT=220
Each entry of PMT stores a 21bit frame# and other attributes (for a
8GB memory).
If each entry is of 4bytes then memory required by PMT=4*220=4MB
(can’t fit into a single frame)
Do we need to apply paging on the PMT itself??
YES – Hierarchical Paging
10
11 pg1
2
11 12
8
13
5
14
6
5 9 35
Hierarchical paging
For a 64-bit logical address system:
64-bits Two-level leaves 42 bits in
outer table
2 10 10 10
B 1 9 3
1 99
yes
trap: no s<
addressing error STLR
PMT-0
Segment Table
PMT-3