It promises the hardware: I will not let these unruly user processes touch you in ways that break you. It promises the processes: I will give you the illusion of owning the entire machine, so you do not have to know about each other.
Ask a hundred programmers what a kernel is, and you’ll hear a hundred variations of the same functional definition: “It’s the core of the operating system, managing memory, processes, and hardware.” This is correct, but it’s like saying a nation-state is “a piece of land with borders and a government.” It misses the soul of the thing. what is os kernel
The kernel is the that makes civilization possible on top of this idiot. The Privilege Ring: The Kernel as High Priest At the hardware level, the kernel is defined by a single, critical concept: privilege . Modern CPUs have at least two modes: user mode and kernel mode (often called "ring 3" and "ring 0"). In user mode, the CPU is handcuffed. It cannot talk directly to hardware. It cannot manage memory pages. It cannot halt the system. It can only ask the kernel for permission. It promises the hardware: I will not let
Hardware is asynchronous. The disk finishes reading. The network card receives a packet. The keyboard is pressed. The kernel must respond to these events in microseconds. The kernel is the that makes civilization possible
The kernel, with the help of the CPU’s Memory Management Unit (MMU), maintains page tables. These are maps that translate a process’s fake “virtual address” into a real “physical address.” When a process touches a memory location that isn’t mapped— page fault —the kernel wakes up. It might load data from disk (swap), allocate a new physical page, or, if the access was illegal, kill the process with the infamous SIGSEGV (Segmentation Fault).