CS Electrical And Electronics
@cselectricalandelectronics
All PostsOperating SystemProgrammingWhat Is

What Is Kernel, Why It Is Needed, Purpose Of Kernel, Types

Hello guys, welcome back to my blog. In this article, I will discuss what is Kernel, why it is needed, the purpose of the ker_nel, the types of the kernel, and its advantages, disadvantages.

If you have any doubts related to electrical, electronics, and computer science, then ask questions. You can also catch me on Instagram – CS Electrical & Electronics And Chetan Shidling. 

Also, read:

What Is Kernel

A kernel is computer software that runs at the heart of a computer’s operating system and controls everything in it. It’s the part of the operating system code that’s always in memory and helps hardware and software interact. A full ker_nel uses device drivers to handle all hardware resources (such as I/O, memory, and cryptography), arbitrates resource disputes between processes, and optimizes the use of shared resources such as CPU and cache consumption, file systems, and network sockets.

The kernel is one of the first programs to load on most computers when they power up (after the bootloader). It takes care of the rest of the startup process, as well as memory, peripherals, and software requests for input/output (I/O), converting them into data-processing instructions for the central processor unit.

Is Linux an operating system or a kernel?

Well, guys, there is a difference between the kernel and the operating system. Kernel as defined above is the heart of OS which organizes the core features of an operating system while if some practical applications and utilities are added over the kernel, then the whole package becomes an operating system. So, it can readily be said that an operating system or OS consists of ker_nel space and userspace. So, we can express that Linux is a kernel as it does not contain applications like filesystem utilities, system administrator commands, text editors, windowing systems, graphical desktops, compilers, etc. So, different companies add this type of application over Linux ker_nel and supply their operating system like ubuntu, RedHat, suse, centOS, etc.

Purpose of kernel

Purpose of kernel

The kernel’s crucial code is frequently loaded into a separate section of memory that is protected from application software and other less important elements of the operating system. In this protected kernel area, the kernel conducts activities such as operating programs, controlling hardware devices such as the hard disc, and handling interrupts.

Browsers, word processors, and audio and video players, on the other hand, use a different memory area called user space. This separation prevents user data and kernel data from interacting and creating instability and slowness, as well as malfunctioning applications from influencing other apps or crashing the entire operating system.

The execution of programs is the responsibility of this essential component of a computer system. The ker_nel is in charge of choosing which of the numerous running applications should be assigned to the processor or processors at any one time.

It determines which processes should be assigned to the CPU and which should be kept in the main memory for execution. It serves as a link between user software and hardware. The kernel’s primary goal is to manage communication between software, such as user-level applications, and hardware, such as the CPU and disc memory.

Main goals of Kernel:

  • To communicate between the user’s application and the hardware.
  • To determine the current condition of incoming processes.
  • To keep track of disc usage.
  • To be able to handle memory.
  • To maintain task management control.

Types of Kernel:

01. Monolithic Kernel –

It’s a kernel type in which all operating system services run in kernel space. There are interdependencies between the components of the system. It has a large number of lines of code that is difficult to understand. Before in this type of kernel architecture, all the basic system benefits like process and memory administration, interrupt handling, etc existed packaged into a single module in ker_nel space.

This kind of architecture showed some severe drawbacks like 1) the size of the kernel, which was massive. 2) Poor maintainability, which indicates bug fixing or the addition of new components resulted in recompilation of the entire ker_nel which could consume hours. In a modern-day method to monolithic architecture, the kernel consists of various modules which can be dynamically unloaded and loaded.

This modular method permits easy extension of OS’s capabilities. With this method, the maintainability of the kernel became very comfortable as only the concerned module ought to be loaded and unloaded every moment there is a change or bug fix in a respective module. So, there is no requirement to bring down and recompile the entire kernel for the smallest bit of change. Again, stripping of the ker_nel for different platforms (say for embedded devices, etc) evolved very easily as we can efficiently unload the module that we do not want. Linux pursues the monolithic modular method.

Example: Unix, Linux, Open VMS, XTS-400, etc.

Advantage:

  • It performs admirably

Disadvantage:

  • It has millions of dependencies between system components and lines of code.

02. MicroKernel –

Kernel kinds are those that take a minimalist approach. It has thread scheduling and virtual memory. With fewer services in kernel space, it is more stable. It places to rest in the hands of the user. This architecture majorly caters to the situation of the ever-growing size of kernel code which we could not control in the monolithic method.

This architecture permits some basic benefits like device driver management, protocol stack, file system, etc to handle in userspace. This lowers the kernel code size and also improves the security and stability of OS as we have the basic minimum code running in the kernel. So, if consider a basic service like network service crashes due to buffer overflow, then just the networking service’s memory would be corrupted, leaving the rest of the system still functional.

Example: Mach, L4, AmigaOS, Minix, K42 etc.

Advantage:

  • It’s more dependable.

Disadvantage:

  • There are several context changes and system calls.

03. Hybrid_Kernel –

It’s a hybrid of the monolithic and microkernel kernels. It combines the monolithic kernel’s performance and design with the modularity and stability of a microkernel.

Example: Windows NT, Netware, BeOS, etc.

Advantage:

  • It blends monolithic and microkernel kernels.

Disadvantage:

  • It still looks like a monolithic kernel.

04. Exo_Kernel –

It’s a kernel that follows the end-to-end principle. It uses the fewest possible hardware abstractions. It assigns physical resources to different applications.

Example: Nemesis, EXOS, etc.

Advantage:

  • It has the least amount of hardware abstractions.

Disadvantage:

  • For application developers, there is additional work.

05. Nano Kernel –

It’s a kernel that provides hardware abstraction but doesn’t provide system services. Because the MicroKernel lacks system services, the MicroKernel and Nano Ker_nel have become interchangeable.

Example: EROS

Advantage:

  • It provides hardware abstractions in the absence of system services.

Disadvantage:

  • It’s very similar to Microkernel, which is why it’s less popular.

To summarise, when an operating system is loaded, Kernel is loaded first and remains in memory until the operating system is shut down. It’s in charge of things like disc management, task management, and memory management.

I hope this article may help you all a lot. Thank you for reading.

Also, read:

Author Profile

CS Electrical And ElectronicsChetu
Interest's ~ Engineering | Entrepreneurship | Politics | History | Travelling | Content Writing | Technology | Cooking
Share Now

CS Electrical And Electronics

Interest's ~ Engineering | Entrepreneurship | Politics | History | Travelling | Content Writing | Technology | Cooking