1
00:00:00,006 --> 00:00:05,002
(lively music)

2
00:00:05,002 --> 00:00:07,005
- [Instructor] Let's look at a couple of challenges

3
00:00:07,005 --> 00:00:11,000
for loadable kernel module files.

4
00:00:11,000 --> 00:00:15,009
So remember when we're working loadable modules in general,

5
00:00:15,009 --> 00:00:17,001
you got to be careful,

6
00:00:17,001 --> 00:00:19,001
especially when you're writing your own,

7
00:00:19,001 --> 00:00:21,005
and we'll do that later on.

8
00:00:21,005 --> 00:00:24,003
So overall, it's best if you're using

9
00:00:24,003 --> 00:00:27,006
some sort of machine like a VM that if you corrupt it,

10
00:00:27,006 --> 00:00:29,007
it's not a catastrophe.

11
00:00:29,007 --> 00:00:31,009
All right, so couple of questions.

12
00:00:31,009 --> 00:00:36,000
How many modules are installed on your system?

13
00:00:36,000 --> 00:00:39,008
That is, how many of these .kozst files

14
00:00:39,008 --> 00:00:42,002
are there for your kernel version?

15
00:00:42,002 --> 00:00:46,005
And then also, right, the modules are going to be

16
00:00:46,005 --> 00:00:49,006
underneath lib modules, your kernel version,

17
00:00:49,006 --> 00:00:51,000
and you can get your kernel version

18
00:00:51,000 --> 00:00:54,003
with uname space -r.

19
00:00:54,003 --> 00:00:57,007
And if you haven't seen it before, $ open paren

20
00:00:57,007 --> 00:00:59,000
and then a command

21
00:00:59,000 --> 00:01:00,009
runs that command and takes the output

22
00:01:00,009 --> 00:01:02,006
and sticks it back on the command line.

23
00:01:02,006 --> 00:01:08,001
So lib modules/$(uname -r) is a handy way

24
00:01:08,001 --> 00:01:10,009
of getting to the lib modules directory

25
00:01:10,009 --> 00:01:13,001
for your running kernel.

26
00:01:13,001 --> 00:01:16,000
So in that directory you'll see sub directories

27
00:01:16,000 --> 00:01:19,003
and all the modules are under there somewhere,

28
00:01:19,003 --> 00:01:22,000
but at the top level you'll see a number of files,

29
00:01:22,000 --> 00:01:25,002
including a file called modules.dep.

30
00:01:25,002 --> 00:01:27,006
We'll look more at that later, but right now,

31
00:01:27,006 --> 00:01:29,008
count how many lines are in that

32
00:01:29,008 --> 00:01:31,000
and then we'll talk about it.

