Question

In: Computer Science

How does page fault in OS be handled/resolved?

How does page fault in OS be handled/resolved?

Solutions

Expert Solution

A page fault occurs when a program attempts to access a block of memory that is not stored in the physical memory or RAM. The fault notifies the operating system that it must locate the data in virtual memory and then transfer it from the storage device, such as an HDD or SSD, to the system RAM.

When handling a page fault, the operating system tries to make the required page accessible at the location in physical memory or terminates the program in cases of illegal memory access. Steps in page fault handling are:

1. The memory address requested is first checked, to make sure it was a valid memory request. Check the location of the referenced page in the Page Map Table (PMT)

2. If the reference was invalid, the process is terminated. Otherwise, the page must be paged in. If any page fault occurred, call on the operating system to fix it.

3. Using frame replacement algorithm, find the frame location. A free frame is located, possibly from a free-frame list.

4. Read the data from disk to memory. A disk operation is scheduled to bring in the necessary page from the 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 input / output operation is complete, the process’s Page Map Table (PMT) 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 be restarted when the process resumes execution.


Related Solutions

What is the difference between a soft and hard page fault?
What is the difference between a soft and hard page fault?
How does no-fault insurance impact drivers? Answer with details and explanation.
How does no-fault insurance impact drivers? Answer with details and explanation.
In a line to line fault and in a double line to ground fault, how can...
In a line to line fault and in a double line to ground fault, how can I calculate voltages: V1, V2, Vo and Va,Vb, Vc. Write formulas please!
a) Explain how performance can be controlled in virtual memory. (b) How does the OS implement...
a) Explain how performance can be controlled in virtual memory. (b) How does the OS implement dynamic allocation of frames? c) Explain the main difficulty in using and/or managing virtual memory.
How does pollens and cold temperature contribute to the pathophysiology os asthma? Briefly explain.
How does pollens and cold temperature contribute to the pathophysiology os asthma? Briefly explain.
.What is the role of interrupt vector table during interrupt processing? b. How does OS make...
.What is the role of interrupt vector table during interrupt processing? b. How does OS make sure that a user process cannot access I/O devices or any other process’ memory areas? c. How is data parallelism different from task parallelism? Which one of these approaches would you use if you had to compute the average of an array of million numbers? Why? d. What kind of events can cause a process to leave CPU? e. What is the main different...
Why are device drivers the most failure-prone part of operating systems? How does the OS designs...
Why are device drivers the most failure-prone part of operating systems? How does the OS designs we discussed earlier in the semester, e.g., exokernels, microkernels, etc., address the problem with device drivers?
How the risks of spiral paradigm are handled by the UP model?
How the risks of spiral paradigm are handled by the UP model?
How should therapeutic disclosures be handled in a psychoeducational group?
How should therapeutic disclosures be handled in a psychoeducational group?
How can asymmetric information problem be resolved in a competitive market?
How can asymmetric information problem be resolved in a competitive market?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT