For switching from a CPU user mode to the supervisor mode following type of…
2014
For switching from a CPU user mode to the supervisor mode following type of interrupt is most appropriate
- A.
Internal interrupts
- B.
External interrupts
- C.
Software interrupts
- D.
None of the above
Attempted by 983 students.
Show answer & explanation
Correct answer: C
Answer: Software interrupts
Explanation: Software interrupts, also known as traps or system calls, are deliberately invoked by a program when it needs the operating system to perform privileged actions (for example file I/O, creating processes, or changing permissions). Invoking a software interrupt causes a controlled transition from user mode to supervisor (kernel) mode so the OS can execute the requested service safely.
How this differs from other interrupt types:
Internal interrupts (exceptions):
These are caused by the CPU due to erroneous conditions or synchronous events (for example divide-by-zero or invalid instructions). They can force a switch to supervisor mode for handling faults, but they are not used by programs to request normal OS services.
External interrupts:
These come from hardware devices (for example timers or I/O devices) and are asynchronous. They notify the CPU of hardware events and are not the standard mechanism for a user program to enter supervisor mode for service requests.
Software interrupts (system calls):
These are intentionally generated by user programs to request OS services and cause a controlled transition to supervisor mode. Examples include the int instruction on older x86, syscall/sysenter on modern x86, and SVC on ARM.
Therefore, software interrupts are the most appropriate mechanism for switching from CPU user mode to supervisor mode when a program requests operating-system services.