Bird
Raised Fist0

When a user program invokes a system call to open a file, which of the following sequences correctly describes the mode transitions and actions?

easy🧠🧾 Concept Trace Q3 of Q15
Operating Systems - System Call - Mechanism & Modes (User vs Kernel)
When a user program invokes a system call to open a file, which of the following sequences correctly describes the mode transitions and actions?
AUser mode directly accesses kernel data structures; opens file; switches to kernel mode to confirm.
BUser mode -> kernel mode via trap; kernel validates request; kernel performs open; returns to user mode.
CKernel mode polls user mode for open request; user mode performs open; kernel mode resumes.
DUser mode switches to kernel mode by setting CPU mode bit; kernel opens file; user mode resumes.
Step-by-Step Solution
Solution:
  1. Step 1: Trace system call invocation

    User mode triggers a trap causing CPU to switch to kernel mode.
  2. Step 2: Kernel validates and performs the open operation

    Kernel checks permissions and opens the file.
  3. Step 3: Return to user mode

    After completion, CPU switches back to user mode.
  4. Final Answer:

    Option B -> Option B
  5. Quick Check:

    Only traps cause mode switch; user mode cannot directly access kernel data. [OK]
Quick Trick: System calls trap to kernel, kernel does work, then returns [OK]
Common Mistakes:
MISTAKES
  • Thinking user mode accesses kernel data directly
  • Believing kernel polls user mode for requests
  • Assuming user sets CPU mode bit manually
Trap Explanation:
PITFALL
  • Candidates confuse who initiates mode switch and how kernel accesses user requests.
Interviewer Note:
CONTEXT
  • Tests understanding of system call flow and mode transitions.
Master "System Call - Mechanism & Modes (User vs Kernel)" in Operating Systems

2 interactive learning modes - each teaches the same concept differently

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Operating Systems Quizzes