ITPEC FE Morning October 2023 Question 17

Topic: Software

Which of the following occurs when a program attempts to access a page that is mapped in the virtual address space but is not located in the main memory? Here, the OS supports paging.

Explanation

Page fault — the page is valid in the virtual address space but not in physical memory, so the hardware interrupts and the OS loads it.

In a paging system the page table marks which virtual pages are present in main memory. Accessing a page that is mapped but absent raises a page fault interrupt; the OS reads the page in from auxiliary storage, replacing another page if memory is full, updates the page table and restarts the instruction. It is a normal event of virtual memory, not an error.

Answer (b)

Why not others:

  • •(a) Fatal error — an unrecoverable failure that stops a program or the system; a page fault is handled and execution continues
  • •(c) Scheduling error — relates to allocating the CPU among processes, not to memory access
  • •(d) Segmentation fault — an access to an address the process is not allowed to use; here the page is mapped, so the access is legal

Key rule: A page fault means "valid but not loaded" and is resolved by paging in; a segmentation fault means "not allowed" and usually terminates the process.

Software · AI-written, may contain errors

This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.