Hey guys and welcome back to another skill in the L pick 2 course.
So what we're going to be focusing on in this skill right here is around the kernel.
So let's begin by discussing what the kernel actually is then shall we?
Now the first thing to note about the kernel is that it is a modular construct,
i.e. it is not one large entity that does absolutely everything.
Instead you can much more accurately conceptualize it as a core program and this core program
can actually be extended to do additional things via the use of modules.
Hence why it is referred to as modular. These modules can ultimately expand the kernel's
capabilities. Now the concept of modules is certainly something we will talk about within
this skill. We'll learn how we can actually load modules as well as remove particular modules we
do not need as well as listing the modules we do actually have operational. So what exactly
are the types of tasks that the kernel will handle then? Well it is involved in some very
important tasks, things such as managing hard drives for your storage or perhaps maybe your
network card for network connectivity as well as dealing with USB devices and other removable
storage. So let's take the example of a USB stick. When you plug that USB into the system,
of course you want that USB to be operational. Now in order for this to happen, the kernel is going
to load particular modules relating to the USB and if you happen to remove the USB, well the kernel
no longer needs those modules so those modules will subsequently be removed. Of course the
alternative to this would be you could have a very large and bloated kernel which would ultimately
have all possible modules loaded all of the time but clearly this is inefficient so this is not how
we can expect the modern kernel to operate. Instead we're going to be using that modular process by
loading modules as they are needed and removing them as they are no longer needed. Now one thing I
want to talk to you about first is related to the kernel versioning number. So back in the olden
days the way this was actually numbered would be something like this okay so it would be one, four,
maybe three and twelve. This is how you could expect to see your kernel version. Now this might
just seem like a random spattering of numbers but there actually was a very particular format going
on here so let me show you what this is just draw these out once again. So the very first number would
actually denote the version number itself so this would be version one of the kernel. The second
number would be denoted as the major revision. The third number would denote releases where we had
a minor revision to the kernel and the last number right here this would be for patch management i.e
if we had some type of security patch that we had to fix we could ultimately update the kernel
with the latest patch and we would denote that in this part right here. So we have the version,
the major revision, the minor revision as well as the patch number. Now eventually we worked up to
kernel 2.6 and then we had some minor releases after that like you say 2.6, 1, 2.6, 2 you get the
drift. Now before we actually reached version 2.6 there was some information baked into the numbering
with respect to odd numbers and even numbers what exactly am I talking about? Well if we had a
version before version 2.6 such as maybe 1, 5, 4 perhaps this number right here i.e the second
number which would be the major revision if that number happened to be an odd number which is right
here 5 is an odd number this would let you know that this was a development release i.e this was
not fully tested it may not be stable you can install it to get the latest features available
but be aware that it may actually cause your system problems and may not be quite as reliable.
Now when this was sufficiently tested and became stable we could then have something like say 1,
6, 4, 6 would be an even number and because we saw an even number in the major revision we would
know this was a stable release so we should not expect any type of wonky features or major bugs
so at a glance if i happen to show you 1, 2, 1 you would know that 2 is an even number therefore
this would be a stable release whereas if i happen to show you something like say 1, 7, 4, 7 happens
to be an odd number this would be a development release now like i say this continued on all the
way until we hit 2.6 now version 2.6 was a kind of a milestone for the linux kernel it was very
very successful and it happened to be used for a very very long time and it was actually from this
point that the numbering system happened to change so what exactly were the major changes well now
we would have the version which would be 2 it would be number 6 and instead the last number would
be the revision number and every release here would be a stable release so instead the format would
be you would see 2, 6, 1 and then 2, 6, 2 then 3 then 4 then 5 on and on and on and on all the way up
to 2.6.39 with every single release being stable but as you can imagine this was eventually and
gradually becoming out of hand and the maintainers of the kernel thought you know what we can't actually
just keep claiming higher and higher what are we going to do end up with version 283 or maybe 2831
you can't get the drift so it was decided that the numbering had to be updated yet again so now
we flash forward and we actually get to version 3 and we have a similar format to what we saw before
let's say 3.0.x this is the version once again this would be the major revision and the x would
denote any kind of minor revisions and patches so if we happen to have some type of stability patch
that had to be pushed out it would be denoted as this last number right here once again though
crucially is that all releases were aimed to be stable there were no more attempts to push out
development branches that practice instead was ultimately deprecated so if you happen to see a
version i don't know maybe 3 4 2 it's version 3 major revision 4 and we have our second minor
revision or stability patch and this has continued on since so in 2005 we actually had the release of
version 4 again following the same format version the major release or major revision should i say
and the patch and then in 2019 we then had our first version of version 5 again following the
same format version major release and our patches so when you happen to be looking at these kernel
images you can expect to see this particular format like i say in the older versions you may see
four numbers before version 2.6 you may be able to infer a development release as opposed to a
stable release depending on if we are using odd numbers or even numbers and then since version
3 we are following this simple format so if i go to my terminal and i happen to type the command
uname-r this is going to show me my kernel number so we can see here i'm using version 5 it is major
revision 13 and the minor release or the patch is 028 generic and if i happen to go into my boot
directory so forward slash boot and i do an ls in fact let me long list this to make it a little
bit more readable you will notice is that the initrd image has a sim link which corresponds to that
actual kernel number you see that here 5 13 028 generic that is exactly the kernel which i am
using now the initrd we actually discussed this in lpik 1 ultimately it's like a very very small
kernel that allows you to access the hard disk where the main kernel actually resides now what
i also want to show you briefly is if we go into the lib folder and then the modules folder i do an
ls you're actually going to see here a directory for each kernel we have on the system so i have
this one right here 5 13 028 which is what i'm using but i also have 5 11 0 27 so if i happen to go
in to 5 13 and do an ls these are all the modules and dependencies needed for the operation of my
particular kernel that i'm using see that the name here corresponds to the folder here and within we
have the modules so that is us for our brief introduction to the kernel we still have a lot
of information to get to so i hope this has been informative for you and i'd like to thank you for