Linux Loadable Kernel Module HOWTO

Total Page:16

File Type:pdf, Size:1020Kb

Linux Loadable Kernel Module HOWTO Linux Loadable Kernel Module HOWTO Bryan Henderson 21 May 2002 Revision History Revision v1.02 2002−05−21 Revised 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.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. Linux Loadable Kernel Module HOWTO Table of Contents 1. Preface..............................................................................................................................................................1 2. Introduction to Linux Loadable Kernel Modules........................................................................................2 2.1. Terminology......................................................................................................................................2 2.2. History of Loadable Kernel Modules...............................................................................................2 2.3. The Case For Loadable Kernel Modules..........................................................................................3 2.4. What LKMs Can't Do.......................................................................................................................3 2.5. What LKMs Are Used For................................................................................................................3 3. Making Loadable Kernel Modules................................................................................................................5 4. LKM Utilities...................................................................................................................................................6 5. How To Insert And Remove LKMs..............................................................................................................7 5.1. Could Not Find Kernel Version........................................................................................................8 5.2. Intelligent Loading Of LKMs − Modprobe......................................................................................8 5.3. Automatic LKM Loading and Unloading.........................................................................................9 5.3.1. Automatic Loading...........................................................................................................9 5.3.2. Automatic Unloading − Autoclean.................................................................................11 5.4. /proc/modules..................................................................................................................................11 5.5. Where Are My LKM Files On My System?...................................................................................12 6. Unresolved Symbols......................................................................................................................................13 6.1. Some LKMs Prerequire Other LKMs.............................................................................................13 6.2. An LKM Must Match The Base Kernel.........................................................................................13 6.3. If You Run Multiple Kernels..........................................................................................................14 6.4. SMP symbols..................................................................................................................................15 6.5. You Are Not Licensed To Access The Symbol..............................................................................15 6.6. An LKM Must Match Prerequisite LKMs......................................................................................15 7. How To Boot Without A Disk Device Driver.............................................................................................17 8. About Module Parameters...........................................................................................................................18 9. Persistent Data..............................................................................................................................................19 10. Technical Details.........................................................................................................................................20 10.1. How They Work...........................................................................................................................20 10.2. The .modinfo Section....................................................................................................................20 10.3. The __ksymtab And .kstrtab Sections..........................................................................................21 10.4. Ksymoops Symbols......................................................................................................................21 10.5. Other Symbols..............................................................................................................................22 10.6. Memory Allocation For Loading..................................................................................................22 10.7. Linux internals..............................................................................................................................23 11. Writing Your Own Loadable Kernel Module..........................................................................................24 11.1. bug in hello.c.................................................................................................................................24 11.2. Rubini Corbet: Linux Device Drivers.......................................................................................25 i Linux Loadable Kernel Module HOWTO Table of Contents 11.3. Improving On Use Counts............................................................................................................25 12. Related Documentation..............................................................................................................................26 13. Individual Modules.....................................................................................................................................27 13.1. Executable Interpreters.................................................................................................................27 13.1.1. binfmt_aout: executable interpreter for a.out format....................................................27 13.1.2. binfmt_elf: executable interpreter for ELF format.......................................................27 13.1.3. binfmt_java: executable interpreter for Java bytecode.................................................28 13.2. Block Device Drivers....................................................................................................................28 13.2.1. floppy: floppy disk driver.............................................................................................28 13.2.2. loop: loop device driver................................................................................................32 13.2.3. linear: linear (non−RAID) disk array device driver......................................................33 13.2.4. raid0: RAID−0 device driver........................................................................................33 13.2.5. rd: ramdisk device driver..............................................................................................33 13.2.6. xd: XT disk device driver.............................................................................................34 13.3. SCSI Drivers.................................................................................................................................34 13.3.1. scsi_mod: SCSI mid−level driver.................................................................................35 13.3.2. sd_mod: SCSI high−level driver for disk devices........................................................35 13.3.3. st: SCSI high−level driver for tape devices..................................................................36 13.3.4. sr_mod: SCSI high−level driver for CD−ROM drives.................................................36 13.3.5. sg: SCSI high−level driver for generic SCSI devices...................................................36 13.3.6. wd7000: SCSI low−level driver for 7000FASST.........................................................36 13.3.7. aha154x: SCSI low−level driver for Adaptec AHA152X/2825...................................37 13.3.8. aha1542: SCSI low−level driver for Adaptec AHA1542.............................................37 13.3.9. aha1740: SCSI low−level driver for Adaptec AHA1740 EISA...................................37 13.3.10. aic7xxx: SCSI low−level driver for Adaptec AHA274X/284X/294X.......................37 13.3.11. advansys: SCSI low−level driver for AdvanSys/Connect.com..................................38 13.3.12. in2000: SCSI low−level driver
Recommended publications
  • Linux Hardware Compatibility HOWTO
    Linux Hardware Compatibility HOWTO Steven Pritchard Southern Illinois Linux Users Group [email protected] 3.1.5 Copyright © 2001−2002 by Steven Pritchard Copyright © 1997−1999 by Patrick Reijnen 2002−03−28 This document attempts to list most of the hardware known to be either supported or unsupported under Linux. Linux Hardware Compatibility HOWTO Table of Contents 1. Introduction.....................................................................................................................................................1 1.1. Notes on binary−only drivers...........................................................................................................1 1.2. Notes on commercial drivers............................................................................................................1 1.3. System architectures.........................................................................................................................1 1.4. Related sources of information.........................................................................................................2 1.5. Known problems with this document...............................................................................................2 1.6. New versions of this document.........................................................................................................2 1.7. Feedback and corrections..................................................................................................................3 1.8. Acknowledgments.............................................................................................................................3
    [Show full text]
  • PC 98 System Design Guide
    APPENDIX B Device Identifiers This appendix lists CompatibleIDs for Plug and Play vendor IDs and device IDs. Note: For non-BIOS enumerated Industry Standard Architecture (ISA) devices, new vendor IDs must be registered by sending e-mail to [email protected]. Contents Plug and Play Vendor and Device IDs....................................................... 372 Generic Windows Device IDs................................................................ 373 Interrupt Controllers ...................................................................... 374 Timers...................................................................................... 374 DMA....................................................................................... 374 Keyboards.................................................................................. 374 Parallel Devices ........................................................................... 375 Serial Devices ............................................................................. 375 Disk Controllers........................................................................... 376 Display Adapters.......................................................................... 376 Peripheral Buses........................................................................... 377 Real-Time Clock, BIOS, and System Board Devices................................... 377 PCMCIA Controller Chip Sets........................................................... 378 Mouse.....................................................................................
    [Show full text]
  • Configuration Parameters
    Good news, everyone! User Documentation Version: 2020-01-01 M. Brutman ([email protected]) http://www.brutman.com/mTCP/ Table of Contents Introduction and Setup Introduction..............................................................................................................................................................8 What is mTCP?...................................................................................................................................................8 Features...............................................................................................................................................................8 Tested machines/environments...........................................................................................................................9 Licensing...........................................................................................................................................................10 Packaging..........................................................................................................................................................10 Binaries.....................................................................................................................................................................10 Documentation..........................................................................................................................................................11 Support and contact information.......................................................................................................................11
    [Show full text]
  • Flexible Internet Router for Linux
    fli4l – flexible internet router for linux Version 3.10.18 The fli4l-Team email: [email protected] September 15, 2019 Contents 1. Documentation of the base package 10 1.1. Introduction...................................... 10 2. Setup and Configuration 13 2.1. Unpacking the archives................................ 13 2.2. Configuration..................................... 14 2.2.1. Editing the configuration files........................ 14 2.2.2. Configuration via a special configuration file................ 15 2.2.3. Variables................................... 15 2.3. Setup flavours..................................... 15 2.3.1. Router on a USB-Stick............................ 16 2.3.2. Router on a CD, or network boot...................... 16 2.3.3. Type A: Router on hard disk—only one FAT partition.......... 16 2.3.4. Type B: Router on hard disk—one FAT and one ext3 partition..... 16 3. Base configuration 18 3.1. Example file...................................... 19 3.2. General settings.................................... 25 3.3. Console settings.................................... 30 3.4. Hints To Identify Problems And Errors...................... 31 3.5. Usage of a customized /etc/inittab......................... 32 3.6. Localized keyboard layouts............................. 32 3.7. Ethernet network adapter drivers.......................... 33 3.8. Networks....................................... 42 3.9. Additional routes (optional)............................. 44 3.10. The Packet Filter................................... 44 3.10.1. Packet Filter
    [Show full text]
  • Ldiddenu.Pdf
    Installation Information File Specification October 12, 1999 Novell Confidential doc_tpl.fm Rev 99a 27 August 99 Legal Notices Novell, Inc. makes no representations or warranties with respect to the contents or use of this documentation, and specifically disclaims any express or implied warranties of merchantability or fitness for any particular purpose. Further, Novell, Inc. reserves the right to revise this publication and to make changes to its content, at any time, without obligation to notify any person or entity of such revisions or changes. Further, Novell, Inc. makes no representations or warranties with respect to any software, and specifically disclaims any express or implied warranties of merchantability or fitness for any particular purpose. Further, Novell, Inc. reserves the right to make changes to any and all parts of Novell software, at any time, without any obligation to notify any person or entity of such changes. This product may require export authorization from the U.S. Department of Commerce prior to exporting from the U.S. or Canada. Copyright © 1993-1999 Novell, Inc. All rights reserved. No part of this publication may be reproduced, photocopied, stored on a retrieval system, or transmitted without the express written consent of the publisher. U.S. Patent Nos 5,553,139; 5,553,143; 5,677,851; 5,758,069; 5,784,560; 5,818,936; 5,864,865; 5,903,650; 5,905,860; 5,910,803 and other Patents Pending. Novell, Inc. 122 East 1700 South Provo, UT 84606 U.S.A. www.novell.com Installation Information File Specification November 1999 104-000190-001 Online Documentation: To access the online documentation for this and other Novell developer products, and to get updates, see developer.novell.com/ndk.
    [Show full text]
  • Blancco Erasure Sw 4.10 Hardware Support
    BLANCCO ERASURE SW 4.10 HARDWARE SUPPORT Blancco Ltd Länsikatu 15 FIN-80110 JOENSUU, FINLAND [email protected] Tel. +358-207-433-850 [email protected] Tel. +358-207-433-860 Fax +358-207-433-859 PAGE 1/74 Blancco Erasure SW v4.10 hardware support 30/06/2009 TABLE OF CONTENTS Mass storage controllers ....................................................................................................10 SCSI ......................................................................................................................................10 Adaptec .......................................................................................................................... 10 Advanced Micro Devices [AMD] ..................................................................................... 12 Advanced System Products, Inc..................................................................................... 12 Areca Technology Corp. .................................................................................................12 Artop Electronic Corp......................................................................................................12 BusLogic......................................................................................................................... 12 DTC Technology Corp. ...................................................................................................12 Digital Equipment Corporation ........................................................................................ 12 Future Domain Corp.
    [Show full text]
  • Linux Hardware Compatibility HOWTO Linux Hardware Compatibility HOWTO
    Linux Hardware Compatibility HOWTO Linux Hardware Compatibility HOWTO Table of Contents Linux Hardware Compatibility HOWTO........................................................................................................1 Patrick Reijnen, <[email protected] (remove both "antispam.")>..1 1.Introduction...........................................................................................................................................1 2.Computers/Motherboards/BIOS...........................................................................................................1 3.Laptops..................................................................................................................................................1 4.CPU/FPU..............................................................................................................................................1 5.Memory.................................................................................................................................................1 6.Video cards...........................................................................................................................................2 7.Controllers (hard drive).........................................................................................................................2 8.Controllers (hard drive RAID)..............................................................................................................2 9.Controllers (SCSI)................................................................................................................................2
    [Show full text]
  • Suse Linux / Installation
    Leah Cunningham, Karl Eichwalder, Stefan Fent, Werner Fink, Peter Findeisen, Dennis Geider, Viviane Glanz, Carsten Groß, Roland Haidl, Björn Jacke, Richard Jelinek, Hubert Mantel, Johannes Meixner, Edith Parzefall, Peter Pöml, Peter Reinhart, Marc Rührschneck, Thomas Schraitle, Klaus G. Wagner, Christian Zoz SuSE Linux 7.2 System and Reference Manual SuSE Inc. 580 2nd Street, #210 Oakland, CA 94607 USA Toll free phone number within the US and Canada: 1-888-UR-LINUX (1-888-875-4689) Phone.: +1-510-628-3380 Fax.: +1-510-628-3381 e-mail: [email protected] [email protected] [email protected] WWW: http://www.suse.com Europe: SuSE Linux Ltd. The Kinetic Centre Theobald Street Borehamwood, WD6 4PJ UK Phone.: +44-20-8387-4088 Fax: +44-20-8387-4010 WWW: http://www.suse.co.uk SuSE GmbH Schanzäckerstr. 10 D-90443 Nürnberg Germany Tel.: +49-911-740-5331 Fax.: +49-911-741 77 55 e-mail: [email protected] WWW: http://www.suse.de Leah Cunningham, Karl Eichwalder, Stefan Fent, Werner Fink, Peter Findeisen, Dennis Geider, Viviane Glanz, Carsten Groß, Roland Haidl, Björn Jacke, Richard Jelinek, Hubert Mantel, Johannes Meixner, Edith Parzefall, Peter Pöml, Peter Reinhart, Marc Rührschneck, Thomas Schraitle, Klaus G. Wagner, Christian Zoz SuSE Linux 7.2 System and Reference Manual 1st edition 2001 SuSE GmbH Copyright This work is copyrighted by SuSE GmbH. You may copy it in whole or in part as long as the copies retain this copyright statement. Layout: LATEX English Translation and Editing: Rebecca Ellis, Marc Rührschneck Cover design based on graphics by Stephan Endraß. Design by Manuela Piotrowski.
    [Show full text]
  • Linux Como Servidor
    Carlos E. Morimoto http://www.guiadohardware.net 3º Edição 1 Prefácio Com a rápida expansão e evolução que estamos vendo, nunca é demais falar sobre o Linux. Este livro não tem como objetivo ser um guia altamente técnico, cheio de referências a scripts de configuração em Perl ou qualquer outra linguagem desconhecida muito menos um monte de RTFMs :-) Este é um Guia para quem está dando seus primeiros passos no Linux e deseja conhecer os recursos do sistema. Além dos processos de instalação e configuração, você conhecerá os principais aplicativos disponíveis, como configurar vídeo, som, impressora, rede e até mesmo os temíveis softmodems no Linux. Veremos ainda como interligar máquinas Linux e Windows em rede usando o Samba, como criar um poderoso servidor web com o Apache ou um servidor Proxy altamente configurável com o Squid. Você conhecerá ainda os vários serviços disponíveis no Linux, como configurar os principais arquivos de configuração, como acessar máquinas Linux remotamente via Telnet, SSH e VNC e ainda como configurar terminais leves e instalar o Linux em PCs antigos. O Linux é um mundo novo a ser explorado e espero que este livro possa ser um dos seus guias nesta jornada. 2 Direitos autorais e condições de distribuição Este e-book é livre distribuição. O objetivo é justamente poder ajudar de alguma forma quem está começando no Linux e retribuir à comunidade de código aberto a todos estes softwares extraordinários que hoje temos acesso. Assim como o Linux, este e-book está aqui para ser usado e distribuído :-) Envie cópias deste e-book para seus amigos, coloque-o para download em seu site, escreva para alguma revista sugerindo a inclusão no CD ou a indicação do link para download; enfim, ajude a fazer com que este trabalho chegue a quem quer aprender mais sobre o Linux.
    [Show full text]
  • CM312 Communications Utilitymodule™ User's Manual
    CM312 Communications utilityModule ™ User’s Manual BDM-610020017 Rev. B ISO9001 and AS9100 Certified CM312 Communications utilityModule ™ User’s Manual RTD Embedded Technologies, INC. 103 Innovation Blvd. State College, PA 16803-0906 Phone: +1-814-234-8087 FAX: +1-814-234-5218 E-mail [email protected] [email protected] web site http://www.rtd.com Revision History 08/07/2000 Initial release 12/01/2000 Added RS-422/485 enable bit in common register 4 6/5/2001 Changed RTD’s address 12/4/2001 Added drawing for RS-422/485 configuration Rev. A New Manual Naming Method Rev. B 02/26/2009 corrected cable kit name and corrected company name Published by: RTD Embedded Technologies, Inc. 103 Innovation Blvd. State College, PA 16803-0906 Copyright 1999, 2002, 2003 by RTD Embedded Technologies, Inc. All rights reserved Printed in U.S.A. The RTD Logo is a registered trademark of RTD Embedded Technologies. cpuModule and utilityModule are trademarks of RTD Embedded Technologies. PhoenixPICO and PheonixPICO BIOS are trademarks of Phoenix Technologies Ltd. PS/2, PC/XT, PC/AT and IBM are trademarks of International Business Machines Inc. MS- DOS, Windows, Windows 95, Windows 98 and Windows NT are trademarks of Microsoft Corp. PC/104 is a registered trademark of PC/104 Consortium. All other trademarks appearing in this document are the property of their respective owners. Table of Contents CHAPTER 1 INTRODUCTION ...................................................................................................................2 CM312 COMMUNICATIONS UTILITYMODULE
    [Show full text]
  • DOS Requester 1.02
    chapter 1 About the NetWare DOS Requester Overview This chapter introduces and briefly describes the NetWare DOS Requester. The following topics are covered in this chapter. Topic Page The New Workstation Software Components 1 Features of the NetWare DOS Requester 2 About the NetWare DOS Requester 3 The New Workstation Software Components The key components of the NetWare DOS and Windows environment are four terminate-and stay-resident (TSR) programs: ◆ LSL™ (Link Support Layer™) ◆ A LAN driver (example: NE2000™) ◆ IPXODI (Internetwork Packet Exchange™ Open Data Link Interface) ◆ NetWare DOS Requester (VLM.EXE and associated.VLM files) The NetWare DOS Requester replaces NETX. Almost all activity at the workstation now involves these four components. Figure 1-1 shows the difference between the NETX and the NetWare DOS Requester architectures. About the NetWare DOS Requester 1 Figure 1-1 NETX DOS Requester Comparison between NETX and NetWare DOS Requester NETX NETX.VLM DOS NetWare DOS Requester IPXODI DOS IPXODI Link Link Support Support Layer Layer LAN LAN driver driver Network Network board board Features of the NetWare DOS Requester The NetWare DOS Requester provides several improvements over NETX. It does the following: ◆ Provides a modular architecture that has advantages for current and future applications. ◆ Takes advantage of memory-swapping technology and DOS redirection capability. ◆ Includes Packet Burst protocol and Large Internet Packet (LIP). ◆ Supports the installed base of NetWare users by providing backward compatibility with NETX. ◆ Supports NetWare Directory Services™ in NetWare v4.0. 2 NetWare Workstation for DOS and Windows About the NetWare DOS Requester The NetWare DOS Requester consists of a number of files that provide NetWare support for a DOS workstation.
    [Show full text]
  • Linux Hardware Compatibility HOWTO
    Linux Hardware Compatibility HOWTO Steven Pritchard Southern Illinois Linux Users Group / K&S Pritchard Enterprises, Inc. <[email protected]> 3.2.4 Copyright © 2001−2007 Steven Pritchard Copyright © 1997−1999 Patrick Reijnen 2007−05−22 This document attempts to list most of the hardware known to be either supported or unsupported under Linux. Copyright This HOWTO is free documentation; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free software Foundation; either version 2 of the license, or (at your option) any later version. Linux Hardware Compatibility HOWTO Table of Contents 1. Introduction.....................................................................................................................................................1 1.1. Notes on binary−only drivers...........................................................................................................1 1.2. Notes on proprietary drivers.............................................................................................................1 1.3. System architectures.........................................................................................................................1 1.4. Related sources of information.........................................................................................................2 1.5. Known problems with this document...............................................................................................2 1.6. New versions of this document.........................................................................................................2
    [Show full text]