Question:

Which one or more of the following options guarantee that a computer system will transition from user mode to kernel mode?

Show Hint

User-level function calls and library calls (like malloc) usually remain in user mode. Kernel entry is guaranteed only by hardware exceptions (like page faults) or explicit system calls.
Updated On: Aug 26, 2025
  • Function Call
  • malloc Call
  • Page Fault
  • System Call
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is C

Solution and Explanation

Step 1: Analyze Option (A) Function Call
A normal function call in user space executes entirely in user mode. It does not involve the operating system kernel. Hence, there is no user-to-kernel mode switch.
\(\Rightarrow\) (A) is False.
Step 2: Analyze Option (B) malloc Call
The malloc() function is part of the C standard library. In most cases, it only allocates memory from the heap of the process without involving the kernel.
However, if more memory is required, it may internally invoke a system call such as brk() or mmap(), which would cause a kernel transition. But this is not guaranteed for every malloc call.
\(\Rightarrow\) (B) is False.
Step 3: Analyze Option (C) Page Fault
A page fault occurs when a program accesses a memory page that is not present in physical memory. This is a hardware exception, which always triggers the operating system’s page fault handler in the kernel.
Thus, the CPU must switch to kernel mode to handle it.
\(\Rightarrow\) (C) is True.
Step 4: Analyze Option (D) System Call
System calls are explicit requests made by a user process to the operating system for services like I/O, process management, or memory management.
Executing a system call instruction (e.g., int 0x80, syscall) always causes a trap into kernel mode.
\(\Rightarrow\) (D) is True. \[ \boxed{\text{Correct Options: (C) Page Fault and (D) System Call}} \]
Was this answer helpful?
0
0

Questions Asked in GATE CS exam

View More Questions