1 .\" Copyright (c) 1993 Christopher G. Demetriou
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. The name of the author may not be used to endorse or promote products
13 .\" derived from this software without specific prior written permission
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 .\" $FreeBSD: src/share/man/man4/kld.4,v 1.5.2.6 2001/08/17 13:08:38 ru Exp $
27 .\" $DragonFly: src/share/man/man4/kld.4,v 1.8 2008/09/02 11:50:46 matthias Exp $
34 .Nd dynamic kernel linker facility
36 The LKM (Loadable Kernel Modules) facility has been deprecated in
38 and above in favor of the
41 This interface, like its
42 predecessor, allows the system administrator to dynamically add and remove
43 functionality from a running system.
44 This ability also helps software
45 developers to develop new parts of the kernel without constantly rebooting
46 to test their changes.
48 Various types of modules can be loaded into the system.
49 There are several defined module types, listed below, which can
50 be added to the system in a predefined way.
52 is a generic type, for which the module itself handles loading and
57 system makes extensive use of loadable kernel modules, and provides loadable
58 versions of most filesystems, the
60 client and server, all the screen-savers, and the
64 modules are placed by default in the
70 interface is used through the
79 program can load either
81 or ELF formatted loadable modules.
84 program unloads any given loaded module, if no other module is dependent
85 upon the given module.
88 program is used to check the status of the modules currently loaded into the
91 .Bl -tag -width ".In sys/module.h" -compact
93 directory containing module binaries shipped with the system
95 file containing definitions required to compile a
98 .It Pa /usr/share/examples/kld
99 example source code implementing a sample kld module
116 and was designed as a replacement for the
118 facility, which was similar in functionality to the loadable kernel modules
125 facility was originally implemented by
126 .An Doug Rabson Aq dfr@FreeBSD.org .
128 If a module B, is dependent on another module A, but is not compiled with
129 module A as a dependency, then
131 fails to load module B, even if module A is already present in the system.
133 If multiple modules are dependent on module A, and are compiled with module
134 A as a dependency, then
136 loads an instance of module A when any of the modules are loaded.
138 If a custom entry point is used for a module, and the module is compiled as
143 fails to execute the entry point.
146 returns the cryptic message
147 .Sq Li "Exec format error"
148 for any error encountered while loading a module.
150 When system internal interfaces change, old modules often cannot
151 detect this, and such modules when loaded will often cause crashes or