A protected control layer

Applications need processor time, address spaces, and I/O services without unrestricted access to other programs or protected state. The kernel supplies controlled entry paths supported by hardware execution modes and access checks.

Higher privilege does not make inputs trustworthy. Request identifiers, arguments, and addresses still require validation. A mode transition without correct checking cannot by itself establish a secure service boundary.

References: [1] [2]

Entering through requests and events

Applications request services through system calls, while timer and device interrupts bring events into kernel handling. Entry code preserves required state and establishes the environment before running the relevant handler.

Linux documents ordering constraints for entry and exit, including tracing and interrupt accounting. Different origins do not all use an identical path, and kernel entry is not an arbitrary function jump chosen freely by an application.

References: [3] [1]

Kernel execution is not automatically another process

Handling a request can return to its original task or lead to scheduling another one. A privilege transition and a task context switch are distinct, and each request does not require creating a new ordinary process.

The complete operating environment also contains libraries, tools, and other services. RISC-V further distinguishes an operating system from its supervisor execution environment, which can be supplied by underlying software or a virtual machine monitor.

References: [1] [2]