Hardware Reference
In-Depth Information
Page
Virtual addresses
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
61440 - 65535
57344 - 61439
53248 - 57343
49152 - 53247
45056 - 49151
40960 - 45055
36864 - 40959
32768 - 36863
28672 - 32767
24576 - 28671
20480 - 24575
16384 - 20479
12288 - 16383
8192 - 12287
4096 - 8191
0 - 4095
Bottom 32K of
main memory
Physical addresses
Page
frame
7
6
5
4
3
2
1
0
28672 - 32767
24576 - 28671
20480 - 24575
16384 - 20479
12288 - 16383
8192 - 12287
4096 - 8191
0 - 4095
(a)
(b)
Figure 6-3. (a) The first 64 KB of virtual address space divided into 16 pages,
with each page being 4K. (b) A 32-KB main memory divided up into eight page
frames of 4 KB each.
copied into the low-order 12 bits of the output register, as shown. This 15-bit ad-
dress is now sent to the cache or memory for lookup.
Figure 6-5 shows a possible mapping between virtual pages and physical page
frames. Virtual page 0 is in page frame 1. Virtual page 1 is in page frame 0. Vir-
tual page 2 is not in main memory. Virtual page 3 is in page frame 2. Virtual page
4 is not in main memory. Virtual page 5 is in page frame 6, and so on.
6.1.3 Demand Paging and the Working-Set Model
In the preceding discussion it was assumed that the virtual page referenced was
in main memory. However, that assumption will not always be true because there
is not enough room in main memory for all the virtual pages. When a reference is
made to an address on a page not present in main memory, it is called a page fault .
 
 
Search WWH ::




Custom Search