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

How does no-fault insurance impact drivers? Answer with details and explanation.
How does no-fault insurance impact drivers? Answer with details and explanation.
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...
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?
What is the multivalue, multicolumn problem? What is a multivalued dependency, and how is it resolved...
What is the multivalue, multicolumn problem? What is a multivalued dependency, and how is it resolved by 4NF? To answer these questions, alter exercise 2.40 to allow students to have multiple majors. In this case, the relational structure is: STUDENT (StudentNumber, StudentName, SiblingName, Major) A. Define and discuss the multivalue, multicolumn problem. Define and discuss a multivalued dependency. B. Show an example of this relation for two students, one of whom has three siblings and the other of whom has...
Describe the controversy surrounding the slavery issue. How was this resolved at the Constitutional Convention?
Describe the controversy surrounding the slavery issue. How was this resolved at the Constitutional Convention?
How have you handled conflicts with students over grades and assignments?
How have you handled conflicts with students over grades and assignments?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT