Which one or more of the following options guarantee that a computer system…
2023
Which one or more of the following options guarantee that a computer system will transition from user mode to kernel mode?
Answer: C. Page Fault; D. System Call — Answer: System Call and Page Fault. Key idea: The CPU switches to kernel mode when it executes a trap/exception or a system-call instruction; ordinary…
- A.
Function Call
- B.
malloc Call
- C.
Page Fault
- D.
System Call
Attempted by 109 students.
Show answer & explanation
Correct answer: C, D
Answer: System Call and Page Fault.
Key idea: The CPU switches to kernel mode when it executes a trap/exception or a system-call instruction; ordinary user-level control transfers do not change privilege level.
System Call: a controlled trap into the kernel that always switches the CPU to kernel mode to perform requested services.
Page Fault: a processor exception handled by the operating system; the CPU enters kernel mode to resolve the fault (load a page, update tables, or terminate the process).
Function Call: a normal user-space function call runs entirely in user mode and does not, by itself, cause a transition to kernel mode.
malloc Call: a library routine in user space. It may invoke kernel services (e.g. brk or mmap) when it needs more memory, but malloc itself does not guarantee a mode switch.
Therefore, the actions that guarantee a transition from user mode to kernel mode are System Call and Page Fault.