A kernel is the core of an operating system: the code that runs with full privilege and shares the hardware among programs. It schedules processors, manages memory, talks to devices and enforces isolation. Everything else, from the shell to the browser, depends on the promises a kernel keeps.
Key concepts
- Privilege levels: the processor separates kernel mode from user mode, so a program cannot touch the hardware directly.
- Scheduling: deciding which task runs on which processor, for how long, and in what order.
- System calls: the controlled entry point from user programs into the kernel.
- Virtual memory: each process sees its own address space, mapped by the kernel onto physical memory.
- Kernel designs: a monolithic kernel keeps most services in one privileged image; a microkernel keeps little there and runs the rest as ordinary processes.
Vocabulary
- Interrupt: a hardware signal that makes the processor stop and run a kernel handler.
- Context switch: saving one task's state and restoring another's.
- Module: kernel code loaded after boot, such as a driver.
- Panic: the kernel stops because it has found a state it cannot safely continue from.
What to study, in order
- Operating-system concepts: processes, threads, scheduling, synchronisation, virtual memory.
- Boot a tiny teaching kernel in an emulator and print to the screen from it.
- Add a timer interrupt and a simple round-robin scheduler.
- Add paging and a memory allocator, and test them on purpose with bad accesses.
- Implement a system call and call it from a user program.