operating-systems

Definition

Kernel

The kernel is the core component of an operating system acting as the primary interface between hardware and processes. It manages resources (CPU, memory, I/O) and provides essential services.

The kernel resides in protected kernel space, preventing user applications from interfering with its operation.

Functions

Resource Management

Allocating CPU time (scheduling) and memory to active processes.

Hardware Abstraction

Providing a consistent interface for diverse hardware through drivers.

Process Management

Creating, executing, and terminating processes (see Process States).

Security and Isolation

Enforcing permissions and isolating process memory to prevent crashes or data theft.

Implementation Models

Non-Process Kernel

Kernel exists as a separate entity outside any process. On system call or interrupt, processor switches to kernel mode. Kernel has its own dedicated memory and stack.

Execution within User Processes

OS code and data mapped into every process’s address space. Process switches from user mode to kernel mode using a dedicated kernel stack. True process switch only occurs when the scheduler runs a different process.

Process-Based (Microkernel)

OS services implemented as system processes. Only a tiny microkernel manages process switching and IPC; file system, drivers, etc. run as separate processes communicating via messages. Provides high modularity and distribution capability.