Here’s a great article from The Crazy Programmer
Operating System (OS) is a platform that allows a user to interact with the computer hardware. This serves as the interface between them. Allowing the user to execute different kinds of functions on the machine and utilize the hardware to the fullest.
A kernel is a structure over which an operating system handles all the fundamental processes and resources which are required during the boot sequence. It involves communication with hardware and managing the resources of the machine.
During the booting of the Operating System, the kernel does a “system check” to inspect that all components attached/present on the system like GPU, Harddisk, Processor, Mouse, or Keyboard are working or not. This is the place where the infamous “Keyboard not found, press F to continue” message used to appear. After inspection, the graphical UI appears and the OS is booted. Eventually, the kernel keeps on running in the background handling all the system resources.
Types of Kernels
Various types of Kernels are present but the most important ones are Monolithic Kernel and MicroKernel.
Monolithic Kernel
It has a simple approach. It has various modules that are loaded to create a communication pathway between hardware and software. It is in the form of a single block of code form in which information is extracted whenever required or when a bug is encountered. Because of this, there is no need to recompile the kernel even for a small change. One can easily unload a module that is not needed.
MicroKernel
They are different from the Monolithic kernel as they only store the resources for basic tasks. Because of this, they are very small as compared to the prior. For managing all the tasks, it uses a “server”. The task is separated/split into different modules. This approach in although complex but is more efficient as it increases the system stability because only basic services run in the background. As a result, minimum background services run leaving the system free from unnecessary tasks.
Functions of Kernel
- A Kernel provides access to various computer resources like the CPU, I/O devices.
- It helps in sharing the resources among the various processes so that there are uniform and equal distribution between all process.
- It has complete access to system memory and it takes care of memory allocation for different tasks for their execution. This is done by creating virtual partitions on the memory based on the requirement of the application.
- All the processes that are performed on the system are through various input/output devices. The kernel allocates these devices. This is done through the device driver which is an integral part of the OS and its main function is to allow the OS to interact with the connected hardware devices.
- It directs the application to the part of memory it (application) can access.
- It provides techniques for communication and synchronization between process called IPC (Interprocess communication)
- It is very smart in determining and scheduling the time that has to be given to various processes based on the preferences so that multiple programs can be executed on the system.
- It also protects from malicious behavior.
Kernel is an immensely complicated component of the OS that provides an interface between hardware and software.
The post What is the Function of the Kernel of an Operating System? appeared first on The Crazy Programmer.