CS FundamentalsVery hardGATE CS
A process is in the middle of a system call when a hardware interrupt arrives. Which statement about mode and stacks is correct on a typical Unix-like OS?
- A. The CPU is already in kernel mode; the interrupt handler runs in kernel mode (on a kernel stack) and then the system call resumes
- B. The CPU switches to user mode to run the interrupt handler
- C. The interrupt is discarded until the system call returns
- D. The system call is aborted and restarted from user mode
Correct answer: A. The CPU is already in kernel mode; the interrupt handler runs in kernel mode (on a kernel stack) and then the system call resumes
Interrupts can nest on top of kernel execution; the handler runs in kernel mode using kernel stack space, after which the interrupted kernel path (the system call) continues. Interrupts are not dropped; they may be briefly masked.
More Operating Systems questions
- Which of these instructions must be privileged (allowed only in kernel mode) for the OS to keep control? 1. Disable interrupts 2. Read the…
- A process calls read() on a file. Put these in the correct order: (a) the kernel validates arguments and starts I/O; (b) the process…
- Which of the following is TRUE about a zombie process?
- A program has 5% serial code and runs on 16 cores. By Amdahl's law, what is the best speedup possible, and what is the limit as the number…
- A web server creates a new process per request using fork() (copy-on-write). Compared with creating a thread per request, which is the…
- vfork() differs from fork() in that: