Anyone who uses tech­nolo­gies with an operating system is working with a kernel, though often without realizing it. The kernel organizes processes and data in every computer. It serves as the core of an operating system and the interface between software and hardware. This means that the kernel is in constant use and is a key component of an operating system.

The kernel not only serves as the core of the system but is also a program that controls all processor and memory access. It is re­spon­si­ble for the most important drivers and has direct access to the hardware. It’s the basis for in­ter­ac­tions between hardware and software and manages their resources as ef­fi­cient­ly as possible.

$1 Domain Names – Grab your favorite one
  • Simple reg­is­tra­tion
  • Premium TLDs at great prices
  • 24/7 personal con­sul­tant included
  • Free privacy pro­tec­tion for eligible domains

What is a kernel?

The kernel is the heart of the operating system and controls all the important functions of hardware – this is the case for Linux, macOS and Windows, smart­phones, servers, and vir­tu­al­iza­tions like KVM as well as every other type of computer.

Structure of a kernel

A kernel is always built the same way and consists of several layers:

  • The deepest layer is the interface with hardware (proces­sors, memory, and devices), which manages network con­trollers and PCI express con­trollers, for example.
  • On top of that is the memory man­age­ment, which entails dis­trib­ut­ing RAM including the virtual main memory.
  • Then comes process man­age­ment (scheduler), which is re­spon­si­ble for time man­age­ment and makes mul­ti­task­ing possible.
  • The next layer contains device man­age­ment.
  • The highest layer is the file system. That’s where processes are assigned to RAM or the hard drive.

Process

A kernel is central to all layers, from system hardware to ap­pli­ca­tion software. Its work ends where user access begins: at the Graphical User Interface (GUI). The kernel thus borders on the shell (that is, the user interface). You can picture the kernel as a seed or pit and the shell as the fruit that surrounds the pit.

What is a kernel in a computer program?

Think of the kernel in this context like a colonel: They both pass along commands. A program sends “system calls” to the kernel, for example when a file is written. The kernel, well-versed in the in­struc­tion set of the CPU, then trans­lates the system call into machine language and forwards it to the CPU. All of this usually happens in the back­ground, without the user noticing.

What are the kernel’s tasks?

The main task of the kernel is to multitask. This requires keeping up with time con­straints and remaining open to other ap­pli­ca­tions and ex­pan­sions.

For every rule there are ex­cep­tions in such a lean, well-func­tion­ing system as an operating system. That’s why the kernel only serves as a go-between when it comes to system software, libraries, and ap­pli­ca­tion software. In Linux, the graphic interface is in­de­pen­dent from the kernel.

Note

In multi-user systems, the kernel also monitors access rights to files and hardware com­po­nents. The Task Manager shows what those are at any given time. If a process is finished by the user, the Task Manager gives the kernel in­struc­tions for stopping the process and freeing the memory that was used for it.

When a computer powers up, the kernel is the first thing that’s loaded into the RAM. This happens in a protected area, the boot­loader, so that the kernel can’t be changed or deleted.

Af­ter­wards, the kernel ini­tial­izes the connected devices and starts the first processes. System services are loaded, other processes are started or stopped, and user programs and memory al­lo­ca­tion are initiated.

How does a kernel work?

This question is best answered by coun­ter­ing: What is a kernel not? The kernel is not the core of a processor, it’s the core of the operating system. A kernel is also not an API or framework.

Mul­ti­k­er­nel operating systems can use various cores of a multicore processor like a network of in­de­pen­dent CPUs. How does that work? It comes down to the special structure of the kernel, which is composed of a series of different com­po­nents:

  • Since the kernel’s lowest layer is machine oriented, it can com­mu­ni­cate directly with the hardware, processor, and memory. The functions of the kernel vary among its five layers, from processor man­age­ment to device man­age­ment. The highest layer cannot access machines, and instead is re­spon­si­ble for in­ter­fac­ing with software.
  • Ap­pli­ca­tion programs run sep­a­rate­ly from the kernel in the operating system and merely draw on its functions. Without the kernel, com­mu­ni­ca­tion between programs and hardware wouldn’t be possible.
  • Several processes can run si­mul­ta­ne­ous­ly thanks to the mul­ti­task­ing kernel. But it’s generally the case that only one action can be processed by the CPU at one time – unless you’re using a multicore system. The rapid change in processes that gives the im­pres­sion of mul­ti­task­ing is taken care of by the scheduler.

From these com­po­nents follow the four functions of the kernel:

  1. Memory man­age­ment: Regulates how much memory is used in different places.
  2. Process man­age­ment: De­ter­mines which processes the CPU can use, as well as when and how long they’re used for.
  3. Device driver: In­ter­me­di­ates between hardware and processes.
  4. System calls and security: Receives service requests from the processes.

When im­ple­ment­ed properly, the functions of the kernel are invisible to users. The kernel works in its own setting, the kernel space. On the other hand, files, programs, games, browsers, and every­thing that the user sees are located in the user space. In­ter­ac­tion between these two use the system call interface (SCI).

The kernel in the operating system

To un­der­stand the function of the kernel in the operating system, imagine the computer as divided into three levels:

  1. Hardware: The foun­da­tion of the system, made up of RAM, the processor and input and output devices. The CPU carries out reading and writing op­er­a­tions and cal­cu­la­tions for the memory.
  2. Kernel: The nucleus of the operating system in contact with the CPU.
  3. User processes: All running processes that the kernel manages. The kernel makes com­mu­ni­ca­tion between processes and servers possible, also known as Inter-Process Com­mu­ni­ca­tion (IPC).

There are two modes for the code in a system: kernel mode and user mode. The code in kernel mode has unlimited access to the hardware, whereas in user mode access is limited to the SCI. If there’s an error in user mode, not much happens. The kernel will intervene and repair any potential damage. On the other hand, a kernel crash can cause the entire system to crash. This is, however, unlikely due to the security measures in place.

What kind of kernels exist?

One type of kernel pre­vi­ous­ly described is the mul­ti­task­ing kernel that describes several processes running si­mul­ta­ne­ous­ly on one kernel. If you add access man­age­ment to it, you’ll have a multiuser system, on which several users can work at the same time. The kernel is re­spon­si­ble for au­then­ti­ca­tion, as it can allot or separate called processes.

What is an open source kernel?

Linux maintains a com­pre­hen­sive archive on its kernel. Apple has published the kernel types for all of its operating systems for open source access. Microsoft also uses a Linux kernel for the Windows subsystem for Linux.

Note

It’s easy to lose track of the different kernel types. Linux systems and Android devices use a Linux kernel. Windows uses the NT kernel, which various sub­sys­tems draw on. Apple uses the XNU kernel.

The three types of kernels

There are various types of kernels that are used across different operating systems and end devices. They can be sorted into three groups:

  1. Mono­lith­ic kernels: A large kernel for various tasks. It’s re­spon­si­ble for memory and process man­age­ment as well as com­mu­ni­ca­tion between processes and offers functions for driver and hardware support. This is the kernel in operating systems like Linux, OS X, and Windows.
  2. Mi­cro­ker­nel: The mi­cro­ker­nel is de­lib­er­ate­ly small, so that errors and crashes don’t affect the entire operating system. To ensure that it can still fulfill the same functions as a large kernel, it’s organized into several modules. The OS X component Mach serves as the only decent example, since up until now there aren’t any operating systems with mi­cro­ker­nels.
  3. Hybrid kernel: A com­bi­na­tion of mi­cro­ker­nel and monolith. The large kernel is more compact and can be broken down into modules. Further kernel parts can be appended dy­nam­i­cal­ly. They’re used in part by Linux and OS X.
Go to Main Menu