Monday, March 3, 2014

What are monolithic and micro kernels and what are the differences between them?

Monolithic kernel is a single large processes running entirely in a single address space. It is a single static binary file. All kernel services exist and execute in kernel address space. The kernel can invoke functions directly. The examples of monolithic kernel based OSs are Linux, Unix.

In Microkernels, the kernel is broken down into separate processes, known as servers. Some of the servers run in kernel space and some run in user-space. All servers are kept separate and run in different address spaces.The communication in microkernels is done via message passing. The servers communicate through IPC (Interprocess Communication). Servers invoke "services" from each other by sending messages. The separation has advantage that if one server fails other server can still work efficiently. The example of microkernel based OS are Mac OS X and Windows NT.


Differences--


1 ) Monolithic kernel is much older than Microkernel. It’s used in Unix . While Idea of microkernel appeared at the end of the 1980's.
2 ) the example of os having the Monolithic kernels are UNIX , LINUX .While the os having Microkernel are QNX , L4 , HURD , initially Mach (not mac os x) later it will converted into hybrid kernel , even MINIXis not pure kernel because device driver are compiled as part of the kernel .
3 ) Monolithic kernel are faster than microkernel . While The first microkernel Mach is 50% slower than Monolithic kernel while later version like L4 only 2% or 4% slower than the Monolithic kernel .
4 ) Monolithic kernel generally are bulky . While Pure monolithic kernel has to be small in size even fit in s into processor first level cache (first generation microkernel).
5In the Monolithic kernel device driver reside in the kernel space . While In the Microkernel device driver reside in the user space.
6 ) Since the device driver reside in the kernel space it make monolithic kernel less secure than microkernel . (Failure in the driver may lead to crash) While Microkernels are more secure than the monolithic kernel hence used in some military devices.
7 ) Monolithic kernels use signals and sockets to ensure IPC while microkernel approach uses message queues . 1 gen of microkernel poorly implemented IPC so were slow on context switches.
8 ) Adding new feature to a monolithic system means recompiling the whole kernel While You can add new feature or patches without recompiling.


1 comment: