I know that monolithic kernel runs all services in itself. And I searched over the internet to find why every article say its efficient. I couldn't find the reason. Why does it tend to be efficient than other kernels?
2 Answers
Before we start, let us summersize what a kernel is.
In computing, a kernel, which is a fundamental part of modern operating systems(OSs), is a program that allocates all your systems' resources and manages the input/output (I/O) requests, acting as an interface between the software and the hardware.
The kernel performs its tasks in the kernel space, whereas every other tasks are done in the user space. This separation ensures that the kernel data and the user data do not interfere, hence maintaining stability.
Kernel types:
A monolithic kernel has all its components running in the kernel space. This aproach was designed to provide robust performance.
A micro kernel has only its crucial parts running in the kernel space while the rest runs in the user space. It was designed to be faster and more modular for easy maintanence.
A hybrid kernel is a kernel that attempts to combine the aspects of both monolithic and micro kernels. It has a structure similar to that of a micro kernel, but implimented in the manner of a monolithic kernel.
Now coming to the main topic: Why is a monolithic kernel is more efficient? Because of their design, monolithic kernels have better performance, hence provide rich and more powerful hardware access. Nowadays they also consist of dynamically loaded and unloaded module, which provide the efficiency of modularity.
Hoped you liked my answer and found it useful =)
Microkernels offer the bare essentials to get a system operating. Microkernel systems have small kernelspaces
and large userspaces
.
Monolithic kernels, however, contain much more. Monolithic systems have large kernelspaces
. For instance, one difference is the placement of device drivers. Monolithic kernels contain drivers (modules)
and place them in kernelspace
while microkernels lack drivers. In such systems, the device drivers are offered in another way and placed in the userspace
. This means microkernel system still have drivers, but they are not part of the kernel. In other words, the drivers exist in another part of the operating system.
Also, in the modern day approach to monolithic architecture
, the kernel
consists of different modules which can be dynamically loaded and un-loaded. This modular approach allows easy extension of OS's capabilities. With this approach, maintainability of kernel became very easy as only the concerned module needs to be loaded and unloaded every time there is a change or bug fix in a particular module. So, there is no need to bring down and recompile the whole kernel for a smallest bit of change.
So,as per modern day changes, the monolithic kernels have took a grip over their limitations and are evolving better. Hence, everybody seems to praise it for its improved efficiency!
- I copied a few lines in this answer, but now I don't remember the source. If any one finds the correct source, it is my request to add the original references as an edit to the answer.CommentedAug 2, 2017 at 16:04