Questions: Exception Handling: OS Internals

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

A page fault occurs when the CPU tries to execute an instruction at virtual address X. After the OS handler loads the missing page from disk, execution resumes at...

AThe instruction after address X, since the faulting instruction has already been attempted
BThe entry point of the fault handler, to re-run the diagnostic logic
CAddress X itself — the faulting instruction is retried
DThe start of the current function, which must re-run from a clean state
Question 2 Multiple Choice

A user program executes the 'syscall' instruction to request kernel services. What type of exception is this, and where does execution resume after the handler returns?

AA fault; execution restarts the syscall instruction so the request can be re-evaluated
BA trap; execution resumes at the instruction after the syscall
CAn abort; the process is terminated as the hardware assumes the system call failed
DA hardware interrupt; execution resumes where it was interrupted, which may be anywhere
Question 3 True / False

Exception handlers can run in user mode if the faulting process has sufficient privileges, allowing fast, OS-bypass handling.

TTrue
FFalse
Question 4 True / False

A fault saves the instruction pointer to the address of the faulting instruction so that, after the handler resolves the problem, the same instruction can be retried.

TTrue
FFalse
Question 5 Short Answer

What is the difference between a fault and a trap in terms of the saved return address, and why does this distinction matter for the correct behavior of virtual memory?

Think about your answer, then reveal below.