Any attempt by a process to access memory allocated to OS or process of other user results into
- (A)
Trap to OS
- (B)
Context Switching
- (C)
Page fault
- (D)
Invocation to Scheduler Despatch
Any attempt by a process to access memory allocated to OS or process of other user results into
Trap to OS
Context Switching
Page fault
Invocation to Scheduler Despatch
ANSWER
The answer is (a): the access causes a trap to the OS.
Official answer: ASource: ISRO's revised and final answer key of 16 February 2024
Every address a process generates is checked by the memory-protection hardware (base and limit registers, or the protection bits in the page-table entries) against what that process is allowed to use.
If a process tries to reach memory that belongs to the OS or to another user's process, the check fails and the hardware raises an exception, a protection (addressing-error) trap.
The CPU switches to kernel mode and jumps to the OS trap handler, which normally terminates the offending process (for example with a segmentation fault).
So the direct result of such an access is a trap to the OS, which is option (a).
Option (b) is wrong: a context switch is a scheduler action that saves one process's state and loads another's. An illegal access does not cause it by itself.
Option (c) is wrong: a page fault means a valid page of the process is not currently in main memory. An access outside the process's own address space is an illegal reference, not a missing page.
Option (d) is wrong: scheduler dispatch happens only after the OS has chosen which process to run next, which is a later and separate step.
KEY IDEA
Memory protection hardware catches any access outside a process's own allowed memory and raises a trap, which hands control to the OS in kernel mode.
WATCH OUT FOR
Choosing page fault because both events involve a memory address. A page fault is about a valid page that is not in main memory. An access to someone else's memory is an illegal reference and gives a protection trap.
From the ISRO CS 2023 paper. Every question of this paper · The full paper (PDF, ISRO) · All 3 ISRO Memory management questions, with notes