Bird
Raised Fist0

If a system call is invoked from an interrupt handler already running in kernel mode, what is the expected behavior regarding mode switching and privilege checks?

hard🎤 Interviewer Follow-up Q15 of Q15
Operating Systems - System Call - Mechanism & Modes (User vs Kernel)
If a system call is invoked from an interrupt handler already running in kernel mode, what is the expected behavior regarding mode switching and privilege checks?
AThe system call is deferred until the interrupt handler finishes and user mode resumes.
BThe CPU switches to user mode before executing the system call to prevent privilege escalation.
CThe system call executes immediately without a mode switch since already in kernel mode.
DThe system call triggers a nested mode switch to a higher privilege level.
Step-by-Step Solution
  1. Step 1: Understand current mode

    Interrupt handlers run in kernel mode with full privileges.
  2. Step 2: System call invoked in kernel mode

    Since already in kernel mode, no mode switch is needed; system call executes directly.
  3. Step 3: Why other options are incorrect

    The CPU switches to user mode before executing the system call to prevent privilege escalation. is incorrect; switching to user mode would reduce privileges improperly. The system call is deferred until the interrupt handler finishes and user mode resumes. is wrong; system calls are not deferred. The system call triggers a nested mode switch to a higher privilege level. is false; kernel mode is the highest privilege level, no nested switch occurs.
  4. Final Answer:

    Option C -> Option C
  5. Quick Check:

    System call in kernel mode -> no mode switch -> immediate execution [OK]
Quick Trick: No mode switch if already in kernel mode
Common Mistakes:
MISTAKES
  • Assuming mode switch always occurs on system call
  • Thinking system calls are deferred inside kernel
  • Believing nested privilege levels exist beyond kernel mode
Trap Explanation:
PITFALL
  • Option B is tempting but incorrect because candidates often think system calls always cause mode switches. Options B and D misunderstand privilege levels; Option C confuses scheduling with system call handling.
Interviewer Note:
CONTEXT
  • Probes deep understanding of privilege levels and system call behavior in complex scenarios.
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