With over 13 million lines of code, the Linux kernel is one of the largest open source projects in the world, but what is a kernel and what is it used for?

So What is the Kernel?

A kernel is the lowest level of easily replaceable software that interfaces with the hardware in your computer. It is responsible for interfacing all of your applications that are running in “user mode” down to the physical hardware, and allowing processes, known as servers, to get information from each other using inter-process communication (IPC).

Linux kernel is a free, open-source, monolithic, modular, Unix-like operating system kernel. It is the main component of the Linux operating system (OS) and is the core interface between the computer’s hardware and its processes.

The kernel is a computer program at the core of an operating system (OS). It is the part of the OS that loads first and remains in the main memory. The kernel connects the system hardware to the application software.

The Linux kernel is used by Linux distributions alongside GNU tools and libraries. This combination is sometimes referred to as GNU/Linux. Popular Linux distributions include Ubuntu, Fedora, and Arch Linux.

Different Types of Kernels

There are, of course, different ways to build a kernel and architectural considerations when building one from scratch. In general, most kernels fall into one of three types: monolithic, microkernel, and hybrid. Linux is a monolithic kernel while OS X (XNU) and Windows 7 use hybrid kernels. Let’s take a quick tour of the three categories so we can go into more detail later.

Microkernel
A microkernel takes the approach of only managing what it has to: CPU, memory, and IPC. Pretty much everything else in a computer can be seen as an accessory and can be handled in user mode. Microkernels have a advantage of portability because they don’t have to worry if you change your video card or even your operating system so long as the operating system still tries to access the hardware in the same way. Microkernels also have a very small footprint, for both memory and install space, and they tend to be more secure because only specific processes run in user mode which doesn’t have the high permissions as supervisor mode.

Pros

  • Portability
  • Small install footprint
  • Small memory footprint
  • Security

Cons

  • Hardware is more abstracted through drivers
  • Hardware may react slower because drivers are in user mode
  • Processes have to wait in a queue to get information
  • Processes can’t get access to other processes without waiting

Monolithic Kernel
Monolithic kernels are the opposite of microkernels because they encompass not only the CPU, memory, and IPC, but they also include things like device drivers, file system management, and system server calls. Monolithic kernels tend to be better at accessing hardware and multitasking because if a program needs to get information from memory or another process running it has a more direct line to access it and doesn’t have to wait in a queue to get things done. This however can cause problems because the more things that run in supervisor mode, the more things that can bring down your system if one doesn’t behave properly.

Pros

  • More direct access to hardware for programs
  • Easier for processes to communicate between eachother
  • If your device is supported, it should work with no additional installations
  • Processes react faster because there isn’t a queue for processor time

Cons

  • Large install footprint
  • Large memory footprint
  • Less secure because everything runs in supervisor mode

Leave a Reply

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