operating-systems

Definition

User Mode

User Mode is a restricted execution state of the processor designed for executing untrusted application code. In this mode, the CPU is prohibited from executing privileged instructions or accessing memory outside of the process’s allocated user space.

Properties

Restrictions

Code running in User Mode cannot:

  • Access kernel space memory.
  • Manipulate hardware registers directly (e.g., control registers).
  • Execute privileged instructions (any attempt to do so generates a trap/exception).

Transition

To perform privileged operations (like I/O or memory allocation), a process must transition to Kernel Mode via controlled entry points:

  • System Calls: Explicit requests by the program.
  • Interrupts: Asynchronous hardware signals.
  • Traps: Synchronous exceptions (e.g., division by zero).

User vs. Kernel Mode

FeatureUser ModeKernel Mode
Privilege LevelLow (Restricted)High (Unrestricted)
Hardware AccessThrough the OS onlyDirect and full access
Memory AccessAllocated user space onlyAll system memory
Failure ImpactProcess crash onlyPotential system crash