CS FundamentalsModerateGATE CS · Amazon/Microsoft SDE MCQ
Which statement about a system call compared with an ordinary function call is correct?
- A. Both run in user mode, but a system call switches to a separate stack
- B. A system call needs no saving of registers, since the kernel has its own set
- C. A system call is just a jump into the C library, with no mode change
- D. A system call traps into kernel mode, so it costs far more
Correct answer: D. A system call traps into kernel mode, so it costs far more
The trap (e.g. syscall/int) switches to kernel mode, saves user state, dispatches through the system-call table and returns with a mode switch back. Library wrappers like read() exist, but they still execute the trapping instruction.
More Operating Systems questions
- Five batch jobs arrive together with run times 9, 6, 3, 5 and x, where x < 3. In what order should they run to minimise average turnaround…
- Statement 1: Under round robin, as the quantum shrinks towards the context-switch time, CPU efficiency approaches 50%. Statement 2: For a…
- Which of these must a process NOT be able to do in user mode on a typical protected OS?
- A process's working set grows from 40 to 70 pages while it holds 50 frames under local replacement, and the system has 10 free frames…
- SRTF scheduling (on a tie the running process continues); processes (arrival, burst): P1 (0, 7), P2 (2, 4), P3 (4, 1), P4 (5, 4), P5 (9…
- A loop references pages 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4 with 3 frames, initially empty. How many faults occur under FIFO, LRU and OPT?