Any attempt by a process to access memory allocated to the OS or to the…

2023

Any attempt by a process to access memory allocated to the OS or to the process of another user results in

  1. A.

    Trap to OS

  2. B.

    Context Switching

  3. C.

    Page fault

  4. D.

    Invocation to Scheduler Despatch

Attempted by 470 students.

Show answer & explanation

Correct answer: A

Concept

Memory protection is a hardware-enforced boundary: every process runs in its own address space, and the Memory Management Unit (MMU) checks each address against the access rights granted to the currently running process. Any access that violates these rights is illegal and cannot be allowed to proceed.

How an illegal access is handled

When a process tries to read or write memory belonging to the OS kernel or to another user's process, the MMU detects the rights violation and raises a hardware exception. This exception is a trap: the CPU immediately switches from user mode to kernel mode and transfers control to the operating system, which then handles the fault (typically by terminating the offending process).

Why the other behaviours do not apply

  • Page fault: in the standard OS-course sense, the demand-paging event for a page that is valid for the process but not currently resident in physical RAM, which the OS resolves by loading the page. It describes a residency miss rather than a rights denial, so it is not the general outcome this question asks for.

  • Context switching: the act of saving one process's state and restoring another's during scheduling. It is driven by the scheduler, not by an illegal memory reference.

  • Scheduler dispatch: the dispatcher hands the CPU to a process the scheduler has already chosen. An illegal access produces a hardware exception first; any later scheduling is a consequence of the OS handling the trap, not the immediate result.

Result

The immediate, direct outcome of accessing memory allocated to the OS or to another user's process is a hardware exception that traps to the operating system.

Explore the full course: Isro