What is Kernel?
In computer science, Kernel is a computer program that is a core or heart of an operating system. Before discussing kernel in detail, let's first understand its basic, i.e., Operating system in a computer.
An operating system or OS is system software that works as an interface between hardware components and end-user. It enables other programs to run. Each computer system, whether it is desktop, laptop, tablet, or smartphone, all must have an OS to provide basic functionalities for the device. Some widely used operating systems are Windows, Linux, MacOS, Android, iOS, etc.
What is Kernel in Operating System?
Functions of a 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:
Types of Kernel
There are mainly five types of Kernel, which are given below:
1. Monolithic Kernels
In a monolithic kernel, the same memory space is used to implement user services and kernel services.
It means, in this type of kernel, there is no different memory used for user services and kernel services.
As it uses the same memory space, the size of the kernel increases, increasing the overall size of the OS.
The execution of processes is also faster than other kernel types as it does not use separate user and kernel space.
Examples of Monolithic Kernels are Unix, Linux, Open VMS, XTS-400, etc.
A microkernel is also referred to as μK, and it is different from a traditional kernel or Monolithic Kernel. In this, user services and kernel services are implemented into two different address spaces: user space and kernel space. Since it uses different spaces for both the services, so, the size of the microkernel is decreased, and which also reduces the size of the OS.
Microkernels are easier to manage and maintain as compared to monolithic kernels. Still, if there will be a greater number of system calls and context switching, then it might reduce the performance of the system by making it slow.
These kernels use a message passing system for handling the request from one server to another server.
Only some essential services are provided by microkernels, such as defining memory address spaces, IPC(Interprocess Communication), and process management. Other services such as networking are not provided by Kernel and handled by a user-space program known as servers.
One of the main disadvantages of monolithic kernels that an error in the kernel can crash the whole system, can be removed in the microkernel. As in a microkernel, if a kernel process crashes, the crashing of the whole system can still be prevented by restarting the error-caused services.
Examples of Microkernel are L4, AmigaOS, Minix, K42, etc.
3. Hybrid Kernel
Hybrid kernels are also known as modular kernels, and it is the combination of both Monolithic and Microkernels. It takes advantage of the speed of monolithic kernels and the modularity of microkernels.
A hybrid kernel can be understood as the extended version of a microkernel with additional properties of a monolithic kernel. These kernels are widely used in commercial OS, such as different versions of MS Windows.
It is much similar to a microkernel, but it also includes some additional code in kernel space to enhance the performance of the system.
Hybrid kernels allow to run some services such as network stack in kernel space to reduce the performance compared to a traditional microkernel, but it still allows to run kernel code (such as device drivers) as servers in user-space.
Examples of Hybrid Kernel are Windows NT, Netware, BeOS, etc.
As the name suggests, in Nanokernel, the complete code of the kernel is very small, which means the code executing in the privileged mode of the hardware is very small. Here the term nano defines a kernel that supports a nanosecond clock resolution.
Examples of Nanokernel are EROS etc.
Exokernel is still developing and is the experimental approach for designing OS.
This type of kernel is different from other kernels as in this; resource protection is kept separated from management, which allows us to perform application-specific customization.
What is Kernel Panics?
As we have already discussed, that kernel controls over entire computer system; hence if it crashes, it can take down the whole system. In MacOS and Linux, such an undesirable event is known as "Kernel Panic." To recover from kernel Panic, we need to restart the system.
Usually, these kernel panics are caused by hardware communication issues. Hence, if repeated kernel panics are occurring, then try to unplug the less required or unnecessary devices and check if the problem is get resolved or not.
Next TopicWhat is a Webpage