linux-kernel-modules

Linux kernel module skill for writing and debugging loadable kernel modules. Use when writing LKMs with Kbuild, adding module parameters, creating /proc and sysfs entries, implementing character devices, debugging with KGDB or ftrace, or handling module signing for Secure Boot. Activates on queries

By mohitmishra786 · 506 installs

npx skills add mohitmishra786/low-level-dev-skills --skill linux-kernel-modules

Source repository · Upstream listing

Linux Kernel Modules Purpose Guide agents through writing loadable Linux kernel modules (LKMs): the Kbuild build system, module parameters, /proc and sysfs interfaces, character device implementation, kernel debugging with KGDB and ftrace , and module signing for Secure Boot. Triggers "How do I write a Linux kernel module?" "How do I add parameters to my kernel module?" "How do I create a /proc or sysfs entry?" "How do I implement a character device driver?" "How do I debug a kernel module with KGDB?" "How do I sign a kernel module for Secure Boot?" Workflow 1. Minimal kernel module 2. Module parameters 3. /proc filesystem interface 4. sysfs interface 5. Character device 6. Debugging with KGDB and ftrace 7. EXPORT SYMBOL vs EXPORT SYMBOL GPL Use EXPORT SYMBOL GPL for symbols that touch GPL only kernel internals. Loading a non GPL module that imports GPL symbols fails with a taint warning. Check with modinfo and dmesg after insmod . 8. KUnit in kernel unit tests See skills/kernel/kernel testing for full KUnit, kselftest, and syzkaller workflows. 9. Rust kernel modules (kernel 6.x + CONFIG RUST=y) Requires kernel built with CONFIG RUST=y and appropriate Rust toolchain pinned by the kernel tree. 10. Module signing (Secure Boot, kernel 6.x) Kernel 6.x enforces module signature verification when CONFIG MODULE SIG is enabled (default on most distro kernels with Secure Boot). With lockdown integrity or confidentiality , unsigned modules are rejected. Distro kernels may also require keys enrolled in the kernel's built in trusted keyring ( CONFIG SYSTEM TRUSTED KEYS ). For Kbuild system details, see [references/kbuild basics.md](references/kbuild basics.md). Related skills Use skills/kernel/kernel testing for KUnit and kselftest harnesses Use skills/kernel/device drivers for char/platform driver patterns beyond minimal modules Use skills/kernel/kernel debugging for kgdb, ftrace, and kprobes Use skills/observability/ebpf for userspace kernel tracing without modules Use skills/debuggers/gdb for GDB session management with KGDB Use skills/binaries/elf inspection for inspecting module ELF structure