vip

Kernel | What is it | How it works | 2021 | Official AppValley

Here we will talk about the kernel and guide you through all of the things about the kernel. A kernel is an application that provides you interface between hardware and the operating system.

Kernel Definition

This very popular definition is absolutely correct but now we’re gonna change this a little bit so whenever the next time when somebody asks you what is a kernel, just keep this definition in mind that kernel is just a program nothing more than that.

Yes, the definition is technically correct in that it provides an interface but it has a lot more job than just providing the interface between the hardware and the software or the operating system.

So next time when I will talk about the kernel, we’re gonna say that kernel is nothing more than just a program.

Although when Isay nothing more than a lot of people might get offended because it’s a very popular kind of biggest open source project that anybody has seen so far.

Kernel-Infographic
Kernel Infographic

So to understand more, we’re gonna visit a couple of links and we are gonna talk about that in a minute.

First and foremost, GitHub repo by ELF Linux, here you can see all the source code and everything about the kernel itself.

The entire thing which loads up into your memory is actually available there but this is not a good place to just dive deep into that.

In fact, there is a documentation folder but I would like to point you to a great resource that will help you to understand the kernel in a little bit more manner.

Kernel.Org

This is the official website kernel.org.

Visit that website and there you’re gonna find out a lot more about the kernel.

You can learn about the kernel release, what is the latest version of the kernel that is available right now, and apart from there, a whole lot of things are explained up there like, where it can be used? How it is being used?

Whenever somebody says that Linux is present in your modem, in your IoT devices, in your LEDs, this is what they are talking about.

They are not talking about the kernel like Ubuntu or Ark, they are not talking about that.

They are talking about the code foundation or the Linux which is the kernel itself.

This kernel is further being modified and being used on to its use case scenario for example.

Whatever you want to do it’s available there, in fact, if you want to do some customization into the CPU load or EFI boot stub whatever you want to do, it’s available there including memory management, security module usage, Thunderbolt.

It looks like a gigantic and anybody who looks at the documentation says that kernel might be a really big program or a big file but don’t worry we are gonna show you where a kernel is and what’s its actual sizes.

Linux-Kernel
Linux Kernel

So, the fundamental job of a kernel is providing an interface so whenever I say it provides your programming interface means it provides you an API that can help you to connect with all the hardware.

If you just scroll a little bit you’re gonna see the kernel API.

That API is responsible for providing all the drivers as well as interaction with the hardware and there we go.

You can also see that the driver model is the basics of the drivers and how this is going on for the industrial i/o sound devices and all of these things.

Now before you click on that sound devices, I’m gonna point out one more thing here.

A lot of time you might have seen that Linux is totally written in C and it’s technically correct but not 100%.

When you click on the devices up there you can see how the module is structured.

You will notice that the C language is being used in the kernel.

It’s not a purely C.

It’s a hybrid mixture of the assembly language as well as C programming.

So yes it is being used but it’s not in the purest form, it’s a little bit different than that.

Okay, quite a lot of stuff is said unto this kernel, now let’s move on to the actual definition and talk about what is kernel.

A kernel is just a program that bootloaders load into your memory which performs a variety of tasks and nothing more than that.

One of that tasks is providing an application interface to interact with the hardware and interact with the drivers but there are a lot more things that our kernel does.

Kernel Functions

I have categorized six of them. Definitely, there are more of them.

System Calls

The first one is providing all the system calls.

VFS Handling

The second one is handling the VFS which is the virtual file system. So in case you are aware of the things like PROC and all of the processes running into your system, the kernel actually handles that as well.

Don’t worry if you don’t know that, we are gonna talk about that later on.

Another thing is device files, a lot of time some devices are plugged into your system may be your keyboard, your mouse so these device files actually first interact with the Linux kernel.

Then it allows us that what functionality should we provide there, what driver should we load up.

Kernel-Functions
Kernel Functions

Apart from that, the kernel also handles the privileges. The core foundation of Linux is handling a variety of privileges.

You are not directly allowed to install any program whatever you wish to, sometimes you need extended privileges like root user, which is all managed by the kernel itself that what are you allowed to see, what you are not allowed to see.

We are gonna discuss that once we move on to the system itself.

One important thing about the kernel is, it’s very modular means that the actual size of the kernel, the main file which is loaded up by your bootloader, is very small.

Bootloader

Just to give you a sidebar here, bootloaders are a variety of types it’s not just about the grub that is the bootloader. There are a variety of others as well.

Grub is there, lilo is there, a lot of new Linux loaders are coming up based on the hardware that you’re using.

So it’s highly dependent on that.

It’s not about that you’re using the latest laptop and it is using some of these latest techs so that is gonna be the only bootloader, some of them are popular, some of them are not.

Like for example, I’m pretty sure most of you are not aware of the lilo kind of bootloaders so yeah that makes sense.

As I was saying the Linux itself is a bootloader.

The kernel is very modular. The main file which is being loaded in the memory is very small and then it calls onto a variety of things – drivers and interface which it requires on the go.

Application Interface

Apart from that the last but not least it provides you an application interface to talk with your hardware, which is also definitely the job of a kernel.

Now let’s go ahead and talk about the kernel itself. Just open up a terminal, it doesn’t matter what operating system you are using, you can use Ubuntu for this.

File size

File-Size
File Size

When your screen is all set and all zoomed up now you can go into a directory.

Type CD space and then provide a slash and then write a boot.

The boot directory contains most of the booting information.

You can do a quick LS there and you can see that you have a couple of grub files there.

Pretty easily visible and at the very end of it you gonna have that VM Li and users and then some big gigantic number there.

This big gigantic number and the green file there is actually your bootloader.

So the next question comes up is what is the size of this file?

Obviously, you might be curious about that so just simply do LS dash L space -and it gives you a whole lot of information.

Your screen will just be filled up. You don’t need to worry about that. The only thing you should look at is that big number.

So it’s a file which is just of 6 MBs or something like that a little bit gives or take.

This clearly proves that it’s not at all a really big file.

The number is pretty gigantic but around 6 or 7 MB this file sizes. This proves the point that yes it’s not a gigantic file. The kernel is pretty small but very modular.

One important thing, please do not delete this file. If you’re going to delete this file, the current session which you’re running on the system is gonna be absolutely fine but when you’re gonna restart your system, it’s gonna face a crash.

Uname Linux Command

Command-Line
Command Line

So there we go now another interesting stuff that we can do is we can use a command that says “uname”.

We can provide a variety of options with that like for example I can provide the option of hyphen R and it gives me the exact version of the kernel that is being currently used.

You might have seen this version while booting up the OS as well.

Apart from that, we can also get more information by providing the option of “uname – a”.

It gives you a whole lot of information about the time and date and Linux version.

A whole lot of stuff but the big question that arises here is that how I was able to figure out that “uname – R” gives this one and “uname – a” gives this one?

So to understand that we need to first discuss that how we can find more information about these commands.

What is the default structure of this command and a whole bunch of other things?

You can learn more about iOS app installers and get the latest AppValley app here.

You may also want to learn about the iOS 14 Customization here.

So that’s it for this post. I hope you have enjoyed this one as well. I’m pretty sure you’re gonna love it.

Related Articles

Leave a Reply

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

Back to top button