Kernel in Operating System

FREE Online Courses: Click for Success, Learn for Free - Start Now!

The core component of the OS is known as a kernel. Kernel helps the OS manage the operations of the computer system and hardware, basically the memory and CPU time. It uses inter-process communication and system calls to act as a bridge between applications and data processing performed at hardware level.

It is the first program to load after the bootloader as it needs to handle the rest of the system for the OS. When an OS loads, the Kernel also loads into the memory and remains there until the OS is shut down again.

It handles disk management, task management, and memory management and decides which process to allocate to the CPU for execution. It also manages communication between the software and hardware

Functions of a Kernel

Following are the functions of Kernel:

1. Access Computer resource: A Kernel can access the CPU, I/O devices and other resources and acts as a interpreter between the user and the system resources.

2. Resource Management: A Kernel shares resources between processes such that every process has uniform access to the resources.

3. Memory Management: The kernel allocates and deallocates memory for process execution.

4. Device Management: Kernel manages the allocation of peripheral devices.

Kernel Mode and User Mode

Some instructions can only be executed by Kernel and in the Kernel Mode. As for the User Mode, the processes provided by the user are executed by the processor in the User Space.

Objectives of Kernel in OS

  • Establishes communication between software and hardware.
  • Decides the state of incoming processes.
  • Disk management.
  • Memory management.
  • Task management.

Types of Kernel

Following are the five types of kernel:

1. Monolithic Kernel:

In this, all OS services operate in the kernel space i.e., user services and kernel services are implemented in the same memory space. This increases the size of Kernel and OS makes the execution of a process faster. There are dependencies between system components. It has huge lines of code that make it complex.

Advantages of Monolithic kernel:

  • Good performance.
  • Provides CPU scheduling, memory scheduling, and file management only through System calls.

Disadvantages of Monolithic Kernel:

  • Dependencies between system components and lines of code are in millions.
  • Failure of a service leads to the failure of the entire system.
  • The OS needs to be modified if there is addition of a new service.

Monolithic Kernel

2. Micro Kernel:

This type has a minimalist approach along with virtual memory and thread scheduling. It is stable, has less services in the kernel space and puts rest in user space. This means that it makes use of both the kernel space and user. This reduces the size of the Kernel and OS. Communication is done through message parsing and that reduces the speed of execution.

Advantages of Micro Kernel:

  • More stable.
  • New services can be easily added.

Disadvantages of Micro Kernel:

  • Huge amounts of system calls and context switches.
  • Communication reduces overall execution time.

Micro Kernel

3. Hybrid Kernel:

With the speed and design of a monolithic kernel and the modularity and stability of a microkernel, this type is a combination of monolithic and micro kernel. Some services like network stack and file systems are run in Kernel space in order to reduce performance overhead. Though, it runs kernel code as servers in the user-space.

Advantages of Hybrid kernel:

  • Combination of monolithic and micro kernel.

Disadvantages of Hybrid kernel:

  • Similar to monolithic kernel.

4. Exo Kernel:

This kernel follows an end-to-end principle with least hardware abstractions. It handles the allocation of physical resources to applications. Separation of resource protection from management allows us to perform application-specific customization.

Advantages of Exo Kernel:

  • Least hardware abstractions.

Disadvantages of Exo Kernel:

  • More work for application developers.
  • Has a complex design.

5. Nano Kernel:

This type offers hardware abstraction without system services. Due to micro kernels also not having system services, these two have become analogous to each other. The code of the kernel is very small and the Kernel supports nanosecond clock resolution.

Advantages of nano Kernel:

  • Offers hardware abstractions without system services.

Disadvantages of Nano Kernel:

  • It is used less due to being similar to micro kernels.

Summary

Kernel is the main and central component of an OS. It has five types, namely, monolithic kernel, microkernel, hybrid kernel, nano kernel, and exo kernel. The functions of a kernel include accessing computer resources, memory management, device management, and resource management.

Did we exceed your expectations?
If Yes, share your valuable feedback on Google

follow dataflair on YouTube

1 Response

  1. muzammil says:

    excellent

Leave a Reply

Your email address will not be published. Required fields are marked *