A Kernel is a computer program that is the heart and core of an Operating System. Since the Operating System has control over the system so, the Kernel also has control over everything in the system. It is the most important part of an Operating System. Whenever a system starts, the Kernel is the first program that is loaded after the bootloader because the Kernel has to handle the rest of the thing of the system for the Operating System. The Kernel remains in the memory until the Operating System is shut-down.
The Kernel is responsible for low-level tasks such as disk management, memory management, task management, etc. It provides an interface between the user and the hardware components of the system. When a process makes a request to the Kernel, then it is called System Call.
A Kernel is provided with a protected Kernel Space which is a separate area of memory and this area is not accessible by other application programs. So, the code of the Kernel is loaded into this protected Kernel Space. Apart from this, the memory used by other applications is called the User Space. As these are two different spaces in the memory, so communication between them is a bit slower.
Functions of kernel
A kernel of an OS is responsible for performing various functions and has control over the system. Some main responsibilities of Kernel are given below:
- Device Management
To perform various actions, processes require access to peripheral devices such as a mouse, keyboard, etc., that are connected to the computer. A kernel is responsible for controlling these devices using device drivers. Here, a device driver is a computer program that helps or enables the OS to communicate with any hardware device.
A kernel maintains a list of all the available devices, and this list may be already known, configured by the user, or detected by OS at runtime. - Memory Management
The kernel has full control for accessing the computer’s memory. Each process requires some memory to work, and the kernel enables the processes to safely access the memory. To allocate the memory, the first step is known as virtual addressing, which is done by paging or segmentation. Virtual addressing is a process of providing virtual address spaces to the processes. This prevents the application from crashing into each other. - Resource Management
One of the important functionalities of Kernel is to share the resources between various processes. It must share the resources in a way that each process uniformly accesses the resource.
The kernel also provides a way for synchronization and inter-process communication (IPC). It is responsible for context switching between processes. - Accessing Computer Resources
A kernel is responsible for accessing computer resources such as RAM and I/O devices. RAM or Random-Access Memory is used to contain both data and instructions. Each program needs to access the memory to execute and mostly wants more memory than the available. For such a case, Kernel plays its role and decides which memory each process will use and what to do if the required memory is not available.
The kernel also allocates the request from applications to use I/O devices such as keyboards, microphones, printers, etc.
Monolithic Kernel:
Monolithic Kernels are those Kernels where the user services and the kernel services are implemented in the same memory space i.e. different memory for user services and kernel services are not used in this case. By doing so, the size of the Kernel is increased and this, in turn, increases the size of the Operating System. As there is no separate User Space and Kernel Space, so the execution of the process will be faster in Monolithic Kernels.

Advantages:
- It provides CPU scheduling, memory scheduling, file management through System calls only.
- Execution of the process is fast because there is no separate memory space for user and kernel.
Disadvantages:
- If any service fails, then it leads to system failure.
- If new services are to be added then the entire Operating System needs to be modified.
Micro Kernel:
A Microkernel is different from Monolithic kernel because in a Microkernel, the user services and kernel services are implemented into different spaces i.e. we use User Space and Kernel Space in case of Microkernels. As we are using User Space and Kernel Space separately, so it reduces the size of the Kernel and this, in turn, reduces the size of Operating System.

As we are using different spaces for user services and kernel service, so the communication between application and services is done with the help of message parsing and this, in turn, reduces the speed of execution.
Advantages:
- If new services are to be added then it can be easily added.
Disadvantages:
- Since we are using User Space and Kernel Space separately, so the communication between these can reduce the overall execution time.
References:
Leave a comment