ALL > Computer and Education > courses > university courses > undergraduate courses > Operating System > zstu-(2021-2022)-1 > student homework directories > 2019333500159厉霖开 >
2019333500159厉霖开Homework11 Version 0
👤 Author: by nintendolinkfoxmailcom 2021-12-28 08:54:32
Q: Describe in detail the steps in handling a page fault.

A: Page fault occurs when OS tries to access a page that is marked as invalid and a page fault trap is generated. This trap is mainly the result of the failure of the Operating system in order to bring the desired page into memory.



The steps to handle the page fault as shown with the help of the above diagram:

  1. The memory address requested is first checked, to make sure it was a valid memory request.

  2. If the reference was invalid, the process is terminated. Otherwise, the page must be paged in.

  3. A free frame is located, possibly from a free-frame list.

  4. A disk operation is scheduled to bring in the necessary page from disk. ( This will usually block the process on an I/O wait, allowing some other process to use the CPU in the meantime. )

  5. When the I/O operation is complete, the process’s page table is updated with the new frame number, and the invalid bit is changed to indicate that this is now a valid page reference.

  6. The instruction that caused the page fault must now be restarted from the beginning, ( as soon as this process gets another turn on the CPU. )

Please login to reply. Login

Reversion History

Loading...
No reversions found.