What is Kernel in Operating System?

The operating system is the most important program that runs on a computer. Where kernel is the central module of an operating system. It is the heart of OS which manages the core features of an OS. Using interprocess communication and system calls, it acts as a bridge between applications and the data processing performed at the hardware level.

The sole aim of the kernel is to manage the communication between the software and the hardware like CPU, disk memory etc. The kernel is responsible for low-level tasks like -
  • Device management
  • Process management
  • Memory management
  • Interrupt handling
  • I/O communication
When an operating system is loaded into memory, the kernel loads first and remains in memory until the operating system is shut down again. Because it stays in memory, it is important for the kernel to be as small as possible while still providing all the essential services required by other parts of the operating system and applications.

The the kernel code is usually loaded into a protected area of memory to prevent it from being overwritten by programs or other parts of the operating system. This separation prevents user data and kernel data from interfering with each other and causing instability and slowness.

Every operating system has a kernel. For example the Linux kernel is used numerous operating systems including Linux, FreeBSD, Android and others. But there are five types of kernels -
  1. Monolithic Kernels - All operating system services run along the main kernel thread in a monolithic kernel, which also resides in the same memory area, thereby providing powerful and rich hardware access.
  2. Microkernels - Define a simple abstraction over hardware that use primitives or system calls to implement minimum OS services such as multitasking, memory management and interprocess communication.
  3. Nano Kernels - Simplify the memory requirement by delegating services, including the basic ones like interrupt controllers or timers to device drivers
  4. Hybrid Kernels - Run a few services in the kernel space to reduce the performance overhead of traditional microkernels where the kernel code is still run as a server in the user space.
  5. Exo Kernels - Allocate physical hardware resources such as processor time and disk block to other programs, which can link to library operating systems that use the kernel to simulate operating system abstractions.