Kernel mode & User mode
1 min readJan 25, 2018
As we all know that CPU (micro-processor) executes all the instructions.
Most of the modern architectures support at least 2 modes of CPU operation. Even if architecture supports more than 2 modes, they are usually grouped under 2 modes to have compatibility (of OS — across all machines).
- Mode 1 — Every operation possible is allowed
- Mode 2 — Some operations are restricted (Instruction involving Hardware and RAM. If invoked the current execution/context is killed => violating process will be terminated)
Mode 1 also called as Unrestricted/Supervisor/Ring 0
Take away:
Most trusted codes is allowed to run in Mode 1. Usually kernel code of operating system executes in this mode.
All other codes execute in user mode.
Following source are really good:
Originally published at unrestricted-design-dev.blogspot.com on January 25, 2018.