You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+48-32Lines changed: 48 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,15 +32,15 @@
32
32
</a>
33
33
</p>
34
34
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**.
36
36
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.
38
38
39
39
**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**.
40
40
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.
41
41
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)`.
44
44
45
45
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.
46
46
@@ -63,10 +63,14 @@ The [dmesg](https://linux.die.net/man/8/dmesg) command is used below to retrieve
63
63
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.
64
64
65
65
### Table of Contents
66
+
67
+
<!-- vim-markdown-toc GFM -->
68
+
66
69
-[Installation](#installation)
67
70
-[Cargo](#cargo)
68
71
-[Arch Linux](#arch-linux)
69
72
-[Nixpkgs](#nixpkgs)
73
+
-[Alpine Linux](#alpine-linux)
70
74
-[Docker](#docker)
71
75
-[Build](#build)
72
76
-[Run](#run)
@@ -121,6 +125,8 @@ kmon is written in [Rust](https://www.rust-lang.org/) and uses [tui-rs](https://
@@ -133,11 +139,7 @@ kmon is written in [Rust](https://www.rust-lang.org/) and uses [tui-rs](https://
133
139
cargo install kmon
134
140
```
135
141
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`.
141
143
142
144
### Arch Linux
143
145
@@ -147,7 +149,7 @@ cargo install kmon --force
147
149
pacman -S kmon
148
150
```
149
151
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,
151
153
152
154
```
153
155
paru -S kmon-git
@@ -171,13 +173,22 @@ nix-channel --update nixos
171
173
nix-env -iA nixos.kmon
172
174
```
173
175
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).
[libxcb](https://xcb.freedesktop.org/) should be installed for using the copy/paste commands of X11.
228
244
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.
230
246
231
247
## Usage
232
248
@@ -514,7 +530,7 @@ kmon aims to be a standard tool for Linux kernel management while supporting mos
514
530
515
531
### Accessibility
516
532
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/).
518
534
519
535
### Dependencies
520
536
@@ -526,44 +542,44 @@ Management actions about the Linux kernel should be applicable in kmon for minim
526
542
527
543
### Testing
528
544
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.
530
546
531
547
## Resources
532
548
533
549
### About the project
534
550
535
-
*[Code of conduct](https://github.com/orhun/kmon/blob/master/CODE_OF_CONDUCT.md)
 |  | 
||||
 |  | 
||||
560
576
561
577
### Social Media
562
578
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
0 commit comments