diff options
author | Minijackson <minijackson@riseup.net> | 2020-09-21 17:40:22 +0200 |
---|---|---|
committer | Minijackson <minijackson@riseup.net> | 2020-09-21 17:40:22 +0200 |
commit | 0662e3574ef5227cd033d8d7f7eae97f33c3702c (patch) | |
tree | cfd1658c05213a00c9c6cfe8b62671307f1df446 /kernel.md | |
parent | 4e6a880d4e4357e627b5ca2fe7f02b768830eb2b (diff) | |
download | wtf-is-linux-website-0662e3574ef5227cd033d8d7f7eae97f33c3702c.tar.gz wtf-is-linux-website-0662e3574ef5227cd033d8d7f7eae97f33c3702c.zip |
add file-system article + small fixes
Diffstat (limited to 'kernel.md')
-rw-r--r-- | kernel.md | 49 |
1 files changed, 29 insertions, 20 deletions
@@ -1,5 +1,9 @@ | |||
1 | % The Linux Kernel | 1 | % The Linux Kernel |
2 | 2 | ||
3 | --- | ||
4 | subtitle: WTF is Linux | ||
5 | --- | ||
6 | |||
3 | [back](index.md) | 7 | [back](index.md) |
4 | 8 | ||
5 | TODO: A word about how the kernel is in charge of enforcing security | 9 | TODO: A word about how the kernel is in charge of enforcing security |
@@ -9,11 +13,11 @@ TODO: Talk about `dmesg` | |||
9 | Role | 13 | Role |
10 | ---- | 14 | ---- |
11 | 15 | ||
12 | A kernel is a piece of software that is loaded at boot time. It is a | 16 | A kernel is a piece of software that's loaded at boot time. It's a component |
13 | component that is responsible for "orchestrating" the OS in different | 17 | that's responsible for "orchestrating" the OS in different manners. There are |
14 | manners. There are different types of kernel in this world, and they may | 18 | different types of kernel in this world, and they may have different |
15 | have different responsibilities. We will be focusing solely on the role | 19 | responsibilities. We will be focusing solely on the role of the Linux kernel |
16 | of the Linux kernel here. | 20 | here. |
17 | 21 | ||
18 | ### Hardware control and abstraction | 22 | ### Hardware control and abstraction |
19 | 23 | ||
@@ -29,21 +33,22 @@ Without hardware control, each software would have to consciously and | |||
29 | constantly collaborate with each other to avoid conflict when accessing | 33 | constantly collaborate with each other to avoid conflict when accessing |
30 | each piece of hardware. | 34 | each piece of hardware. |
31 | 35 | ||
32 | With the Linux kernel accessing the hardware is gated by an API: each | 36 | With the Linux kernel, accessing the hardware is gated by an API: each |
33 | software that wants to access the hard drive has to go use system calls | 37 | software that wants to access the hard drive has to use system calls (e.g.: |
34 | (e.g.: `read(2)` / `write(2)`), and the kernel will then schedule | 38 | `read(2)` / `write(2)`), and the kernel will then schedule these tasks |
35 | these tasks sequentially. | 39 | as it see fits, without having to "collaborate" with anyone. |
36 | 40 | ||
37 | Another important point, is that without the Linux kernel, each piece of | 41 | Another important point, is that without the Linux kernel, each piece of |
38 | software would have to care if the hard drive is a spinning disk, an | 42 | software would have to care if the hard drive is a spinning disk, an |
39 | SSD, or a USB stick, or if is connected using a SATA cable, a USB cable, | 43 | SSD, or a USB stick, or if is connected using a SATA cable, a USB cable, |
40 | etc. | 44 | etc. |
41 | 45 | ||
42 | The Linux kernel allows us to not care about this, and provides us with | 46 | The Linux kernel allows us to not care about this, and provides us with the |
43 | the filesystem abstraction, and mount points. To the software developer | 47 | [file system](./file-system.md) abstraction, and [mount |
44 | doing a `read` on a file doesn't change if the file is stored on an | 48 | points](./file-system.md#mounts). To the software developer doing a `read` on a |
45 | SSD or even on a network filesystem, because the kernel will check that | 49 | file doesn't change if the file is stored on an SSD or even on a network file |
46 | for us, and apply the appropriate logic. | 50 | system, because the kernel will check that for us, and apply the appropriate |
51 | logic. | ||
47 | 52 | ||
48 | ### Multitasking | 53 | ### Multitasking |
49 | 54 | ||
@@ -60,7 +65,7 @@ Each of these 5 applications feels responsive even if the CPU can only run 4 of | |||
60 | them at the time. | 65 | them at the time. |
61 | 66 | ||
62 | This is because the kernel is responsible for switching the tasks that the CPU | 67 | This is because the kernel is responsible for switching the tasks that the CPU |
63 | runs (a.k.a. scheduling). Theses tasks / applications are switched quickly and | 68 | runs (a.k.a. scheduling). These tasks / applications are switched quickly and |
64 | in such a way that they feel responsive to the user. | 69 | in such a way that they feel responsive to the user. |
65 | 70 | ||
66 | The Linux kernel also provides developers with another abstraction to | 71 | The Linux kernel also provides developers with another abstraction to |
@@ -75,7 +80,7 @@ and if they want to run more tasks concurrently than the amount of | |||
75 | available CPU cores, they would have to implement their own task | 80 | available CPU cores, they would have to implement their own task |
76 | scheduler. | 81 | scheduler. |
77 | 82 | ||
78 | Thankfully we do not have to care about that, because the Linux kernel | 83 | Thankfully we don't have to care about that, because the Linux kernel |
79 | cares about it for us instead. | 84 | cares about it for us instead. |
80 | 85 | ||
81 | Sources | 86 | Sources |
@@ -93,9 +98,9 @@ The official sources of the Linux kernel can be found in | |||
93 | [Debian](https://sources.debian.org/patches/linux/5.7.6-1/), | 98 | [Debian](https://sources.debian.org/patches/linux/5.7.6-1/), |
94 | [Gentoo](https://gitweb.gentoo.org/proj/linux-patches.git/tree/?h=5.7)) | 99 | [Gentoo](https://gitweb.gentoo.org/proj/linux-patches.git/tree/?h=5.7)) |
95 | 100 | ||
96 | The official programming language of the Linux kernel is C. It is | 101 | The official programming language of the Linux kernel is C. It's heavily |
97 | heavily documented in the `Documentation` subdirectory, using the | 102 | documented in the `Documentation` subdirectory, using the sphinx documentation |
98 | sphinx documentation system. | 103 | system. |
99 | 104 | ||
100 | 105 | ||
101 | Versioning | 106 | Versioning |
@@ -129,10 +134,14 @@ TODO: Also refer to their Debian, Ubuntu, etc. packages. | |||
129 | Configuring the kernel | 134 | Configuring the kernel |
130 | ---------------------- | 135 | ---------------------- |
131 | 136 | ||
137 | TODO | ||
138 | |||
132 | ```sh | 139 | ```sh |
133 | make nconfig | 140 | make menuconfig |
134 | ``` | 141 | ``` |
135 | 142 | ||
143 | TODO: explain what's a module | ||
144 | |||
136 | Building the kernel | 145 | Building the kernel |
137 | ------------------- | 146 | ------------------- |
138 | 147 | ||