What is a Kernel?
There is no better answer to this question than the wikipedia description :
“The kernel is a computer program that is the core of a computer’s operating system, with complete control over everything in the system. It is the first program loaded on start-up. It handles the rest of start-up as well as input/output requests from software, translating them into data-processing instructions for the central processing unit. It handles memory and peripherals like keyboards, monitors, printers, and speakers.
There are different kind of kernels with their own advantages and disadvantages, a lot has been written on this. Please refer to this article to get more info on different types of kernel architectures.
Monolithic Kernel vs Microkernel
- Unix kernels are monolithic
- Each kernel layer integrated into the whole kernel program and runs in Kernel mode
|Each kernel layer integrated into the whole kernel program and runs in kernel mode.
Monolithic kernels are generally faster than microkernels
|Microkernel operating systems demand a very small set of functions from the kernel like Synchronization, Scheduler, IPC
Several system processes that run on top of the microkernel implement other operating system–layer functions, like memory allocators, device drivers, and system call handlers.
Microkernels have lots of advantage over the Monolithic kernels but Monolithic kernels are still fast.
Linux uses microkernel architecture but in practical terms it is monolithic. Linux kernel offers modules. A module is an object file whose code can be linked to the kernel at runtime on demand. The important point to note here is that the loaded module doesn’t run as a different process. It is executed in Kernel mode on the behalf of the kernel process itself. It is no different from the statically linked kernel functions. This way linux code can be modularized and also performance is also not affected.
I am looking forward to write more about Linux Kernel to explain difference between User Mode and Kernel Mode.