GATE / CS ARCHIVE

GATE CSE 2023 / QUESTION 23

GATE CSE 2023 Q23

Operating Systems · Processes, Threads & System Calls · Full GATE CSE 2023 paper

GATE 2023, Q23 1 mark · MSQ
Report issue

Processes, Threads & System Calls

Question 23, GATE 2023: Which events necessarily enter kernel mode from user mode? A ordinary function call; B malloc call; C page fault; D system call. Select all.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: C, D

A page fault is an exception handled in kernel mode, and a system call deliberately enters kernel mode. An ordinary function call need not do so. malloc may satisfy a request from already acquired user-space allocator memory and therefore does not always invoke the kernel. Hence C, D.

Teaching detail. The word “guarantee” excludes events that merely sometimes need kernel assistance. A user-space function can manipulate registers and its stack entirely in user mode. A malloc implementation often serves a request from a previously acquired heap arena; only some calls need to request more memory from the operating system. A page fault is a processor exception and transfers control to the kernel fault handler. A system call is the designated controlled entry mechanism for requesting kernel services.

Original paper, page 21 · Answer key