# The Linux Kernel Module Programming Guide

LKMPG
Peter Jay Salzman
Michael Burian
Ori Pomerantz
2007-05-18 ver 2.6.4
2001
Peter Jay Salzman

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, version 1.1. You can obtain a copy of this license at http://opensource.org/licenses/osl.php.

This book is distributed in the hope it will be useful, but without any warranty, without even the implied warranty of merchantability or fitness for a particular purpose.

The author encourages wide distribution of this book for personal or commercial use, provided the above copyright notice remains intact and the method adheres to the provisions of the Open Software License. In summary, you may copy and distribute this book free of charge or for a profit. No explicit permission is required from the author for reproduction of this book in any medium, physical or electronic.

Derivative works and translations of this document must be placed under the Open Software License, and the original copyright notice must remain intact. If you have contributed new material to this book, you must make the material and source code available for your revisions. Please make revisions and updates available directly to the document maintainer, Peter Jay Salzman p@dirac.org. This will allow for the merging of updates and provide consistent revisions to the Linux community.

If you publish or distribute this book commercially, donations, royalties, and/or printed copies are greatly appreciated by the author and the Linux Documentation Project (LDP). Contributing in this way shows your support for free software and the LDP. If you have questions or comments, please contact the address above.

## Foreword

&Forward;

## Introduction

&Introduction;

## Hello World

&HelloWorld;

## Preliminaries

&Preliminaries;

## Character Device Files

&CharDevFiles;

## The /proc File System

&TheProcFileSystem;

## Using /proc For Input

&UsingProcForInput;

## Talking To Device Files

&TalkingToDevFiles;

## System Calls

&SystemCalls;

## Blocking Processes

&BlockingProcesses;

## Replacing Printks

&ReplacingPrintks;

## Scheduling Tasks

&SchedulingTasks;

## Interrupt Handlers

&InterruptHandlers;

## Symmetric Multi Processing

&SymmetricMultiProc;

## Common Pitfalls

&CommonPitfalls;

## Changes: 2.0 To 2.2

&Changes20-22;

## Where To Go From Here

&WhereFromHere;
&TheIndex;