No description
Find a file
2025-02-08 19:40:31 +01:00
.vscode Add vscode LSP support 2025-02-08 19:40:31 +01:00
01_basic_module Reorder includes 2025-02-08 18:57:28 +01:00
02_character_device Reorder includes 2025-02-08 18:57:28 +01:00
03_process_monitor Add process_monitor 2025-02-08 18:27:36 +01:00
.envrc Add basic and chardev modules 2025-02-08 17:04:09 +01:00
.gitignore Add basic and chardev modules 2025-02-08 17:04:09 +01:00
flake.lock Add basic and chardev modules 2025-02-08 17:04:09 +01:00
flake.nix Add vscode LSP support 2025-02-08 19:40:31 +01:00
README.md Add usefull links 2025-02-08 17:33:19 +01:00

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

sudo insmod [module_name].ko

Warning: Can fail if secure boot is enabled

Step 2: Check logs

sudo dmesg | tail

Step 3: Unload module

sudo rmmod [module_name].ko