1
00:00:00,000 --> 00:00:17,280
Hey guys and welcome back to another skill in the L pick 2 course.

2
00:00:17,280 --> 00:00:22,480
So what we're going to be focusing on in this skill right here is around the kernel.

3
00:00:22,480 --> 00:00:27,719
So let's begin by discussing what the kernel actually is then shall we?

4
00:00:27,719 --> 00:00:32,920
Now the first thing to note about the kernel is that it is a modular construct,

5
00:00:32,920 --> 00:00:39,079
i.e. it is not one large entity that does absolutely everything.

6
00:00:39,079 --> 00:00:46,280
Instead you can much more accurately conceptualize it as a core program and this core program

7
00:00:46,280 --> 00:00:52,120
can actually be extended to do additional things via the use of modules.

8
00:00:52,199 --> 00:00:58,839
Hence why it is referred to as modular. These modules can ultimately expand the kernel's

9
00:00:58,839 --> 00:01:04,120
capabilities. Now the concept of modules is certainly something we will talk about within

10
00:01:04,120 --> 00:01:10,359
this skill. We'll learn how we can actually load modules as well as remove particular modules we

11
00:01:10,359 --> 00:01:16,840
do not need as well as listing the modules we do actually have operational. So what exactly

12
00:01:16,840 --> 00:01:23,000
are the types of tasks that the kernel will handle then? Well it is involved in some very

13
00:01:23,000 --> 00:01:29,079
important tasks, things such as managing hard drives for your storage or perhaps maybe your

14
00:01:29,079 --> 00:01:37,240
network card for network connectivity as well as dealing with USB devices and other removable

15
00:01:37,240 --> 00:01:44,280
storage. So let's take the example of a USB stick. When you plug that USB into the system,

16
00:01:44,280 --> 00:01:50,920
of course you want that USB to be operational. Now in order for this to happen, the kernel is going

17
00:01:50,920 --> 00:01:59,879
to load particular modules relating to the USB and if you happen to remove the USB, well the kernel

18
00:01:59,879 --> 00:02:05,240
no longer needs those modules so those modules will subsequently be removed. Of course the

19
00:02:05,240 --> 00:02:11,319
alternative to this would be you could have a very large and bloated kernel which would ultimately

20
00:02:11,319 --> 00:02:17,560
have all possible modules loaded all of the time but clearly this is inefficient so this is not how

21
00:02:17,560 --> 00:02:23,719
we can expect the modern kernel to operate. Instead we're going to be using that modular process by

22
00:02:23,719 --> 00:02:29,560
loading modules as they are needed and removing them as they are no longer needed. Now one thing I

23
00:02:29,560 --> 00:02:36,519
want to talk to you about first is related to the kernel versioning number. So back in the olden

24
00:02:36,520 --> 00:02:42,520
days the way this was actually numbered would be something like this okay so it would be one, four,

25
00:02:42,520 --> 00:02:49,000
maybe three and twelve. This is how you could expect to see your kernel version. Now this might

26
00:02:49,000 --> 00:02:55,960
just seem like a random spattering of numbers but there actually was a very particular format going

27
00:02:55,960 --> 00:03:01,160
on here so let me show you what this is just draw these out once again. So the very first number would

28
00:03:01,159 --> 00:03:07,319
actually denote the version number itself so this would be version one of the kernel. The second

29
00:03:07,319 --> 00:03:15,240
number would be denoted as the major revision. The third number would denote releases where we had

30
00:03:15,240 --> 00:03:22,359
a minor revision to the kernel and the last number right here this would be for patch management i.e

31
00:03:22,359 --> 00:03:28,439
if we had some type of security patch that we had to fix we could ultimately update the kernel

32
00:03:28,439 --> 00:03:33,639
with the latest patch and we would denote that in this part right here. So we have the version,

33
00:03:34,199 --> 00:03:40,840
the major revision, the minor revision as well as the patch number. Now eventually we worked up to

34
00:03:40,840 --> 00:03:49,719
kernel 2.6 and then we had some minor releases after that like you say 2.6, 1, 2.6, 2 you get the

35
00:03:49,719 --> 00:03:57,560
drift. Now before we actually reached version 2.6 there was some information baked into the numbering

36
00:03:57,560 --> 00:04:04,039
with respect to odd numbers and even numbers what exactly am I talking about? Well if we had a

37
00:04:04,039 --> 00:04:12,439
version before version 2.6 such as maybe 1, 5, 4 perhaps this number right here i.e the second

38
00:04:12,439 --> 00:04:19,000
number which would be the major revision if that number happened to be an odd number which is right

39
00:04:19,000 --> 00:04:26,680
here 5 is an odd number this would let you know that this was a development release i.e this was

40
00:04:26,680 --> 00:04:32,120
not fully tested it may not be stable you can install it to get the latest features available

41
00:04:32,120 --> 00:04:38,519
but be aware that it may actually cause your system problems and may not be quite as reliable.

42
00:04:38,519 --> 00:04:44,680
Now when this was sufficiently tested and became stable we could then have something like say 1,

43
00:04:44,680 --> 00:04:52,120
6, 4, 6 would be an even number and because we saw an even number in the major revision we would

44
00:04:52,120 --> 00:04:59,240
know this was a stable release so we should not expect any type of wonky features or major bugs

45
00:04:59,240 --> 00:05:05,480
so at a glance if i happen to show you 1, 2, 1 you would know that 2 is an even number therefore

46
00:05:05,480 --> 00:05:12,199
this would be a stable release whereas if i happen to show you something like say 1, 7, 4, 7 happens

47
00:05:12,199 --> 00:05:18,680
to be an odd number this would be a development release now like i say this continued on all the

48
00:05:18,680 --> 00:05:26,600
way until we hit 2.6 now version 2.6 was a kind of a milestone for the linux kernel it was very

49
00:05:26,600 --> 00:05:33,160
very successful and it happened to be used for a very very long time and it was actually from this

50
00:05:33,160 --> 00:05:40,360
point that the numbering system happened to change so what exactly were the major changes well now

51
00:05:40,360 --> 00:05:46,759
we would have the version which would be 2 it would be number 6 and instead the last number would

52
00:05:46,759 --> 00:05:54,519
be the revision number and every release here would be a stable release so instead the format would

53
00:05:54,519 --> 00:06:05,480
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

54
00:06:05,480 --> 00:06:14,920
to 2.6.39 with every single release being stable but as you can imagine this was eventually and

55
00:06:14,920 --> 00:06:20,680
gradually becoming out of hand and the maintainers of the kernel thought you know what we can't actually

56
00:06:20,680 --> 00:06:29,160
just keep claiming higher and higher what are we going to do end up with version 283 or maybe 2831

57
00:06:29,160 --> 00:06:35,720
you can't get the drift so it was decided that the numbering had to be updated yet again so now

58
00:06:35,720 --> 00:06:43,160
we flash forward and we actually get to version 3 and we have a similar format to what we saw before

59
00:06:43,160 --> 00:06:52,840
let's say 3.0.x this is the version once again this would be the major revision and the x would

60
00:06:52,840 --> 00:06:58,520
denote any kind of minor revisions and patches so if we happen to have some type of stability patch

61
00:06:58,520 --> 00:07:04,520
that had to be pushed out it would be denoted as this last number right here once again though

62
00:07:04,520 --> 00:07:11,240
crucially is that all releases were aimed to be stable there were no more attempts to push out

63
00:07:11,240 --> 00:07:17,160
development branches that practice instead was ultimately deprecated so if you happen to see a

64
00:07:17,160 --> 00:07:26,439
version i don't know maybe 3 4 2 it's version 3 major revision 4 and we have our second minor

65
00:07:26,439 --> 00:07:35,400
revision or stability patch and this has continued on since so in 2005 we actually had the release of

66
00:07:35,479 --> 00:07:42,599
version 4 again following the same format version the major release or major revision should i say

67
00:07:42,599 --> 00:07:52,759
and the patch and then in 2019 we then had our first version of version 5 again following the

68
00:07:52,759 --> 00:07:59,560
same format version major release and our patches so when you happen to be looking at these kernel

69
00:07:59,560 --> 00:08:06,360
images you can expect to see this particular format like i say in the older versions you may see

70
00:08:06,360 --> 00:08:12,840
four numbers before version 2.6 you may be able to infer a development release as opposed to a

71
00:08:12,840 --> 00:08:19,560
stable release depending on if we are using odd numbers or even numbers and then since version

72
00:08:19,560 --> 00:08:26,199
3 we are following this simple format so if i go to my terminal and i happen to type the command

73
00:08:26,199 --> 00:08:34,039
uname-r this is going to show me my kernel number so we can see here i'm using version 5 it is major

74
00:08:34,039 --> 00:08:43,000
revision 13 and the minor release or the patch is 028 generic and if i happen to go into my boot

75
00:08:43,000 --> 00:08:49,240
directory so forward slash boot and i do an ls in fact let me long list this to make it a little

76
00:08:49,240 --> 00:08:57,399
bit more readable you will notice is that the initrd image has a sim link which corresponds to that

77
00:08:57,399 --> 00:09:04,120
actual kernel number you see that here 5 13 028 generic that is exactly the kernel which i am

78
00:09:04,120 --> 00:09:10,680
using now the initrd we actually discussed this in lpik 1 ultimately it's like a very very small

79
00:09:10,680 --> 00:09:17,000
kernel that allows you to access the hard disk where the main kernel actually resides now what

80
00:09:17,000 --> 00:09:22,919
i also want to show you briefly is if we go into the lib folder and then the modules folder i do an

81
00:09:22,919 --> 00:09:29,320
ls you're actually going to see here a directory for each kernel we have on the system so i have

82
00:09:29,320 --> 00:09:39,080
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

83
00:09:39,080 --> 00:09:47,800
in to 5 13 and do an ls these are all the modules and dependencies needed for the operation of my

84
00:09:47,800 --> 00:09:54,759
particular kernel that i'm using see that the name here corresponds to the folder here and within we

85
00:09:54,759 --> 00:09:59,879
have the modules so that is us for our brief introduction to the kernel we still have a lot

86
00:09:59,879 --> 00:10:04,759
of information to get to so i hope this has been informative for you and i'd like to thank you for

