Questions: System Calls and User/Kernel Mode

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

A C program calls printf("Hello"). At what point does execution cross from user mode into kernel mode?

AImmediately when printf() is called, since printf() is a system call
BWhen the C standard library internally calls the write() system call to send bytes to the terminal
CNever — modern CPUs execute printf() directly without involving the kernel
DWhen the program is compiled, since the compiler inserts kernel calls at compile time
Question 2 Multiple Choice

Why are system calls significantly more expensive than ordinary function calls within a program?

ASystem calls require network access to communicate with the OS server
BThe kernel must validate that the requested operation is legal before executing it
CMode-switching saves all user-mode register state, flushes CPU pipeline state, and reverses the entire process on return — multiplying the cost of a simple function call many times over
DSystem calls use interpreted code rather than compiled machine instructions
Question 3 True / False

Calling the C standard library function printf() is itself a system call that directly transitions the CPU into kernel mode.

TTrue
FFalse
Question 4 True / False

The separation between user mode and kernel mode exists to prevent buggy or malicious programs from crashing the entire system by directly accessing hardware or modifying other processes' memory.

TTrue
FFalse
Question 5 Short Answer

What mechanism allows a user-space program to request a privileged operation from the kernel without compromising the user/kernel protection boundary, and how does the CPU ensure the transition is controlled?

Think about your answer, then reveal below.