The OS will handle with the page fault by the following sequential steps:
- Check an internal table (usually kept with PCB) for this process to determine whether the reference was a valid or an invalid memory access.
- If the reference was invalid, OS will terminate the process. If it was valid, but haven’t been brought in that page yet, OS will page it in that page.
- Find a free frame(by taking one from the free-frame list, for instance)
- Schedule a disk operation to read the desired page into the newly allocated frame
- When the disk read is complete. OS will modify the internal table kept with the process and the page table to indicate that page is now in memory.
- Restart the instruction that was interrupted by the page-fault trap. The process can now access the page as though it had always been in memory.