The kernel is the central component of an operating system. It is the first software layer that begins running after the computer boots and remains active until it is shut down.
The kernel's primary role is to act as an intermediary between the hardware and software.
No application has direct access to the processor, memory, or devices. All requests go through the kernel.
The system is organized into layers:
Hardware (processor, memory, devices)
↓
Kernel
↓
System interfaces
↓
Applications and tools
Kernel:
- manages resources
- isolates programs from each other
- ensures stability and security
The kernel decides:
- which program is currently running
- when to suspend it
- when to transfer control to another
Kernel:
- allocates RAM
- ensures that programs do not interfere with each other
- manages virtual memory
Without this, one error could bring the entire system to a halt.
The keyboard, screen, disk, and network are all controlled by the kernel.
The kernel:
- receives signals from devices
- passes data to programs
- abstracts hardware differences
Hardware devices don't wait for a program to finish. They send interrupts.
The kernel:
- handles interrupts
- temporarily suspends execution
- responds to events in a timely manner
The kernel provides a formal way for programs to interact with the system.
Through this interface, programs can:
- read and write data
- run other programs
- work with devices
Programs don't know how the hardware works—it's hidden by the kernel.
Kernel:
- Separates access levels
- Prevents unauthorized actions
- Isolates program errors
The processor has different operating modes.
The kernel runs in privileged mode, where the following is available:
- Memory management
- Interrupt handling
- Device management
Normal programs run in a restricted mode.
Kernels are written in languages that allow:
- precise memory management
- processor interaction
- minimizing overhead
Almost always used:
- low-level languages for system startup
- system languages for core logic
The choice of language is a tradeoff between:
- control
- security
- performance
The kernel does not:
- provide a user interface
- process user commands
- display windows or a terminal
All these functions are performed by programs on top of the kernel.
The kernel is:
- the foundation of the system
- resource manager
- security layer
- the link between programs and hardware
Without the kernel, an operating system is impossible.