Linux

Linux kernel, discover what the heart of this operating system is like

Normally, when we talk about Linux, we usually do it in relation to distributions such as Ubuntu, Debian, Mint, etc. However, these distributions are not operating systems as such, but rather are “adaptations” of an open source operating system: Linux. And therefore, despite the peculiarities of each one, they all share the same base, what we know as Linux Kernel .

Linux, as its own documentation indicates, was born as a clone of another operating system called Unix. Specifically as an alternative system inspired by Minix (which, in turn, cloned Unix concepts). Due to its properties, Linux is a real operating system, although no one uses it as such, but rather uses distributions since, with them, it becomes much more useful and easy to use.

For this reason, it is not usually said ” I am going to install Linux ” referring to a specific operating system, but rather that what we install are versions, or distributions, of this kernel, created by companies or by the community, that share the same base: the Kernel.

What is the kernel and what is it for

The Linux kernel is the core of the operating system . This is the most important piece of software in any operating system. Windows has its own private kernel, Apple has its own (based on Unix, by the way), and Linux is the kernel used by all distributions. And its main function is to be in charge of controlling the computer hardware.

Specifically, this kernel is responsible for managing system memory and process time, managing all processes, controlling system calls and connections between processes, and allowing all software to have access to hardware, especially connected peripherals. to the computer.

Such is the importance of the Kernel when it comes to controlling hardware that, of its more than 28 million lines of code, most of it is drivers. And this, while good for compatibility, is starting to be a problem for performance.

Under normal conditions, users never interact with it . While users have limited access to hardware, the kernel has full access and control over it. He is responsible for ensuring that everything works well, that it is done safely, and that there are no errors. If a process crashes in user space, Linux continues to work . And you can even try to recover the system by having control over the PC. However, if a kernel space error occurs, then the whole system stops working. It is what we know as the ” Kernel Panic “, the equivalent of the blue screen in Linux.

Versions

It is true that the current versions of the Kernel have nothing to do with the first ones from 1991. However, this kernel is in constant development. And every few weeks we usually see new releases. But not all are equally important, since it depends largely on their numbering.

The versions of the Linux kernel can have 4 numbers indicate the version: abcd

  • a indicates the version. This number is the one that changes the least, since the jump is usually only made when there are extremely large changes in the system. In all its history, it has only changed 5 times, in 2004, for version 1.0, in 2006, for version 2.0, in 2011, for version 3.0, in 2015, for version 4.0, and in 2019 to give rise to the current version, 5.0.
  • b indicates subversion. When new versions are released, but they are really minor updates (new drivers, optimizations, fixes, etc), then instead of changing the version, the subversion number is changed.
  • c indicates the revision level . This number is often changed, for example, when minor changes are made, such as security patches, bug fixes, and so on.
  • d is the last sublevel of the version. It is hardly used, but it is reserved so that, if a version with a very serious bug is released, the new version is released with this sublevel including exclusively the correction of said serious bug.

All versions of the Linux kernel are public and open source. We can find them in this link . But they are not compiled, rather it is the users themselves who have to compile them in order to use them in their distribution. And this is not exactly a simple task. Luckily, the communities responsible for the development of the different distributions usually bring us compiled and optimized versions of the Kernel, which we can install as any patch.

Which version of Linux to choose

When we talk about software, we always recommend having the latest version of everything. This is the best way to ensure that, due to a security breach, our PC is endangered. With the Linux kernel it is the same, it is always recommended to have the latest version. However, you always have to do it carefully.

One of the reasons the kernel is so big is because it doesn’t remove anything. As old as it is. Thanks to this, it is possible to continue using the latest versions of Linux on the first computers where it was launched for the first time in 1991. Each update what it usually does is add drivers and change functions to optimize the general operation of the PC.

But it may happen that a version brings a bug that makes our PC not work properly, and even that the performance is not as expected. In that case, simply reinstalling a previous version should bring the operating system back to normal. Although we will lose support for the newer hardware components.

The best, and easiest for most, is to update the Kernel as we update the distribution from its repositories. Thus we will avoid these problems by “always being up to date”.

How to know what version of the Kernel I have

Putting that we use a common distribution, like, for example, Ubuntu, we can check which version of the kernel we use very easily with a single command. To do this, we just have to open a terminal with the keyboard shortcut “Ctrl + Alt + T” and execute one of these commands:

Join me

We can execute the command «uname -a» to obtain the information of our distro. This command will show us all the information related to our operating system, including the version of the Linux Kernel we use. But if we want to be much more specific, we can focus only on the kernel version we can do it with:

uname -srm

Neofetch

Neofetch is a very simple program used by Linux users that allows us to see in detail the information of our installed system. In order to use it, the first thing we have to do is install this tool by executing the command:

sudo apt install neofetch

And, once installed, run it with “neofetch” to see all the information related to this command.

Hostnamectl

Hostnamectl is a tool that is part of systemd thanks to which we can know the details about our operating system. Among many other functions, we can use it to know the technical information about the kernel we are using. To do this, we just have to execute the following command:

hostnamectl status | grep "Kernel:"

If we want some more information, we can also get it with “hostnamectl status”.

/ proc / version

This is another of the Linux commands designed to allow us to know as much information as possible about our system. As it shows us information of all kinds, we must filter the information that interests us with the command «cat» in the following way:

cat /proc/version

How to update the kernel

The kernel is the most important element of the system, so having it updated to the latest version is vital. With each update, not only are potential security flaws and malfunctions corrected, but drivers are improved to function better and be compatible with the latest hardware. There are several ways to update the core of our system.

Through updates from the distro

The fastest and most recommended way to update the kernel of our Linux is to do it through the system’s own updates. Every time a patch is released, the developers of the main distros review and implement it within the software repositories so that we can update the system with a simple command or from the included updater.

There are two types of updates. On the one hand we have the one offered by Ubuntu, which only gives us minor kernel corrections but never new versions (only with each new version of Ubuntu the Kernel is updated), and then the Rolling Release distros that do allow us to have the Kernel always to the last.

Use software like Ukku or Mainline

An intermediate point between updating the distro and compiling and installing the kernel by hand is to use specialized software for this task, such as Ukku or Mainline. These programs have a database with all kernel versions and allow us to download and install whatever we want without having to worry about anything else. Every time a new version is released we can download and install it (if we want) from this same program.

Update the kernel manually

Updating the kernel by hand is a complicated task reserved for advanced users only. All versions are open source, and are distributed as is from the Kernel website. Therefore, anyone can download the latest version by hand and use the gcc compiler to compile the kernel on their system for use.

In addition, Canonical has its own kernel repository from where we can download the versions already compiled and packaged in a DEB package. So we can install the kernel version we want in Ubuntu by just double clicking, as in any other program.

Is the kernel the operating system?

The kernel is one of the most important parts of the operating system. But it is not the only one necessary to be able to call Linux, today, an operating system as such. As we have explained, this kernel has all the drivers and everything necessary to control the software and allow the user to access it. But, to be really useful, it must have other components on top of it before reaching the user.

  • Demon controller . Whether Init.d, Systemd, or any other similar software, it is necessary to have a subsystem above the kernel that is responsible for starting all the processes (daemons) necessary for the Kernel to start working. Without it we only have many lines of code that will not be executed.
  • Processes . Daemons, daemons, or better known as processes, are all the components that remain loaded in the system memory (controlled by the kernel) and that allow Linux to function. The graphical server, for example, is the daemon that will control the desktop.
  • Graphic server . Known as X, it is in charge of being able to see the graphics on the screen. If we are going to use Linux in text mode, from the terminal, it is not necessary. But if we are going to use it with a desktop, it is necessary to have a working x-server.
  • Desk. As its name suggests, the computer desktop, where we will have all our programs and where the windows will open. There are many desktops for Linux, such as GNOME, KDE, or LXDE. Each one with its own characteristics, advantages and disadvantages.
  • Programs. Everything we run from the desktop. It is already the highest layer, and the point through which we interact with the computer.

When the kernel, and everything else, works in accordance, that is when we can talk about the operating system. Or what is the same, Linux distribution .

Leave a Reply

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

Back to top button