Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"
Linux Magazine

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents

· Introduction to Operating Systems
· Linux Basics
· Working with the System
· Shells and Utilities
· Editing Files
· Basic Administration
· The Operating System
· The X Windowing System
· The Computer Itself
· Networking
· System Monitoring
· Solving Problems
· Security
· Installing and Upgrading
· Linux and Windows

Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
Copyright Info
Terms of Use
Privacy Info
Masthead / Impressum
Your Account

Private Messages

News Archive
Submit News
User Articles
Web Links


The Web

Who's Online
There are currently, 201 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here



Current HOWTO: Module-HOWTO

Linux Loadable Kernel Module HOWTO

Linux Loadable Kernel Module HOWTO

Bryan Henderson


Revision History
Revision v1.072005-07-20Revised by: bjh
Add some 2.6 info and disclaimers. Update references to Linux Device Drivers book, Linux Kernel Module Programming Guide.
Revision v1.062005-01-12Revised by: bjh
Cover Linux 2.6 briefly. Update hello.c and reference to Lkmpg. Add information about perils of unloading. Mention dmesg as way to see kernel messages.
Revision v1.052004-01-05Revised by: bjh
Add information on module.h and -DMODULE. Fix tldb.org to tldp.org. Add information on kallsyms.
Revision v1.042003-10-10Revised by: bjh
Fix typo: AHA154x should be AHA152x Add information on what module names the kernel module loader calls for. Add information on what an LKM does when you first load it. Add information on loop module. Change linuxdoc.org to tldp.org.
Revision v1.032003-07-03Revised by: bjh
Update on kernels that don't load into vmalloc space. Add explanation of "deleted" state of an LKM. Explain GPLONLY.
Revision v1.022002-05-21Revised by: bjh
Correct explanation of symbol versioning. Correct author of Linux Device Drivers. Add info about memory allocation penalty of LKM vs bound-in. Add LKM-to-LKM symbol matching requirement. Add open source licensing issue in LKM symbol resolution. Add SMP symbol versioning info.
Revision v1.012001-08-18Revised by: bjh
Add material on various features created in the last few years: kernel module loader, ksymoops symbols, kernel-version-dependent LKM file location.
Revision v1.002001-06-14Revised by: bjh
Initial release.

This is the HOWTO for Linux loadable kernel modules (LKMs). It explains what they are and how to use and create them. It also includes documentation of parameters and other details of use of some particular modules.

Table of Contents
1. Preface
2. Introduction to Linux Loadable Kernel Modules
2.1. Terminology
2.2. History of Loadable Kernel Modules
2.3. The Case For Loadable Kernel Modules
2.4. What LKMs Can't Do
2.5. What LKMs Are Used For
3. Making Loadable Kernel Modules
4. LKM Utilities
5. How To Insert And Remove LKMs
5.1. Could Not Find Kernel Version...
5.2. What Happens When An LKM Loads
5.3. Intelligent Loading Of LKMs - Modprobe
5.4. Automatic LKM Loading and Unloading
5.5. /proc/modules
5.6. Where Are My LKM Files On My System?
6. Unresolved Symbols
6.1. Some LKMs Prerequire Other LKMs
6.2. An LKM Must Match The Base Kernel
6.3. If You Run Multiple Kernels
6.4. SMP symbols
6.5. You Are Not Licensed To Access The Symbol
6.6. An LKM Must Match Prerequisite LKMs
7. How To Boot Without A Disk Device Driver
8. About Module Parameters
9. Persistent Data
10. Technical Details
10.1. How They Work
10.2. The .modinfo Section
10.3. The __ksymtab And .kstrtab Sections
10.4. Ksymoops Symbols
10.5. Other Symbols
10.6. Debugging Symbols
10.7. Memory Allocation For Loading
10.8. Linux internals
11. Writing Your Own Loadable Kernel Module
11.1. Simpler hello.c
11.2. Using the Kernel Build System
11.3. Rubini: Linux Device Drivers
11.4. Improving On Use Counts
12. Differences Between Versions Of Linux
12.1. Linux 2.4 - Linux 2.6
13. Related Documentation
14. Individual Modules
14.1. Executable Interpreters
14.2. Block Device Drivers
14.3. SCSI Drivers
14.4. Network Device Drivers
14.5. CDROM Device Drivers
14.6. Filesystem Drivers
14.7. Miscellaneous Device Driver
14.8. Serial Device Drivers
14.9. Parallel Device Drivers
14.10. Bus Mouse Device Drivers
14.11. Tape Device Drivers
14.12. Watchdog Timers
14.13. Sound Device Drivers
15. Maintenance Of This Document
16. History
17. Copyright

The Linux Tutorial completely respects the rights of authors and artists to decide for themselves if and how their works can be used, independent of any existing licenses. This means if you are the author of any document presented on this site and do no wish it to be displayed as it is on this site or do not wish it to be displayed at all, please contact us and we will do our very best to accommodate you. If we are unable to accommodate you, we will, at your request, remove your document as quickly as possible.

If you are the author of any document presented on this site and would like a share of the advertising revenue, please contact us using the standard Feedback Form.




Security Code
Security Code
Type Security Code

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!

Amazon Wish List

Did You Know?
You can choose larger fonts by selecting a different themes.


Tell a Friend About Us

Bookmark and Share

Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.12 Seconds