-操作系统精髓与设计原理(第五版)+课后题答案1
CHAPTER 8 VIRTUAL MEMORY
Review Questions
8.1 Simple paging: all the pages of a process must be in main memory for
process to run, unless overlays are used. Virtual memory paging: not all pages of a process need be in main memory frames for the process to run.; pages may be read in as needed
8.2 A phenomenon in virtual memory schemes, in which the processor
spends most of its time swapping pieces rather than executing instructions.
Problems
8.1 a. Split binary address into virtual page number and offset; use VPN as
index into page table; extract page frame number; concatenate offset to get physical memory address
b. (i) 1052 = 1024 + 28 maps to VPN 1 in PFN 7, (7 1024+28 = 7196) (ii) 2221 = 2 1024 + 173 maps to VPN 2, page fault (iii) 5499 = 5 1024 + 379 maps to VPN 5 in PFN 0, (0 1024+379 =
379)
8.4 a. PFN 3 since loaded longest ago at time 20 b. PFN 1 since referenced longest ago at time 160 c. Clear R in PFN 3 (oldest loaded), clear R in PFN 2 (next oldest
loaded), victim PFN is 0 since R=0
d. Replace the page in PFN 3 since VPN 3 (in PFN 3) is used furthest in
the future