Beginner Topic 2 of 51 Operating Systems
Kernel
Privileged core of the OS controlling hardware access.
How it works
The kernel is the core of the operating system that runs in privileged mode with full hardware access. It handles process scheduling, memory management, interrupts, device drivers, system calls and inter-process communication. Designs range from monolithic kernels with most services inside, to microkernels with minimal code and services in user space. Loadable modules extend it at run time.
Step-by-step walkthrough
- User programs run with limited privileges.
- A system call crosses into the kernel.
- Kernel subsystems handle scheduling, memory, files and networking.
- The kernel alone talks to the hardware.
- Results return to the program and the CPU drops back to user mode.
Where it is used
All applications depend on the kernel for CPU time, memory, files and networking. Kernel developers write drivers, file systems, schedulers and security modules, and administrators tune kernel parameters.
Common pitfall
A bug in kernel code can crash or compromise the whole system, since there is no protection from itself. Kernel programming has no standard library, strict rules about sleeping and locking, and limited stack. Treat input from user space as untrusted, keep drivers small and use tools like sanitizers and fuzzers to find bugs.
Where it fits in the course
Kernel is topic 2 of 51 in Operating Systems, rated Beginner. It follows What is an Operating System. The next topic is User Mode vs Kernel Mode.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Operating Systems quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Operating Systems quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Kernel?
Where do people use Kernel?
What is the most common mistake with Kernel?
What should I learn before this topic?
How can I practice it?
Is Kernel hard to learn?
How long does it take to learn Kernel?
Which topics are related to Kernel?
What should I study after Kernel?
Related topics
- What is an Operating System (Operating Systems)
- User Mode vs Kernel Mode (Operating Systems)
- System Calls (Operating Systems)
- Processes (Operating Systems)