What is the kernel and how does it work?

December 9, 2020
Many times we will have heard the word Kernel without knowing what they refer to. Or have read it in any technology text alluding to complex and understood topics.
What is Kernel?
The kernel is the central part or heart of any operating system. You could say that the kernel functions as an intermediary between the software and the hardware, since it is the one that receives commands from the operating system elements to send them to the processor or other hardware elements to run. All operating systems have a Kernel, even Windows 10, but perhaps the most famous is the Linux Kernel, which is now also integrated into Windows 10 with its latest updates.
The kernel is the first layer of software where we have the drivers that control all the components of the hardware such as: display, camera, bluetooth, memory, USB, Wifi, Audio, Charging, CPU, etc.
This core of the operating systems runs in privileged mode with special access to the system resources to be able to make the access requests that the software that needs it is requesting. In addition as the resources are not unlimited, it also acts as an arbitrator when assigning them, deciding the order of the requests received according to the priority and importance of these. A very important and fundamental management that in most cases goes unnoticed even if it is an essential work to coordinate all the hardware with the software.
The Windows kernel is private and its code is safe in which only Microsoft can make modifications to improve its next versions of Windows 10. As is macOS, Unix-based but privately licensed, reserves it to the development team commissioned by Apple to make these modifications. But Linux has a public Kernel under GPL v2 license and its code (or most) is available to download it, examine it or even make useful contributions and modifications for other users.
Kernel, the core of the operating system
Each device consists of two large parts, hardware (components, parts) and software (the operating system). The optimal understanding between the two depends on the operation of the device. Well, the kernel can be defined as the intermediary between the hardware and the software, while the operating system sends a series of commands that are received by the kernel which in turn sends them to the corresponding hardware component in order for them to be executed. Therefore, the kernel could also be defined as the epicenter of the operating system, as it is software that is part of it.
If we become technical, the word kernel originates from the German origin root “kern” and means kernel, the part of the operating system running in privileged mode. That is, the one that makes it easier for the different programs to enjoy secure access to the components (hardware) of the computer or device managing the resources.
In this sense, we must know that in the kernel are the drivers thanks to which we can control the audio, bluetooth, Wifi connectivity, the screen, the charging, etc. on a mobile phone, on a tablet or on another device like that.
Kernel Functions
One of the functions of the kernel, in this framework, is to define which software a hardware device can use and for how long. That’s why it’s very important in RAM management.
What the kernel does, in short, is communicate the software with the hardware. For this purpose it is responsible for managing the physical devices (the processor, peripherals, etc.) and the various software, ordering how they access the resources.
Since there are a large number of programs and each program can access the hardware on a limited basis, the kernel has the function of managing this interaction, deciding which device can use each program and for how long. This is known as multiprogramming, a technique by which two or more processes can be hosted in main memory to be run concurrently by the main processor.
Direct access to hardware can be very complex. For this reason, the kernel usually does this through what is known as the hardware abstraction layer, an operating system component that serves as an interface between the program and devices. This abstraction layer provides us with a consistent hardware platform for us to run the software on top of it.
Kernel types
There are several types of kernel, the most commonly used kernel is monolithic kernel and micro kernel.
- Monolithic kernel: facilitate truly powerful and varied underlying hardware abstractions.
- Microkernel: Provide a small set of simple hardware abstractions, and use applications called servers to provide greater functionality.
- Hybridkernel: They are very similar to pure microkernel, except that they include additional code in the core space to run faster.
- Exokernel: they do not facilitate any abstraction, but allow the use of libraries that provide greater functionality thanks to direct or almost direct access to the hardware.
The Kernel is in charge of making basically everything work, it has to be able to boot. For example, a PC from the time we turn it on until we see visible the desktop, all this communicating with the hardware elements that the PC has and that are also necessary to make it work, once we have the desktop must be able to run the programs that we want to open and make them work on our PC.