CS FundamentalsHardGATE CS
Which statement about user-mode and kernel-mode stacks is correct?
- A. All threads share one kernel stack
- B. The kernel uses the caller's user stack for system calls
- C. Each thread has a user stack and a separate kernel stack used when it enters the kernel, so a corrupted user stack cannot crash the kernel's handling of a system call
- D. Kernel stacks are swapped out with the process
Correct answer: C. Each thread has a user stack and a separate kernel stack used when it enters the kernel, so a corrupted user stack cannot crash the kernel's handling of a system call
On a trap the CPU switches to the thread's kernel stack (from the task state). Keeping it separate protects the kernel from user stack corruption and lets each blocked thread keep its kernel context.
More Operating Systems questions
- A process gets SIGSEGV writing to a page marked read-only that belongs to a copy-on-write mapping after fork(). Why is this NOT what…
- A system uses paging with a 2-bit protection field (read, write) in each PTE and the CPU also has an execute-disable bit. Which page…
- Swap space is configured at 2 GB, RAM is 8 GB, and the OS uses overcommit. A process mallocs 20 GB and touches only 1 GB. What happens on…
- Which algorithm decides WHICH process to kill when Linux runs out of memory?
- NUMA systems: a thread running on node 0 frequently reads memory allocated on node 1. Which statement is correct?
- Which statement about the clock interrupt frequency (tick rate) is correct?