1
00:00:00,005 --> 00:00:02,004
- [Instructor] Let me point you to

2
00:00:02,004 --> 00:00:03,009
a few more

3
00:00:03,009 --> 00:00:06,009
Linux source code directories

4
00:00:06,009 --> 00:00:10,006
that I think are worth spending a couple minutes looking at.

5
00:00:10,006 --> 00:00:11,007
So include,

6
00:00:11,007 --> 00:00:14,009
so remember when you're building the kernel,

7
00:00:14,009 --> 00:00:16,006
it does not use,

8
00:00:16,006 --> 00:00:18,009
include files, header files

9
00:00:18,009 --> 00:00:21,008
from the ordinary user space directory.

10
00:00:21,008 --> 00:00:24,007
It's only using include files

11
00:00:24,007 --> 00:00:26,007
from the kernel source directory.

12
00:00:26,007 --> 00:00:30,000
So that's underneath the include subdirectory.

13
00:00:30,000 --> 00:00:33,008
But by the way, when you build a kernel,

14
00:00:33,008 --> 00:00:38,007
you build include files that user space will need

15
00:00:38,007 --> 00:00:43,002
so that when Linux systems get built,

16
00:00:43,002 --> 00:00:46,004
some of the header files come from the kernel

17
00:00:46,004 --> 00:00:49,003
because user space sometimes needs to know

18
00:00:49,003 --> 00:00:52,003
what data structures look like.

19
00:00:52,003 --> 00:00:56,001
So user space won't be using kernel include files directly.

20
00:00:56,001 --> 00:01:00,005
Those kernel include files that get built,

21
00:01:00,005 --> 00:01:04,000
you know, get copied into the user space plus part

22
00:01:04,000 --> 00:01:07,008
as part of building a Linux distro.

23
00:01:07,008 --> 00:01:11,008
Right, so some of those files in the user include directory,

24
00:01:11,008 --> 00:01:13,008
like the standard C library, which is

25
00:01:13,008 --> 00:01:18,007
where the system call user space component is.

26
00:01:18,007 --> 00:01:23,004
Those right, need to correspond to your kernel.

27
00:01:23,004 --> 00:01:26,001
Another directory, I think is interesting,

28
00:01:26,001 --> 00:01:30,003
is fs, which stands for file systems.

29
00:01:30,003 --> 00:01:34,002
And underneath there you can find code for proc and sysfs

30
00:01:34,002 --> 00:01:38,002
and for the disk file systems, ext four,

31
00:01:38,002 --> 00:01:41,001
btrfs, xfs, so forth.

32
00:01:41,001 --> 00:01:43,003
Network file system stuff,

33
00:01:43,003 --> 00:01:46,007
and non-native Linux file systems,

34
00:01:46,007 --> 00:01:50,008
compatible file systems like for NTFS or FAT.

35
00:01:50,008 --> 00:01:53,005
Oh, I think that's kind of interesting.

36
00:01:53,005 --> 00:01:57,003
Another directory I find interesting is Arch,

37
00:01:57,003 --> 00:02:00,008
where the support for the different computer architectures

38
00:02:00,008 --> 00:02:03,001
for Linux is kept, right?

39
00:02:03,001 --> 00:02:05,001
So Linux runs on lots of different kinds

40
00:02:05,001 --> 00:02:06,002
of computer architectures.

41
00:02:06,002 --> 00:02:10,001
It's actually quite portable operating system.

42
00:02:10,001 --> 00:02:11,007
Pretty amazing.

43
00:02:11,007 --> 00:02:15,009
So Linux runs on computers with 32 bit or 64 bit,

44
00:02:15,009 --> 00:02:18,005
single or multiprocessor,

45
00:02:18,005 --> 00:02:21,000
plus a bunch of different architectures.

46
00:02:21,000 --> 00:02:23,003
So the architecture dependent code

47
00:02:23,003 --> 00:02:27,001
is divided up in those subdirectories.

48
00:02:27,001 --> 00:02:29,004
And then, one more directory you might find interesting

49
00:02:29,004 --> 00:02:32,001
is the security directory.

50
00:02:32,001 --> 00:02:37,006
And in there is the short little name security.c.

51
00:02:37,006 --> 00:02:38,009
That file is pretty interesting.

52
00:02:38,009 --> 00:02:43,001
That's the fundamental hooks that SELinux

53
00:02:43,001 --> 00:02:46,006
and AppArmor and other sort of security systems use.

54
00:02:46,006 --> 00:02:48,009
This is where the filters are

55
00:02:48,009 --> 00:02:52,006
so that when a process makes a system call

56
00:02:52,006 --> 00:02:55,004
SELinux or AppArmor can have hooks

57
00:02:55,004 --> 00:02:57,004
that get invoked to check things

58
00:02:57,004 --> 00:03:00,000
to see if it's allowed or not.

59
00:03:00,000 --> 00:03:03,008
All right, so perusing security.c might be interesting.

60
00:03:03,008 --> 00:03:05,000
I think it is.

