Skip to content

Guide for writing and debugging loadable Linux kernel modules with Kbuild, parameters, and Secure Boot signing.

CCM score
60 of 100
skills.sh installs
740
GitHub stars
303
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers the full module lifecycle: minimal init and exit code, Kbuild Makefile, build, insmod/rmmod, and inspection with modinfo and dmesg
  • Includes examples for module parameters, /proc and sysfs interfaces, character device registration, and KGDB and ftrace debugging
  • Enforces GPL-aware symbol export guidance, distinguishing EXPORT_SYMBOL from EXPORT_SYMBOL_GPL and the taint warning for non-GPL modules
  • Designed for kernel developers writing out-of-tree drivers, with KUnit in-kernel unit testing included

Install

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

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

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

// hello.c — minimal loadable kernel module
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Your Name");
MODULE_DESCRIPTION("Minimal hello world module");
MODULE_VERSION("1.0");

static int __init hello_init(void)
{
    printk(KERN_INFO "hello: module loaded\n");
    return 0;   // non-zero = load failure
}

static void __exit hello_exit(void)
{
    printk(KERN_INFO "hello: module unloaded\n");
}

module_init(hello_init);
module_exit(hello_exit);

Details

Repository
github.com/mohitmishra786/low-level-dev-skills
First seen
Jun 3, 2026

Questions

What does the linux-kernel-modules skill help with?

The linux-kernel-modules skill guides agents through writing and debugging loadable Linux kernel modules. It covers the Kbuild build system, module parameters, /proc and sysfs interfaces, character devices, KGDB and ftrace debugging, and module signing for Secure Boot.

How do I install the linux-kernel-modules skill?

Run npx -y skills add mohitmishra786/low-level-dev-skills --skill linux-kernel-modules -y in your project. Once installed, the agent can write a minimal module with a Makefile, load it with insmod and read its output with dmesg.

Can the skill help me create a /proc or sysfs entry in a kernel module?

Yes, the skill includes worked examples for both interfaces. It shows how to create a /proc entry with proc_create and seq_file, and a sysfs attribute under kernel_kobj that you can read and write from the shell.

Does the skill cover debugging a kernel module with KGDB or ftrace?

Yes, the skill covers KGDB debugging over serial or network and ftrace function tracing through the debugfs tracing files. It also shows how to enable pr_debug output with dynamic debug.

More from mohitmishra786/low-level-dev-skills

All 54

Similar to Linux Kernel Modules