Professional Documents
Culture Documents
15 Address Space Paging Intro
15 Address Space Paging Intro
1
University of New Mexico
Concept of Paging
Paging splits up address space into fixed-sized unit called
a page.
▪ Segmentation: OS and hardware map a relatively small number of
variable sized segments (code, stack, heap, etc.)
▪ Paging: OS and hardware map a large number of fixed-size
segments
Process’s Virtual Address Space and physical memory are
divided into pages
2
University of New Mexico
Advantages Of Paging
Flexibility: Supporting the abstraction of address space
effectively
▪ Don’t need assumption how heap and stack grow and are used.
Whence fragmentation?
3
University of New Mexico
4
University of New Mexico
Address Translation
Two components in the virtual address
▪ VPN: virtual page number
▪ Offset: offset within the page
VPN offset
VPN offset
0 1 0 1 0 1
5
University of New Mexico
Virtual
0 1 0 1 0 1
Address
Address
Translation
Physical
1 1 1 0 1 0 1
Address
PFN offset
6
University of New Mexico
7
University of New Mexico
8
University of New Mexico
9
University of New Mexico
10
University of New Mexico
PWT
PCD
R/W
PFN
U/S
PAT
A
D
G
P
An x86 Page Table Entry(PTE)
P: present
R/W: read/write bit
U/S: supervisor
A: accessed bit
D: dirty bit
PFN: the page frame number
11
University of New Mexico
Page table
Valid Physical page number (PPN)
Physical page table
address for the current
process
Valid bit = 0:
Page not in memory
Valid bit = 1
(page fault)
m-1 p p-1 0
Physical page number (PPN) Physical page offset (PPO)
Physical address
12
University of New Mexico
Data
5
13
University of New Mexico
14