From 0662e3574ef5227cd033d8d7f7eae97f33c3702c Mon Sep 17 00:00:00 2001 From: Minijackson Date: Mon, 21 Sep 2020 17:40:22 +0200 Subject: add file-system article + small fixes --- kernel.md | 49 +++++++++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 20 deletions(-) (limited to 'kernel.md') diff --git a/kernel.md b/kernel.md index bb16a62..a4f5567 100644 --- a/kernel.md +++ b/kernel.md @@ -1,5 +1,9 @@ % The Linux Kernel +--- +subtitle: WTF is Linux +--- + [back](index.md) TODO: A word about how the kernel is in charge of enforcing security @@ -9,11 +13,11 @@ TODO: Talk about `dmesg` Role ---- -A kernel is a piece of software that is loaded at boot time. It is a -component that is responsible for "orchestrating" the OS in different -manners. There are different types of kernel in this world, and they may -have different responsibilities. We will be focusing solely on the role -of the Linux kernel here. +A kernel is a piece of software that's loaded at boot time. It's a component +that's responsible for "orchestrating" the OS in different manners. There are +different types of kernel in this world, and they may have different +responsibilities. We will be focusing solely on the role of the Linux kernel +here. ### Hardware control and abstraction @@ -29,21 +33,22 @@ Without hardware control, each software would have to consciously and constantly collaborate with each other to avoid conflict when accessing each piece of hardware. -With the Linux kernel accessing the hardware is gated by an API: each -software that wants to access the hard drive has to go use system calls -(e.g.: `read(2)` / `write(2)`), and the kernel will then schedule -these tasks sequentially. +With the Linux kernel, accessing the hardware is gated by an API: each +software that wants to access the hard drive has to use system calls (e.g.: +`read(2)` / `write(2)`), and the kernel will then schedule these tasks +as it see fits, without having to "collaborate" with anyone. Another important point, is that without the Linux kernel, each piece of software would have to care if the hard drive is a spinning disk, an SSD, or a USB stick, or if is connected using a SATA cable, a USB cable, etc. -The Linux kernel allows us to not care about this, and provides us with -the filesystem abstraction, and mount points. To the software developer -doing a `read` on a file doesn't change if the file is stored on an -SSD or even on a network filesystem, because the kernel will check that -for us, and apply the appropriate logic. +The Linux kernel allows us to not care about this, and provides us with the +[file system](./file-system.md) abstraction, and [mount +points](./file-system.md#mounts). To the software developer doing a `read` on a +file doesn't change if the file is stored on an SSD or even on a network file +system, because the kernel will check that for us, and apply the appropriate +logic. ### Multitasking @@ -60,7 +65,7 @@ Each of these 5 applications feels responsive even if the CPU can only run 4 of them at the time. This is because the kernel is responsible for switching the tasks that the CPU -runs (a.k.a. scheduling). Theses tasks / applications are switched quickly and +runs (a.k.a. scheduling). These tasks / applications are switched quickly and in such a way that they feel responsive to the user. 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 available CPU cores, they would have to implement their own task scheduler. -Thankfully we do not have to care about that, because the Linux kernel +Thankfully we don't have to care about that, because the Linux kernel cares about it for us instead. Sources @@ -93,9 +98,9 @@ The official sources of the Linux kernel can be found in [Debian](https://sources.debian.org/patches/linux/5.7.6-1/), [Gentoo](https://gitweb.gentoo.org/proj/linux-patches.git/tree/?h=5.7)) -The official programming language of the Linux kernel is C. It is -heavily documented in the `Documentation` subdirectory, using the -sphinx documentation system. +The official programming language of the Linux kernel is C. It's heavily +documented in the `Documentation` subdirectory, using the sphinx documentation +system. Versioning @@ -129,10 +134,14 @@ TODO: Also refer to their Debian, Ubuntu, etc. packages. Configuring the kernel ---------------------- +TODO + ```sh -make nconfig +make menuconfig ``` +TODO: explain what's a module + Building the kernel ------------------- -- cgit v1.2.3