Homework 7 Version 0 |
|
👤 Author: by 871257367qqcom 2019-11-13 14:35:09 last modified by 871257367qqcom |
A page fault occurs , we must first read the relevant page from disk and then access the desired word.
The OS will do the following sequence:
1.Trap the operating System.
2.Save the user register and process state.
3.Determine that the interrupt was a page fault.
4.Check that the page reference was legal and was a page fault.
5.If thers is a free frame:
Issue a read from the disk to a free frame:
a. Wait in a queue for this device until the read request is serviced.
b.Wait for the device seek and or latency time.
c. Begin the transfer of the page to a free frame.
If there is no free frame,use page replacement algorithm to select a victim frame,write the victim frame to the disk;change the page and frame tables accordingly.
6.While waiting , allocate the CPU to other users.
7.Receive an interrupt from the disk I/O subsystem.
8.Save the registers and process state for other user.
9.Determine that the interrupt was from the disk.
10.Correct the page table and other tables to show that the desired page is now in memory.
11. Wait for the CPU to allocate the process again.
12.Restore the user registers , process state, and new page table , and then resume the interrupted instruction.