Definition
OS Execution within User Processes
OS execution within user processes is an architecture where the kernel is mapped into the address space of every process. The OS exists as a privileged part of the process itself, not as a separate entity.
When a process requires an OS service (e.g., a system call), it performs a mode switch to kernel mode but remains within its own process context.
Mechanism
Shared Address Space
Each process has private user memory and a shared region containing the OS kernel.
Separate Stacks
The process uses a User Stack for application code and a dedicated Kernel Stack for OS routines.
Efficiency
A mode switch is faster than a process switch because TLB mappings need not be flushed when staying within the same process.
Properties
High Performance
Reduced switching overhead makes system calls fast.
Context Preservation
The process maintains its identity (PID, priorities) regardless of execution mode.
Analogy
Conductor's Cabin