Ch. 21 · Operating Systems

User Mode, Kernel Mode and Privileged Operations

User Mode, Kernel Mode and Privileged Operations. Learn the reasoning, a practical example, common mistakes and an interview exercise.

~2 min readbeginnerupdated Oct 3, 2026

Privilege separation keeps applications from directly performing protected operations. System calls provide controlled entry to kernel services.

Before you start

You should understand processes, threads, memory and basic file operations. Track ownership and state changes over time. For concurrent scenarios, write down at least two possible execution orders; the same instructions can behave differently when scheduling or resource availability changes.

The practical goal is to reason through this situation: Reading a file crosses a defined system-call boundary. Read the walkthrough first, then try the interview exercise before opening its answer. The important part is explaining the decision and its consequences, rather than remembering a definition alone.

Step-by-step walkthrough

Step 1: Identify protected work

File and device access crosses an operating-system-controlled boundary.

Step 2: Trace the system call

The kernel validates context and performs the permitted operation.

Step 3: Handle returned outcomes

The application receives data or an error rather than direct privileged access.

Worked scenario

Reading a file crosses a defined system-call boundary.

A file read asks the kernel to locate an open resource and obtain bytes under applicable permissions. The operation may wait for storage and later resume the application. Crossing into kernel mode does not grant the caller arbitrary kernel execution; the interface limits the requested operation and its inputs.

Common mistake

Kernel mode is not simply another application thread with unrestricted user control.

Verify the behavior

Explain permission failure and delayed I/O separately from normal data return.

Interview exercise

Explain a file read.

Answer and reasoning

Trace application request, kernel permission and filesystem handling, then the return of data or an error.

Continue learning

Compare the scenario with the Operating Systems interview questions and test your understanding with the Operating Systems MCQs. For terminology and implementation details, consult the reference material.

More in Operating Systems

read ✓Operating Systems · hard

Operating Systems: CPU Cache Locality

Improve performance with spatial and temporal locality, avoid pointer chasing, and understand false sharing between threads.

~2 min readread →
read ✓Operating Systems · hard

Copy-on-Write Memory and fork

How copy-on-write lets fork share pages until a write, why RSS can be misleading, and the implications for memory and latency.

~2 min readread →
read ✓Operating Systems · hard

Operating Systems: epoll and select

How select, poll and epoll report I/O readiness, and the difference between level- and edge-triggered notifications.

~2 min readread →
esc