Kernel Types - aryanjoshi0823/5143-Operating-System GitHub Wiki
Types of Kernels in Operating Systems
Operating systems are built around a central component known as the Kernel, which manages system resources and hardware communication. Below are the five types of kernels, along with their explanations, advantages, and disadvantages.
a) Monolithic Kernels
The Kernel and userspace use the same memory space in a monolithic kernel. This means that no different memory space is used for user services and kernel services. The OS's overall size increases since it uses the same memory space. The execution of processes is faster in this type of Kernel as the same memory space is used for user and kernel services.
- Examples: Unix, Linux, XTS-400.
Advantages
- Faster execution of processes.
- Smaller source code and compiled form due to its single-software design.
Disadvantages
- Modifying the kernel for new services requires rewriting the entire OS.
- Lack of portability—kernel must be rewritten for different architectures.
- Errors in one service can crash the entire system.
- Larger size makes it harder to manage.
b) Microkernels
In this type of Kernel, the user and Kernel services are implemented into two different address spaces, i.e., user and kernel spaces. It is easier to manage and maintain than Monolithic Kernel, but it may perform slower if many system calls and context switching are made.
Microkernels provide only some essential services like defining memory address space, Inter-Process Management, and process management. The Kernel does not offer other services like networking. Instead, they are handled by a userspace program known as Server.
In microkernels, there will be no system crash when a process crashes, and it can be resolved by just restarting the error-caused services.
- Examples: Amigos, Minix, L4.
Advantages
- Easier to manage and maintain.
- New services can be added without modifying the existing OS.
- System stability is enhanced, as a crash in a process doesn't affect the kernel.
Disadvantages
- Reduced performance due to additional interfacing overhead.
- Complex process management.
c) Hybrid Kernels
Hybrid Kernels are a combination of both Monolithic kernels and Microkernels. It combines the speed of Monolithic Kernel with the modularity of Microkernels. It is similar to a microkernel, but it also includes some additional code in kernel space to enhance the system performance. Hybrid Kernel allows to run some services like network stack in kernel space, but it still allows kernel code like device drivers to run as servers in userspace.
- Examples: Windows NT, BeOS, NetWare.
Advantages
- No reboot is required for testing new changes.
- Easier and faster integration of third-party technologies.
Disadvantages
- More interfaces increase the chances of bugs.
- Managing modules is challenging for administrators.
d) Nanokernels
In Nanokernel, the complete code of the Kernel is very small. This means that the code getting executed in the privileged mode of hardware is very small. In Nanokernel, the term nano defines the support for a nanosecond clock resolution.
- Examples: EROS.
Advantages: Extremely small size provides efficient hardware abstraction.
Disadvantages: Limited functionality due to the absence of system services.
e) Exokernels
In Exokernel, resource protection is separated from the management part, which allows us to perform application-specific customization. It follows the end-to-end principle. It has the fewest hardware abstractions possible and allocates the physical resources to applications.
Advantages
- Enhanced application control and performance.
- Applications can implement customized memory management.