Kernel mode (privileged) can execute any instruction and access all memory and hardware; user mode is restricted, so a buggy application cannot corrupt the system.
The CPU switches to kernel mode on a system call, an interrupt or an exception, and returns to user mode after the kernel finishes (a mode bit in a CPU register records the current mode).
Privileged instructions (I/O, changing page tables, halting) trigger a fault if executed in user mode.
Loading…