Procedure to handle page fault
If a process refers to a page that is not in physical memory then
• We check an internal table (page table) for this process to determine whether the reference was valid or invalid.
• If the reference was invalid, we terminate the process, if it was valid but not yet brought in, we have to bring that from main memory.
• Now we find a free frame in memory.
• Then we read the desired page into the newly allocated frame.
• When the disk read is complete, we modify the internal table to indicate that the page is now in memory.
• We restart the instruction that was interrupted by the illegal address trap. Now the process can access the page as if it had always been in memory.