Professional Documents
Culture Documents
seg <
address
base limit error
exception
! Additional hardware support required is page table page table page table page table list of
for Process A for Process B for Process C for Process D free frames
slightly less than for segmentation 0
1
0
1
0
1
0
1
7
8
0
1
4
5
13
14
2 2 2 2 9 2 6
3 3 3 10 3 11
! No need to keep track of, and compare 4 12
Paging Example
Managing Pages and Frames
(cont.)
relative address within program: virtual address:
1501
0000010111011110
page# = 1, offset = 478
000001 0111011110
! OS usually keeps track of free frames in
program D process D memory using a bit map
page 0 ! A bit map is just an array of bits
! 1 means the frame is free
1501 page 1
478
! 0 means the frame is allocated to a page
! To find a free frame, look for the first 1 bit
page 2 in the bit map
! Most modern instruction sets have an
instruction that returns the offset of the
page 3
first 1 bit in a register
4292 bytes
long page 4 828 bytes
unused ! Keep page tables in memory, use page
5120 bytes
table base register (special register) to
virtual address:
page# = 1, offset = 478
long
point to page table of active process
000001 0111011110
0
for Process D
4
! Page table also contains:
1 5
2 6 ! Other bits for demand paging (discussed
3 11
4 12 next time)
000101 0111011110
physical address:
frame# = 5, offset = 478