operating-systems hardware

Definition

Execution Mode

An execution mode is a hardware-enforced state of the CPU that determines the privilege level of executing code. It dictates which instructions can be executed and which memory regions can be accessed.

Most architectures support at least two modes: User Mode and Kernel Mode.

The current mode is stored as bits in the Program Status Word (PSW).

Functionality

Protection

Prevents user-level processes from executing sensitive instructions (e.g., halting the CPU) that could crash the system.

Isolation

Ensures a failure in a user application does not affect the kernel or other processes.

Resource Control

Only privileged code can modify OS Control Structures or access hardware I/O ports directly.

Transitions occur through system calls, interrupts, or traps.