Add basic and chardev modules
This commit is contained in:
commit
e3c9144b8a
10 changed files with 298 additions and 0 deletions
41
README.md
Normal file
41
README.md
Normal file
|
@ -0,0 +1,41 @@
|
|||
## Setup env
|
||||
|
||||
On NixOS:
|
||||
|
||||
- Ensure Linux Kernel is the same as you configuration.
|
||||
Otherwise, change linux_dev variable with you kernel variant and change flake.lock nixpkgs with your version.
|
||||
- Use direnv allow or nix develop to setup shell.
|
||||
|
||||
|
||||
On other distros:
|
||||
|
||||
- You need to setup LINUX_MODULES_FOLDER to linux modules folder of your distro (ex: `/lib/modules/$(uname -r)/build`) in flake.nix
|
||||
|
||||
## make : targets list
|
||||
|
||||
- all : Compiling kernel
|
||||
- clean : Cleaning build folder
|
||||
|
||||
All subfolder is configured to use LINUX_MODULES_FOLDER env variable set by flake develop
|
||||
|
||||
## How test module
|
||||
|
||||
Step 1: Load module
|
||||
|
||||
```bash
|
||||
sudo insmod [module_name].ko
|
||||
```
|
||||
|
||||
**Warning**: Can fail if secure boot is enabled
|
||||
|
||||
Step 2: Check logs
|
||||
|
||||
```bash
|
||||
sudo dmesg | tail
|
||||
```
|
||||
|
||||
Step 3: Unload module
|
||||
|
||||
```bash
|
||||
sudo rmmod [module_name].ko
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue