Compare commits

...

6 Commits

Author SHA1 Message Date
0xAX cd7e8155f3
Merge pull request #793 from waltforme/fix-typo-cgroups
2 years ago
0xAX 1dde1f6559
Merge pull request #795 from yash1120/patch-1
2 years ago
0xAX be39f46456
Merge pull request #787 from henrybear327/patch-1
2 years ago
yash1120 9e44bdb61c
typo fix
2 years ago
Jun Duan 452ba66cd6 Fix typos for cgroups.
2 years ago
Chun-Hung Tseng 5769670cdc Fix busybox typo
3 years ago

@ -8,7 +8,7 @@ This is the third part of the `Kernel booting process` series. In the previous [
In this part, we will look at:
* video mode initialization in the kernel setup code,
* Video mode initialization in the kernel setup code,
* the preparations made before switching into protected mode,
* the transition to protected mode
@ -35,7 +35,7 @@ vga=<mode>
<mode> here is either an integer (in C notation, either
decimal, octal, or hexadecimal) or one of the strings
"normal" (meaning 0xFFFF), "ext" (meaning 0xFFFE) or "ask"
(meaning 0xFFFD). This value should be entered into the
(meaning 0xFFFD). This value should be entered into the
vid_mode field, as it is used by the kernel before the command
line is parsed.
```

@ -6,7 +6,7 @@ Introduction
This is the first part of the new chapter of the [linux insides](https://github.com/0xAX/linux-insides/blob/master/SUMMARY.md) book and as you may guess by part's name - this part will cover [control groups](https://en.wikipedia.org/wiki/Cgroups) or `cgroups` mechanism in the Linux kernel.
`Cgroups` are special mechanism provided by the Linux kernel which allows us to allocate kind of `resources` like processor time, number of processes per group, amount of memory per control group or combination of such resources for a process or set of processes. `Cgroups` are organized hierarchically and here this mechanism is similar to usual processes as they are hierarchical too and child `cgroups` inherit set of certain parameters from their parents. But actually they are not the same. The main differences between `cgroups` and normal processes that many different hierarchies of control groups may exist simultaneously in one time while normal process tree is always single. This was not a casual step because each control group hierarchy is attached to set of control group `subsystems`.
`Cgroups` are special mechanism provided by the Linux kernel which allows us to allocate kind of `resources` like processor time, number of processes per group, amount of memory per control group or combination of such resources for a process or set of processes. `Cgroups` are organized hierarchically and here this mechanism is similar to usual processes as they are hierarchical too and child `cgroups` inherit set of certain parameters from their parents. But actually they are not the same. The main difference between `cgroups` and normal processes is that many different hierarchies of control groups may exist simultaneously in one time while normal process tree is always single. This was not a casual step because each control group hierarchy is attached to set of control group `subsystems`.
One `control group subsystem` represents one kind of resources like a processor time or number of [pids](https://en.wikipedia.org/wiki/Process_identifier) or in other words number of processes for a `control group`. Linux kernel provides support for following twelve `control group subsystems`:
@ -74,7 +74,7 @@ The first way is to create subdirectory in any subsystem from `/sys/fs/cgroup` a
The second way is to create/destroy/manage `cgroups` with utils from `libcgroup` library (`libcgroup-tools` in Fedora).
Let's consider simple example. Following [bash](https://www.gnu.org/software/bash/) script will print a line to `/dev/tty` device which represents control terminal for the current process:
Let's consider a simple example. Following [bash](https://www.gnu.org/software/bash/) script will print a line to `/dev/tty` device which represents control terminal for the current process:
```shell
#!/bin/bash
@ -218,7 +218,7 @@ Now we know a little about `control groups` mechanism, how to use it manually an
Early initialization of control groups
--------------------------------------------------------------------------------
Now after we just saw little theory about `control groups` Linux kernel mechanism, we may start to dive into the source code of Linux kernel to acquainted with this mechanism closer. As always we will start from the initialization of `control groups`. Initialization of `cgroups` divided into two parts in the Linux kernel: early and late. In this part we will consider only `early` part and `late` part will be considered in next parts.
Now after we just saw a little theory about `control groups` Linux kernel mechanism, we may start to dive into the source code of Linux kernel to get better acquainted with this mechanism. As always we will start from the initialization of `control groups`. Initialization of `cgroups` is divided into two parts in the Linux kernel: early and late. In this part we will consider only `early` part and `late` part will be considered in next parts.
Early initialization of `cgroups` starts from the call of the:

@ -222,9 +222,9 @@ $ make menuconfig
$ make -j4
```
`busybox` is an executable file - `/bin/busybox` that contains a set of standard tools like [coreutils](https://en.wikipedia.org/wiki/GNU_Core_Utilities). In the `busysbox` menu we need to enable: `Build BusyBox as a static binary (no shared libs)` option:
`busybox` is an executable file - `/bin/busybox` that contains a set of standard tools like [coreutils](https://en.wikipedia.org/wiki/GNU_Core_Utilities). In the `busybox` menu we need to enable: `Build BusyBox as a static binary (no shared libs)` option:
![busysbox menu](http://i68.tinypic.com/11933bp.png)
![busybox menu](http://i68.tinypic.com/11933bp.png)
We can find this menu in the:
@ -233,7 +233,7 @@ Busybox Settings
--> Build Options
```
After this we exit from the `busysbox` configuration menu and execute following commands for building and installation of it:
After this we exit from the `busybox` configuration menu and execute following commands for building and installation of it:
```
$ make -j4

@ -134,3 +134,4 @@ Thank you to all contributors:
* [Yuxin Wu](https://github.com/chaffz)
* [Biao Ding](https://github.com/SmallPond)
* [Arfy slowy](https://github.com/slowy07)
* [Jun Duan](https://github.com/waltforme)

Loading…
Cancel
Save