kernel-driver

Guide Linux kernel driver development with module skeletons, DT bindings, and sysfs/ioctl interfaces.

2|1|Updated Mar 22, 2026
One-click install
npx skills add https://github.com/solitasroh/mcukit --skill kernel-driver
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kernel-driver
Source: https://github.com/solitasroh/mcukit/tree/main/skills/kernel-driver
Command: npx skills add https://github.com/solitasroh/mcukit --skill kernel-driver

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a practical guide for Linux kernel driver development, covering module skeletons, device-tree bindings, and user-space interfaces (sysfs, ioctl) to streamline building robust drivers.

Core Features & Use Cases

  • Module skeleton and boilerplate for a safe, maintainable kernel driver.
  • Device Tree binding guidance to correctly bind hardware in DTS.
  • User-space interface patterns via sysfs and ioctl for configuration and control.
  • Build and integration guidance for out-of-tree builds and integration with existing MCU/MPU projects.

Quick Start

Open Claude Code, locate the kernel-driver skill, and begin with the Module Skeleton example to start building a Linux kernel driver.

Frequently Asked Questions about kernel-driver

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a Linux kernel driver module from scratch?

To write a Linux kernel driver, you need a structured module skeleton with proper initialization and exit functions. This guide provides boilerplate code, managed resource allocation using devm_* APIs, and robust error handling to ensure safe, maintainable kernel modules.

How do I bind a platform device using device-tree bindings in a Linux driver?

Binding a platform device requires matching your driver with device-tree (DT) bindings. This skill specifies how to correctly configure DT bindings to map hardware descriptions in DTS to your platform device driver for proper MPU-domain hardware integration.

What is the best way to expose kernel driver controls to user space?

The best way to expose kernel driver controls is through sysfs and ioctl interfaces. This skill provides user-space interface patterns for configuration and control, detailing how to implement sysfs attributes and ioctl commands for seamless user-space communication.

Can I use managed resources like devm_* for platform_get_resource in embedded Linux drivers?

Yes, you can use managed resources like devm_* with platform_get_resource for embedded Linux drivers. This approach automatically handles resource cleanup, and the skill specifies APIs and coding patterns to ensure safe memory management across embedded platforms.

How do I set up a Makefile for out-of-tree Linux kernel module builds?

Setting up a Makefile for out-of-tree Linux kernel module builds requires specific build configurations. This skill provides build and integration guidance, including Makefile setups to compile your kernel driver independently and integrate it with existing projects.