Linux Loadable Kernel Module HOWTO

Bryan Henderson

18 August 2001

Revision History
Revision v1.01 2001-08-18 Revised 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.00 2001-06-14 Revised 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. Intelligent Loading Of LKMs - Modprobe
5.3. Automatic LKM Loading and Unloading
5.3.1. Automatic Loading Kerneld Kernel Module Loader
5.3.2. Automatic Unloading - Autoclean The Autoclean Flag Removing The Autoclean LKMs
5.4. /proc/modules
5.5. Where Are My LKM Files On My System?
6. LKM - Base Kernel Compatibility
6.1. An LKM Must Match The Base Kernel
6.2. If You Run Multiple Kernels
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. Linux internals
11. Writing Your Own Loadable Kernel Module
11.1. bug in hello.c
11.2. Rubini: Linux Device Drivers
11.3. Improving On Use Counts
12. Related Documentation
13. Individual Modules
13.1. Executable Interpreters
13.1.1. binfmt_aout: executable interpreter for a.out format
13.1.2. binfmt_elf: executable interpreter for ELF format
13.1.3. binfmt_java: executable interpreter for Java bytecode
13.2. Block Device Drivers
13.2.1. floppy: floppy disk driver
13.2.2. loop: loop device driver
13.2.3. linear: linear (non-RAID) disk array device driver
13.2.4. raid0: RAID-0 device driver
13.2.5. rd: ramdisk device driver
13.2.6. xd: XT disk device driver
13.3. SCSI Drivers
13.3.1. scsi_mod: SCSI mid-level driver
13.3.2. sd_mod: SCSI high-level driver for disk devices
13.3.3. st: SCSI high-level driver for tape devices
13.3.4. sr_mod: SCSI high-level driver for CD-ROM drives
13.3.5. sg: SCSI high-level driver for generic SCSI devices
13.3.6. wd7000: SCSI low-level driver for 7000FASST
13.3.7. aha154x: SCSI low-level driver for Adaptec AHA152X/2825
13.3.8. aha1542: SCSI low-level driver for Adaptec AHA1542
13.3.9. aha1740: SCSI low-level driver for Adaptec AHA1740 EISA
13.3.10. aic7xxx: SCSI low-level driver for Adaptec AHA274X/284X/294X
13.3.11. advansys: SCSI low-level driver for AdvanSys/
13.3.12. in2000: SCSI low-level driver for Always IN2000
13.3.13. BusLogic: SCSI low-level driver for BusLogic
13.3.14. dtc: SCSI low-level driver for DTC3180/3280
13.3.15. eata: SCSI low-level driver for EATA ISA/EISA
13.3.16. eata_dma: SCSI low-level driver for EATA-DMA
13.3.17. eata_pio: SCSI low-level driver for EATA-PIO
13.3.18. fdomain: SCSI low-level driver for Future Domain 16xx
13.3.19. NCR5380: SCSI low-level driver for NCR5380/53c400
13.3.20. NCR53c406a: SCSI low-level driver for NCR53c406a
13.3.21. 53c7,8xx.o: SCSI low-level driver for NCR53c7,8xx
13.3.22. ncr53c8xx: SCSI low-level driver for PCI-SCS NCR538xx family
13.3.23. ppa: low-level SCSI driver for IOMEGA parallel port ZIP drive
13.3.24. pas16: SCSI low-level driver for PAS16
13.3.25. qlogicfas: SCSI low-level driver for Qlogic FAS
13.3.26. qlogicisp: SCSI low-level driver for Qlogic ISP
13.3.27. seagate: SCSI low-level driver for Seagate, Future Domain
13.3.28. t128: SCSI low-level driver for Trantor T128/T128F/T228
13.3.29. u14-34f: SCSI low-level driver for UltraStor 14F/34F
13.3.30. ultrastor: low-level SCSI driver for UltraStor
13.4. Network Device Drivers
13.4.1. bsd_comp: optional BSD compressor for PPP
13.4.2. slhc: SLHC compressor for PPP
13.4.3. 8390: General NS8390 Ethernet driver core
13.4.4. dummy: Dummy network interface driver
13.4.5. eql: serial line load balancer
13.4.6. dlci: frame relay DLCI driver
13.4.7. sdla: Sangoma S502A FRAD driver
13.4.8. plip: PLIP network interface driver
13.4.9. ppp: PPP network protocol driver
13.4.10. slip: SLIP network protocol driver
13.4.11. baycom: BAYCOM AX.25 amateur radio driver
13.4.12. strip: STRIP (Metricom starmode radio IP) driver
13.4.13. wavelan: WaveLAN driver
13.4.14. wic: WIC Radio IP bridge driver
13.4.15. scc: Z8530 SCC kiss emulation driver
13.4.16. 3c501: 3COM 3c501 Ethernet driver
13.4.17. 3c503: 3COM 3c503 driver
13.4.18. 3c505: 3COM 3c505 driver
13.4.19. 3c507: 3COM 3c507 driver
13.4.20. 3c509: 3COM 3c509/3c579 driver
13.4.21. 3c59x: 3COM 3c590 series "Vortex" driver
13.4.22. wd: Western Digital/SMC WD80*3 driver
13.4.23. smc-ultra: SMC Ultra/EtherEZ driver
13.4.24. smc9194: SMC 9194 driver
13.4.25. at1700: AT1700 driver
13.4.26. e2100: Cabletron E21xx driver
13.4.27. depca: DEPCA, DE10x, DE200, DE201, DE202, DE422 driver
13.4.28. ewrk3: EtherWORKS 3 (DE203, DE204, DE205) driver
13.4.29. eexpress: EtherExpress 16 driver
13.4.30. eepro: EtherExpressPro driver
13.4.31. fmv18k: Fujitsu FMV-181/182/183/184 driver
13.4.32. hp-plus: HP PCLAN+ (27247B and 27252A) driver
13.4.33. hp: HP PCLAN (27245, 27xxx) driver
13.4.34. hp100: HP 10/100VG PCLAN (ISA, EISA, PCI) driver
13.4.35. eth16i: ICL EtherTeam 16i/32 driver
13.4.36. ne: NE2000/NE1000 driver
13.4.37. ni52: NI5210 driver
13.4.38. ac3200: Ansel Communications EISA 3200 driver
13.4.39. apricot: Apricot Xen-II on board ethernet driver
13.4.40. de4x5: DE425, DE434, DE435, DE450, DE500 driver
13.4.41. tulip: DECchip Tulip (dc21x4x) PCI driver
13.4.42. dgrs: Digi Intl RightSwitch SE-X driver
13.4.43. de600: D-Link DE600 pocket adapter driver
13.4.44. de620: D-Link DE620 pocket adapter driver
13.4.45. ibmtr: Tropic chipset based token ring adapter driver
13.4.46. arcnet: ARCnet driver
13.4.47. isdn: basic ISDN functions
13.4.48. icn: ICN 2B and 4B driver
13.4.49. pcbit: PCBIT-D driver
13.4.50. teles: Teles/NICCY1016PC/Creatix driver
13.5. CDROM Device Drivers
13.5.1. axtcd: Aztech/Orchid/Okano/Wearnes/TXC/CDROM driver
13.5.2. gscd: Goldstar R420 CDROM driver
13.5.3. sbpcd: Sound Blaster CDROM driver
13.5.4. mcd: Mitsumi CDROM driver
13.5.5. mcdx: Mitsumi XA/MultiSession driver
13.5.6. optcd: Optics Storage DOLPHIN 8000AT CDROM driver
13.5.7. cm206: Philips/LMS CM206 CDROM driver
13.5.8. sjcd: Sanyo CDR-H94A CDROM driver
13.5.9. isp16: ISP16/MAD16/Mozart soft configurable cdrom driver
13.5.10. cdu31a: Sony CDU31A/CDU33A CDROM driver
13.5.11. sonycd535: Sony CDU535 CDROM driver
13.6. Filesystem Drivers
13.6.1. minix: Minix filesystem driver
13.6.2. ext: "Extended" filesystem driver
13.6.3. ext2: "Second extended" filessystem driver
13.6.4. xiafs: xiafs filesystem driver
13.6.5. fat: DOS FAT filesystem functions
13.6.6. msdos: MSDOS filesystem driver
13.6.7. vfat: VFAT (Windows-95) filesystem driver
13.6.8. umsdos: UMSDOS filesystem driver
13.6.9. nfs: NFS filesystem driver
13.6.10. smbfs: SMB filesystem driver
13.6.11. ncpfs: NCP (Netware) filesystem driver
13.6.12. isofs: ISO 9660 (CDROM) filesystem driver
13.6.13. hpfs: OS/2 HPFS filesystem driver
13.6.14. sysv: System V and Coherent filesystem driver
13.6.15. affs: Amiga FFS filesystem driver
13.6.16. ufs: UFS filesystem driver
13.7. Miscellaneous Device Driver
13.7.1. misc: device driver for "miscellaneous" character devices
13.8. Serial Device Drivers
13.8.1. serial: serial communication port (UART) device driver
13.8.2. cyclades: Cyclades async mux device driver
13.8.3. stallion: Stallion EasyIO or EC8/32 device driver
13.8.4. istallion: Stallion EC8/64, ONboard, Brumby device driver
13.8.5. riscom8: SDL RISCom/8 card device driver
13.9. Parallel Device Drivers
13.9.1. lp: Parallel printer device driver
13.10. Bus Mouse Device Drivers
13.10.1. atixlmouse: ATIXL busmouse driver
13.10.2. busmouse: Logitech busmouse driver
13.10.3. msbusmouse: Microsoft busmouse driver
13.10.4. psaux: PS/2 mouse (aka "auxiliary device") driver
13.11. Tape Device Drivers
13.11.1. ftape: floppy tape (QIC-80/Travan) device driver
13.12. Watchdog Timers
13.12.1. WDT: WDT Watchdog timer device driver
13.12.2. softdog: Software Watchdog Timer
13.12.3. pcwd: Berkshire Products PC Watchdog Driver
13.13. Sound Device Drivers
14. Maintenance Of This Document
15. History
16. Copyright