CS FundamentalsModerateGATE CS · Amazon/Microsoft SDE MCQ
Which of these must a process NOT be able to do in user mode on a typical protected OS?
- A. Read the time-stamp counter on a typical x86 setup
- B. Load a new value into the page-table base register
- C. Execute a trap instruction to request a system call
- D. Do an integer division by a variable divisor
Correct answer: B. Load a new value into the page-table base register
Loading the page-table base (e.g. CR3) would let a process remap memory at will, so it is privileged. Traps are how user code enters the kernel, and ordinary arithmetic is unprivileged.
More Operating Systems questions
- 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?
- Banker's algorithm, resources (A, B, C). Available = (1, 1, 2). Allocation / Max: P0 (1,0,1)/(2,1,2), P1 (2,1,0)/(3,2,2), P2…
- How many times is x printed? (Every fork() succeeds, and each print is an unbuffered write.) c int main() { fork(); fork() && fork()…
- How many numbers are printed, and what is their sum? (Every fork() succeeds, and each print is an unbuffered write.) c int main() { for…