Virtual To Physical Address Translation
Virtual To Physical Address Translation
Program execution
For a program to execute, the following must be
register
Has a pointer to the page table
data
Physical address
Global memory
4
Address translation
Virtual address: A logical address Virtual page number + offset Finds PTE for virtual page number Extract frame number and adds offset Fail (MMU raises an exception - page fault): bounds error - outside address range validation error - non-resident page protection error - not permitted access
6
20 bits
offset in page
12 bits
Real address
X offset
Virtual address
add
PTE
M R control bits frame number
If each page table entry occupies 4-bytes, then we need a ______ byte
Root table will consist of 210 entries one for each page that holds a part of the process page table Root table will occupy 212 bytes 4KB of space will be kept in main memory permanently A page access could require two disk accesses
10
11
pointer
12
Physical Address
Frame #
Offset
Page Frame
Program
Paging Hardware
Memory
13
Physical Address
Frame #
Offset
Program
Paging Hardware
Memory
14
Hashing techniques
15
instruction
One to fetch the page table entry One to fetch the data
16
TLB details
Associative cache of address translations Entries may contain a tag identifying the process as
17
recently used
Functions same way as a memory cache
Given a virtual address, processor examines the TLB If present (TLB hit), the frame number is retrieved and the real address is formed
No memory access
physical address
cache
Page tables
19
Associative cache
20
21
22
120ns
23
Page size
Smaller page size means large number of pages will be found in main memory As time goes on during execution the pages in memory will all contain portions of the process most recent references Low page faults Increased page size causes pages to contain locations further from any recent reference page faults to rise
26
27
28
architectures Multiple page sizes provide the flexibility needed to effectively use a TLB
Large pages can be used for program instructions Small pages can be used for threads
Most operating system support only one page size Makes replacement policy simpler Makes resident set management easier
independently
30
Segment tables
Segment table entry present bit (is it in main memory?) starting address (Base address) length of segment modify bit (has the segment since been modified?) protection bit
31
32
33
34
35
36