RepositoryTeX
sysprog21

sysprog21/lkmpg

The Linux Kernel Module Programming Guide (updated for 5.0+ kernels)

8.7kstars
629forks
10issues
8views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: linux-kernel-module

#1 Repository of the week

1
TINIX TRENDING·Topic: linux-kernel-driver

#1 Repository of the week

1
TINIX TRENDING·Topic: lkm

#1 Repository of the week

The Linux Kernel Module Programming Guide

This project keeps the Linux Kernel Module Programming Guide up to date, with working examples for recent 5.x and 6.x kernel versions. The guide has been around since 2001 and most copies of it on the web only describe old 2.6.x kernels.

The book can be freely accessed via https://sysprog21.github.io/lkmpg/ or latest PDF file. The original guide may be found at Linux Documentation Project. You may check other freely available programming books listed by The Free Ebook Foundation or Linux online books collected by The Online Books Page.

Getting Started

Summary

  1. Get the latest source code from the GitHub page.
  2. Install the prerequisites.
  3. Generate PDF and/or HTML documents.

Step 1: Get the latest source code

Make sure you can run git with an Internet connection.

$ git clone https://github.com/sysprog21/lkmpg.git && cd lkmpg

Step 2: Install the prerequisites

To generate the book from source, TeXLive (MacTeX) is required.

For Ubuntu Linux, macOS, and other Unix-like systems, run the following command(s):

# Debian / Ubuntu
$ sudo apt install make texlive-full

# Arch / Manjaro
$ sudo pacman -S make texlive-binextra texlive-bin

# macOS
$ brew install mactex
$ sudo tlmgr update --self

Note that latexmk is required to generate PDF, and it probably has been installed on your OS already. If not, please follow the installation guide.

In macOS systems, package Pygments may not be pre-installed. If not, please refer to the installation guide before generating documents.

Alternatively, using Docker is recommended, as it guarantees the same dependencies with our GitHub Actions workflow. After installing docker engine on your machine, pull the docker image twtug/lkmpg and run in isolated containers.

# pull docker image and run it as container
$ docker pull twtug/lkmpg
$ docker run --rm -it -v $(pwd):/workdir twtug/lkmpg

nerdctl is a Docker-compatible command line tool for containerd, and you can replace the above docker commands with nerdctl counterparts.

Step 3: Generate PDF and/or HTML documents

Now we could build document with following commands:

$ make all              # Generate PDF document
$ make html             # Convert TeX to HTML
$ make clean            # Delete generated files

License

The Linux Kernel Module Programming Guide is a free book; you may reproduce and/or modify it under the terms of the Open Software License. Use of this work is governed by a copyleft license that can be found in the LICENSE file.

The complementary sample code is licensed under GNU GPL version 2, the same as the Linux kernel.

Similar Projects

Discover other similar projects and AI models.

Repository
jlevy/the-art-of-command-line

Master the command line, in one page

162.8k
Jun 25, 2024
RepositoryMarkdown
DigitalPlatDev/FreeDomain

Free domain registration and practical DNS learning resources for everyone.

209.9k
Aug 12, 2026
RepositoryPython
0xAX/linux-insides

A book-in-progress about the Linux kernel and its insides.

33.8k
Nov 26, 2026
RepositoryC
s-matyukevich/raspberry-pi-os

Learning operating system development using Linux kernel and Raspberry Pi

14.0k
Mar 29, 2024
RepositoryShell
CachyOS/linux-cachyos

Archlinux Kernel based on different schedulers and some other performance improvements.

4.9k
Nov 26, 2026
RepositoryPython
cirosantilli/linux-kernel-module-cheat

The perfect emulation setup to study and develop the Linux kernel, kernel modules, QEMU, gem5 and x86_64, ARMv7 and ARMv8 userland and baremetal assembly, ANSI C, C++ and POSIX. GDB step debug and KGDB just work. Powered by Buildroot and crosstool-NG. Highly automated. Thoroughly documented. Automated tests. "Tested" in an Ubuntu 24.04 host.

4.5k
Jun 16, 2026
Repository
morrownr/USB-WiFi

USB WiFi Adapter Information for Linux

4.5k
Sep 2, 2026
RepositoryC
Fred78290/nct6687d

Linux kernel module for Nuvoton NCT6687-R

488
Nov 15, 2026
RepositoryC
mafredri/asustor-platform-driver

Linux kernel platform driver for ASUSTOR NAS hardware (leds, buttons)

109
Nov 14, 2026