Skip to content

Commit 275400a

Browse files
committed
doc: Revise README.md
1 parent dbd0c7f commit 275400a

File tree

1 file changed

+48
-32
lines changed

1 file changed

+48
-32
lines changed

README.md

Lines changed: 48 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@
3232
</a>
3333
</p>
3434

35-
**The kernel** is the part of the operating system that facilitates interactions between *hardware* and *software* components. On most systems, it is loaded on startup after the *bootloader* and handles I/O requests as well as peripherals like keyboards, monitors, network adapters, and speakers. Typically, the kernel is responsible for **memory management**, **process management**, **device management**, **system calls**, and **security**.
35+
**The kernel** is the part of the operating system that facilitates interactions between _hardware_ and _software_ components. On most systems, it is loaded on startup after the _bootloader_ and handles I/O requests as well as peripherals like keyboards, monitors, network adapters, and speakers. Typically, the kernel is responsible for **memory management**, **process management**, **device management**, **system calls**, and **security**.
3636
Applications use the **system call** mechanism for requesting a service from the operating system and most of the time, this request is passed to the kernel using a library provided by the operating system to invoke the related kernel function. While the kernel performs these low-level tasks, it's resident on a separate part of memory named **protected kernel space** which is not accessible by applications and other parts of the system. In contrast, applications like browsers, text editors, window managers or audio/video players use a different separate area of the memory, **user space**. This separation prevents user data and kernel data from interfering with each other and causing instability and slowness, as well as preventing malfunctioning application programs from crashing the entire operating system.
37-
There are different kernel designs due to the different ways of managing system calls and resources. For example, while **monolithic kernels** run all the operating system instructions in the same address space *for speed*, **microkernels** use different spaces for user and kernel services *for modularity*. Apart from those, there are **hybrid kernels**, **nanokernels**, and, **exokernels**. The hybrid kernel architecture is based on combining aspects of microkernel and monolithic kernels.
37+
There are different kernel designs due to the different ways of managing system calls and resources. For example, while **monolithic kernels** run all the operating system instructions in the same address space _for speed_, **microkernels** use different spaces for user and kernel services _for modularity_. Apart from those, there are **hybrid kernels**, **nanokernels**, and, **exokernels**. The hybrid kernel architecture is based on combining aspects of microkernel and monolithic kernels.
3838

3939
**The Linux kernel** is the open-source, monolithic and, Unix-like operating system kernel that used in the Linux distributions, various embedded systems such as routers and as well as in the all Android-based systems. **Linus Torvalds** conceived and created the Linux kernel in 1991 and it's still being developed by thousands of developers today. It's a prominent example of **free and open source software** and it's used in other free software projects, notably the **GNU operating system**.
4040
Although the Linux-based operating systems dominate the most of computing, it still carries some of the design flaws which were quite a bit of debate in the early days of Linux. For example, it has the **largest footprint** and **the most complexity** over the other types of kernels. But it's a design feature that monolithic kernels inherent to have. These kind of design issues led developers to add new features and mechanisms to the Linux kernel which other kernels don't have.
4141

42-
Unlike the standard monolithic kernels, the Linux kernel is also **modular**, accepting **loadable kernel modules (LKM)** that typically used to add support for new *hardware* (as device drivers) and/or *filesystems*, or for adding *system calls*. Since LKMs could be loaded and unloaded to the system *at runtime*, they have the advantage of extending the kernel without rebooting and re-compiling. Thus, the kernel functionalities provided by modules would not reside in memory without being used and the related module can be unloaded in order to free memory and other resources.
43-
Loadable kernel modules are located in `/lib/modules` with the `.ko` (*kernel object*) extension in Linux. While the [lsmod](https://linux.die.net/man/8/lsmod) command could be used for listing the loaded kernel modules, [modprobe](https://linux.die.net/man/8/modprobe) or [insmod](https://linux.die.net/man/8/insmod)/[rmmod](https://linux.die.net/man/8/rmmod) is used for loading or unloading a kernel module. insmod/rmmod are used for modules independent of modprobe and without requiring an installation to ```/lib/modules/$(uname -r)```.
42+
Unlike the standard monolithic kernels, the Linux kernel is also **modular**, accepting **loadable kernel modules (LKM)** that typically used to add support for new _hardware_ (as device drivers) and/or _filesystems_, or for adding _system calls_. Since LKMs could be loaded and unloaded to the system _at runtime_, they have the advantage of extending the kernel without rebooting and re-compiling. Thus, the kernel functionalities provided by modules would not reside in memory without being used and the related module can be unloaded in order to free memory and other resources.
43+
Loadable kernel modules are located in `/lib/modules` with the `.ko` (_kernel object_) extension in Linux. While the [lsmod](https://linux.die.net/man/8/lsmod) command could be used for listing the loaded kernel modules, [modprobe](https://linux.die.net/man/8/modprobe) or [insmod](https://linux.die.net/man/8/insmod)/[rmmod](https://linux.die.net/man/8/rmmod) is used for loading or unloading a kernel module. insmod/rmmod are used for modules independent of modprobe and without requiring an installation to `/lib/modules/$(uname -r)`.
4444

4545
Here's a simple example of a Linux kernel module that prints a message when it's loaded and unloaded. The build and installation steps of the [module](https://github.com/orhun/kmon/blob/master/example/lkm_example.c) using a [Makefile](https://github.com/orhun/kmon/blob/master/example/Makefile) are shown below.
4646

@@ -63,10 +63,14 @@ The [dmesg](https://linux.die.net/man/8/dmesg) command is used below to retrieve
6363
kmon is written in [Rust](https://www.rust-lang.org/) and uses [tui-rs](https://github.com/fdehau/tui-rs) & [termion](https://github.com/redox-os/termion) libraries for its text-based user interface.
6464

6565
### Table of Contents
66+
67+
<!-- vim-markdown-toc GFM -->
68+
6669
- [Installation](#installation)
6770
- [Cargo](#cargo)
6871
- [Arch Linux](#arch-linux)
6972
- [Nixpkgs](#nixpkgs)
73+
- [Alpine Linux](#alpine-linux)
7074
- [Docker](#docker)
7175
- [Build](#build)
7276
- [Run](#run)
@@ -121,6 +125,8 @@ kmon is written in [Rust](https://www.rust-lang.org/) and uses [tui-rs](https://
121125
- [License](#license)
122126
- [Copyright](#copyright)
123127

128+
<!-- vim-markdown-toc -->
129+
124130
## Installation
125131

126132
[![Packaging status](https://repology.org/badge/vertical-allrepos/kmon.svg)](https://repology.org/project/kmon/versions)
@@ -133,11 +139,7 @@ kmon is written in [Rust](https://www.rust-lang.org/) and uses [tui-rs](https://
133139
cargo install kmon
134140
```
135141

136-
Use the `--force` option to update.
137-
138-
```
139-
cargo install kmon --force
140-
```
142+
The minimum supported Rust version (MSRV) is `1.70.0`.
141143

142144
### Arch Linux
143145

@@ -147,7 +149,7 @@ cargo install kmon --force
147149
pacman -S kmon
148150
```
149151

150-
There are also a development package on [AUR](https://aur.archlinux.org/packages/kmon-git/). Use your favorite [AUR helper](https://wiki.archlinux.org/index.php/AUR_helpers) to install. For example,
152+
There is also a development package on the [AUR](https://aur.archlinux.org/packages/kmon-git/). Use your favorite [AUR helper](https://wiki.archlinux.org/index.php/AUR_helpers) to install. For example,
151153

152154
```
153155
paru -S kmon-git
@@ -171,13 +173,22 @@ nix-channel --update nixos
171173
nix-env -iA nixos.kmon
172174
```
173175

176+
### Alpine Linux
177+
178+
**kmon** is available for [Alpine Edge](https://pkgs.alpinelinux.org/packages?name=kmon&branch=edge). It can be installed via [apk](https://wiki.alpinelinux.org/wiki/Alpine_Package_Keeper) after enabling the [community repository](https://wiki.alpinelinux.org/wiki/Repositories).
179+
180+
```
181+
apk add kmon
182+
```
183+
174184
### Docker
175185

176186
[![Docker Hub Build Status](https://img.shields.io/github/actions/workflow/status/orhun/kmon/docker.yml?color=000000&label=docker%20hub&style=flat-square)](https://hub.docker.com/r/orhunp/kmon)
177187

178188
```
179189
docker run -it --cap-add syslog orhunp/kmon:tagname
180190
```
191+
181192
#### Build
182193

183194
```
@@ -198,16 +209,21 @@ docker run -it --cap-add syslog kmon
198209
```
199210
wget https://github.com/orhun/kmon/releases/download/v[VERSION]/kmon-[VERSION]-x86_64-unknown-linux-gnu.tar.gz
200211
```
212+
201213
3. To download the package compiled with [musl-libc](https://musl.libc.org/) run:
214+
202215
```
203216
wget https://github.com/orhun/kmon/releases/download/v[VERSION]/kmon-[VERSION]-x86_64-unknown-linux-musl.tar.gz
204217
```
218+
205219
3. Extract the files.
206220

207221
```
208222
tar -xvzf kmon-*.tar.gz
209223
```
224+
210225
4. Enter in the new folder.
226+
211227
```
212228
cd kmon-[VERSION]
213229
```
@@ -226,7 +242,7 @@ cd kmon-[VERSION]
226242

227243
[libxcb](https://xcb.freedesktop.org/) should be installed for using the copy/paste commands of X11.
228244

229-
e.g: Install `libxcb1-dev` package for Debian/Ubuntu[*](https://github.com/orhun/kmon/issues/2) and `libxcb-devel` package for Fedora/openSUSE/Void Linux.
245+
e.g: Install `libxcb1-dev` package for Debian/Ubuntu[\*](https://github.com/orhun/kmon/issues/2) and `libxcb-devel` package for Fedora/openSUSE/Void Linux.
230246

231247
## Usage
232248

@@ -514,7 +530,7 @@ kmon aims to be a standard tool for Linux kernel management while supporting mos
514530

515531
### Accessibility
516532

517-
For achieving this goal, kmon should be accessible from different package managers such as [Snap](https://snapcraft.io/)[*](https://forum.snapcraft.io/t/unable-to-load-modules-to-kernel-and-get-module-information/16151) and [RPM](https://rpm.org/).
533+
For achieving this goal, kmon should be accessible from different package managers such as [Snap](https://snapcraft.io/)[\*](https://forum.snapcraft.io/t/unable-to-load-modules-to-kernel-and-get-module-information/16151) and [RPM](https://rpm.org/).
518534

519535
### Dependencies
520536

@@ -526,44 +542,44 @@ Management actions about the Linux kernel should be applicable in kmon for minim
526542

527543
### Testing
528544

529-
kmon should be tested and reported on different architectures for further development and support.
545+
kmon should be tested and reported on different architectures for further development and support.
530546

531547
## Resources
532548

533549
### About the project
534550

535-
* [Code of conduct](https://github.com/orhun/kmon/blob/master/CODE_OF_CONDUCT.md)
536-
* [Contributing](https://github.com/orhun/kmon/blob/master/CONTRIBUTING.md)
537-
* [Creating a release](https://github.com/orhun/kmon/blob/master/RELEASE.md)
551+
- [Code of conduct](https://github.com/orhun/kmon/blob/master/CODE_OF_CONDUCT.md)
552+
- [Contributing](https://github.com/orhun/kmon/blob/master/CONTRIBUTING.md)
553+
- [Creating a release](https://github.com/orhun/kmon/blob/master/RELEASE.md)
538554

539555
### Articles
540556

541-
* [Exploring the Linux Kernel by Bob Cromwell](https://cromwell-intl.com/open-source/linux-kernel-details.html)
542-
* [Anatomy of the Linux loadable kernel module by Terenceli](https://terenceli.github.io/%E6%8A%80%E6%9C%AF/2018/06/02/linux-loadable-module)
543-
* [Managing kernel modules with kmod by Lucas De Marchi](https://elinux.org/images/8/89/Managing_Kernel_Modules_With_kmod.pdf)
557+
- [Exploring the Linux Kernel by Bob Cromwell](https://cromwell-intl.com/open-source/linux-kernel-details.html)
558+
- [Anatomy of the Linux loadable kernel module by Terenceli](https://terenceli.github.io/%E6%8A%80%E6%9C%AF/2018/06/02/linux-loadable-module)
559+
- [Managing kernel modules with kmod by Lucas De Marchi](https://elinux.org/images/8/89/Managing_Kernel_Modules_With_kmod.pdf)
544560

545561
### In the media
546562

547-
* [Manage And Monitor Linux Kernel Modules With Kmon](https://ostechnix.com/manage-and-monitor-linux-kernel-modules-with-kmon/) (
548-
OSTechNix)
549-
* [Kmon The Linux Kernel Management And Monitoring Software](https://www.youtube.com/watch?v=lukxf6CnR2o) (Brodie Robertson on YouTube)
563+
- [Manage And Monitor Linux Kernel Modules With Kmon](https://ostechnix.com/manage-and-monitor-linux-kernel-modules-with-kmon/) (
564+
OSTechNix)
565+
- [Kmon The Linux Kernel Management And Monitoring Software](https://www.youtube.com/watch?v=lukxf6CnR2o) (Brodie Robertson on YouTube)
550566

551567
### Gallery
552568

553-
Fedora 31 | Debian 10 | Manjaro 19
554-
:-------------------------:|:-------------------------:|:-------------------------:
555-
![kmon on fedora](https://user-images.githubusercontent.com/24392180/76520554-27817180-6474-11ea-9966-e564f38c8a6a.png) | ![kmon on debian](https://user-images.githubusercontent.com/24392180/76514129-79bc9580-6468-11ea-9013-e32fbbdc1108.png) | ![kmon on manjaro](https://user-images.githubusercontent.com/24392180/76940351-1f5d8200-690b-11ea-8fe9-1d751fe102c5.png)
569+
| Fedora 31 | Debian 10 | Manjaro 19 |
570+
| :---------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------: |
571+
| ![kmon on fedora](https://user-images.githubusercontent.com/24392180/76520554-27817180-6474-11ea-9966-e564f38c8a6a.png) | ![kmon on debian](https://user-images.githubusercontent.com/24392180/76514129-79bc9580-6468-11ea-9013-e32fbbdc1108.png) | ![kmon on manjaro](https://user-images.githubusercontent.com/24392180/76940351-1f5d8200-690b-11ea-8fe9-1d751fe102c5.png) |
556572

557-
Ubuntu 18.04 | openSUSE | Void Linux
558-
:-------------------------:|:-------------------------:|:-------------------------:
559-
![kmon on ubuntu](https://user-images.githubusercontent.com/24392180/76690341-18571b00-6650-11ea-85c9-3f511c054194.png) | ![kmon on opensuse](https://user-images.githubusercontent.com/24392180/77414512-38b27280-6dd2-11ea-888c-9bf6f7245387.png) | ![kmon on voidlinux](https://user-images.githubusercontent.com/24392180/77417004-c9d71880-6dd5-11ea-82b2-f6c7df9a05c3.png)
573+
| Ubuntu 18.04 | openSUSE | Void Linux |
574+
| :---------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------: |
575+
| ![kmon on ubuntu](https://user-images.githubusercontent.com/24392180/76690341-18571b00-6650-11ea-85c9-3f511c054194.png) | ![kmon on opensuse](https://user-images.githubusercontent.com/24392180/77414512-38b27280-6dd2-11ea-888c-9bf6f7245387.png) | ![kmon on voidlinux](https://user-images.githubusercontent.com/24392180/77417004-c9d71880-6dd5-11ea-82b2-f6c7df9a05c3.png) |
560576

561577
### Social Media
562578

563-
* Follow [@kmonitor_](https://twitter.com/kmonitor_) on Twitter
564-
* Follow the [author](https://orhun.dev/):
565-
* [@orhun](https://github.com/orhun) on GitHub
566-
* [@orhunp_](https://twitter.com/orhunp_) on Twitter
579+
- Follow [@kmonitor\_](https://twitter.com/kmonitor_) on Twitter
580+
- Follow the [author](https://orhun.dev/):
581+
- [@orhun](https://github.com/orhun) on GitHub
582+
- [@orhunp\_](https://twitter.com/orhunp_) on Twitter
567583

568584
## Funding
569585

0 commit comments

Comments
 (0)