xref: /netbsd-src/sbin/modload/modload.8 (revision ae9172d6cd9432a6a1a56760d86b32c57a66c39c)
1.\" Copyright (c) 1993 Christopher G. Demetriou
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
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
14.\"
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.
25.\"
26.\"	$Id: modload.8,v 1.4 1994/09/18 19:53:44 mycroft Exp $
27.\"
28.Dd June 7, 1993
29.Dt MODLOAD 8
30.Os NetBSD 0.8a
31.Sh NAME
32.Nm modload
33.Nd load a kernel module
34.Sh SYNOPSIS
35.Nm modload
36.Op Fl dv
37.Op Fl A Ar kernel
38.Op Fl e Ar entry
39.Op Fl p Ar postinstall
40.Op Fl o Ar output_file
41.Ar input_file
42.Sh DESCRIPTION
43The
44.Nm
45utility loads a loadable kernel module into a running system.
46The input file is an object file (.o file).
47.Pp
48The options to
49.Nm
50are as follows:
51.Bl -tag -width indent
52.It Fl d
53Debug.  Used to debug
54.Nm
55itself.
56.It Fl v
57Print comments about the loading process.
58.It Fl A Ar kernel
59Specify the file that is passed to the linker
60to resolve module references to external symbols.
61The symbol file must be for the currently running
62kernel or the module is likely to crash the system.
63.It Fl e Ar entry
64Specify the module entry point.
65This is passed by
66.Nm
67to
68.Xr ld 1
69when the module is linked.
70The default module entry point name is `xxxinit'.
71.It Fl p Ar postinstall
72Specify the name of a shell script or program that will
73be executed if the module is successfully loaded. It
74is always passed the module id (in decimal) and module
75type (in hexadecimal) as the first two arguments.
76For loadable drivers, the third argument is
77the block or character major device number.
78For a loadable system call, the third argument is the system
79call number.
80.It Fl o Ar output_file
81Specify the name of the output file that is produced by
82the linker.
83.El
84.Sh FILES
85.Bl -tag -width /usr/include/sys/lkm.h -compact
86.It Pa /netbsd
87default file passed to the linker to resolve external
88references in the module
89.It Pa /usr/include/sys/lkm.h
90file containing definitions of module types
91.\" .It Pa output file.
92.\" default output file name
93.Sh DIAGNOSTICS
94The
95.Nm
96utility exits with a status of 0 on success
97and with a nonzero status if an error occurs.
98.Sh SEE ALSO
99.Xr ld 1 ,
100.Xr lkm 4 ,
101.Xr modstat 8 ,
102.Xr modunload 8
103.Sh HISTORY
104The
105.Nm
106command was designed to be similar in functionality
107to the corresponding command in
108.Tn "SunOS 4.1.3" .
109.Sh AUTHOR
110.Bl -tag
111Terrence R. Lambert, terry@cs.weber.edu
112.El
113.Sh BUGS
114The loadable device driver framework can
115only reserve either a character or block device entry, not both.
116