Hardware Reference
In-Depth Information
a. Which references cause a page fault with LRU?
b. Which references cause a page fault with FIFO?
6. In Sec. 6.1.4 an algorithm was presented for implementing a FIFO page replacement
strategy. Devise a more efficient one. Hint: It is possible to update the counter in the
newly loaded page, leaving all the others alone.
7. In the paged systems discussed in the text, the page fault handler was part of the ISA
level and thus was not present in any OSM-level program's address space. In reality,
the page fault handler also occupies pages, and might, under some circumstances (e.g.,
FIFO page replacement policy), itself be removed. What would happen if the page
fault handler were not present when a page fault occurred? How could this be fixed?
8. Not all computers have a hardware bit that is automatically set when a page is written
to. Nevertheless, it is useful to keep track of which pages have been modified, to avoid
having to assume worst case and write all pages back to the disk after use. Assuming
that each page has hardware bits to separately enable access for reading, writing, and
execution, how can the operating system keep track of which pages are clean and
which are dirty?
9. A segmented memory has paged segments. Each virtual address has a 2-bit segment
number, a 2-bit page number, and an 11-bit offset within the page. The main memory
contains 32 KB, divided into 2-KB pages. Each segment is either read-only, read/ex-
ecute, read/write, or read/write/execute. The page tables and protection are as follows:
Segment 0
Segment 1
Segment 2
Segment 3
Read only
Read/execute
Read/write/execute
Read/write
Virtual
page
Page
frame
Virtual
page
Page
frame
Virtual
page
Page
frame
0
9
0
On disk
Page table
0
14
1
3
1
0
not in
1
1
2
On disk
2
15
main
2
6
3
12
3
8
memory
3
On disk
For each of the following accesses to virtual memory, tell what physical address is
computed. If a fault occurs, tell which kind.
Access
Segment
Page
Offset within page
1. fetch data
0
1
1
2. fetch data
1
1
10
3. fetch data
3
3
2047
4. store data
0
1
4
5. store data
3
1
2
6. store data
3
0
14
7. branch to it
1
3
100
8. fetch data
0
2
50
9. fetch data
2
0
5
10. branch to it
3
0
60
 
Search WWH ::




Custom Search