Structure Of The Linux Kernel

Linux is an open-source kernel that powers most of the machines forming the internet. Linux is a lot more powerful and flexible in comparison to other kernels making it the go-to kernel / OS choice

Linux is not an OS – OSes are built on top of Linux kernel, for example, Ubuntu

The Linux kernel provides interfaces to add new functionalities to the existing kernel. This not only makes it modular but also a very lightweight kernel

For example, we can add new file systems to the Linux kernel using the interface or create a host of network protocols and drivers

Components of Linux kernel


Linux kernel can be broken down into 5 major components

  1. Process management
  2. Memory management
  3. Device drivers
  4. File system
  5. Network
Components of Linux kernel | anirudhduggal.com

Process Management

This component of the kernel is responsible for creating and terminating processes and also performing all of the processes-related activities like inter-process communication and software interrupts.

A major component of process management is the scheduler. Scheduler decides when which process gets to run on the processor and for how much time.

Basically, anything related to a process is most probably handled by this component of the kernel.

Memory management

Memory is an important part of any operating system. The behavior and performance of a system depend highly upon the memory allocated to it.

Memory management is responsible for allocating each process its own memory. It also ensures that no process can access the memory allocated to another process.

Device drivers

Drivers are an interface between the hardware and the kernel. They enable the kernel (which is a software component) to access and work on the hardware. We can add or remove drivers to the kernel because of its modular architecture

Network

All the networking operation has to be performed by the kernel. The reason for this is the asynchronous nature of networking.

For example. two different processes sent a request and are waiting for a response. Now if process A is responsible for the networking and the response for process B arrived, it could simply drop the package.

To level the field and make it a fair game, the Linux kernel takes care of all the networking-related activities.

It then collects, identifies, and forwards the packets to respective processes

File system

Everything in Linux is a file. And that is why the file system is one of the central components of the kernel.

Using the Linux file system you can access details about different processes (/proc file system) or about different network drivers.

These files and information can come in handy during debugging.