add LKM man pages

This commit is contained in:
cgd 1993-06-08 03:07:11 +00:00
parent 0b53d95ea7
commit 52de859428
8 changed files with 416 additions and 8 deletions

View File

@ -33,11 +33,11 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $Id: Makefile,v 1.1 1993/06/07 19:52:10 cgd Exp $
# $Id: Makefile,v 1.2 1993/06/08 03:07:11 cgd Exp $
#
PROG= modload
CFLAGS=-DKERNEL
NOMAN= noman
MAN8= modload.0
.include <bsd.prog.mk>

115
sbin/modload/modload.8 Normal file
View File

@ -0,0 +1,115 @@
.\" Copyright (c) 1993 Christopher G. Demetriou
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. The name of the author may not be used to endorse or promote products
.\" derived from this software withough specific prior written permission
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $Id: modload.8,v 1.1 1993/06/08 03:07:14 cgd Exp $
.\"
.Dd June 7, 1993
.Dt MODLOAD 8
.Os NetBSD 0.8a
.Sh NAME
.Nm modload
.Nd load a kernel module
.Sh SYNOPSIS
.Nm modload
.Op Fl dv
.Op Fl A Ar kernel
.Op Fl e Ar entry
.Op Fl p Ar postinstall
.Op Fl o Ar output_file
.Ar input_file
.Sh DESCRIPTION
The
.Nm
utility loads a loadable kernel module into a running system.
The input file is an object file (.o file).
.Pp
The options to
.Nm
are as follows:
.Bl -tag -width indent
.It Fl d
Debug. Used to debug
.Nm
itself.
.It Fl v
Print comments about the loading process.
.It Fl A Ar kernel
Specify the file that is passed to the linker
to resolve module references to external symbols.
The symbol file must be for the currently running
kernel or the module is likely to crash the system.
.It Fl e Ar entry
Specify the module entry point.
This is passed by
.Nm
to
.Xr ld 1
when the module is linked.
The default module entry point name is `xxxinit'.
.It Fl p Ar postinstall
Specify the name of a shell script or program that will
be executed if the module is successfully loaded. It
is always passed the module id (in decimal) and module
type (in hexidecimal) as the first two arguments.
For loadable drivers, the third and fourth arguments are
the block major and character major numbers respectively.
For a loadable systam call, the third argument is the system
call number.
.It Fl o Ar output_file
Specify the name of the output file that is produced by
the linker.
.El
.Sh FILES
.Bl -tag -width /usr/include/sys/lkm.h -compact
.It Pa /netbsd
default file passed to the linker to resolve external
references in the module
.It Pa /usr/include/sys/lkm.h
file containing defitions of module types
.\" .It Pa output file.
.\" default output file name
.Sh DIAGNOSTICS
The
.Nm
utility exits with a status of 0 on success
and with a nonzero status if an error occurs.
.Sh SEE ALSO
.Xr ld 1 ,
.Xr lkm 4 ,
.Xr modunload 8 ,
.Xr modstat 8
.Sh HISTORY
The
.Nm
command was designed to be similar in functionality
to the corresponding command in
.Tn "SunOS 4.1.3" .
.Sh AUTHOR
.Bl -tag
Terrence R. Lambert, terry@cs.weber.edu
.El
.Sh BUGS
Loadable streams modules and loadable execution interpreters
are not currently supported.

View File

@ -33,11 +33,11 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $Id: Makefile,v 1.1 1993/06/07 19:52:14 cgd Exp $
# $Id: Makefile,v 1.2 1993/06/08 03:07:18 cgd Exp $
#
PROG= modunload
CFLAGS=-DKERNEL
NOMAN= noman
MAN8= modunload.0
.include <bsd.prog.mk>

View File

@ -0,0 +1,76 @@
.\" Copyright (c) 1993 Christopher G. Demetriou
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. The name of the author may not be used to endorse or promote products
.\" derived from this software withough specific prior written permission
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $Id: modunload.8,v 1.1 1993/06/08 03:07:20 cgd Exp $
.\"
.Dd June 7, 1993
.Dt MODUNLOAD 8
.Os NetBSD 0.8a
.Sh NAME
.Nm modunload
.Nd unload a kernel module
.Sh SYNOPSIS
.Nm modunload
.Op Fl i Ar id
.Op Fl n Ar name
.Sh DESCRIPTION
The
.Nm
utility unloads a loadable kernel module from a running system.
The
.Ar id
or
.Ar name
is the ID or name of the module as shown by
.Xr modstat 8 .
.Pp
One of the following options must be specified:
.Bl -tag -width indent
.It Fl i Ar id
Unload the module with the ID
.Ar id .
.It Fl n Ar name
Unload the module with the name
.Ar name .
.El
.Sh DIAGNOSTICS
The
.Nm
utility exits with a status of 0 on success
and with a nonzero status if an error occurs.
.Sh SEE ALSO
.Xr lkm 4 ,
.Xr modunload 8 ,
.Xr modstat 8
.Sh HISTORY
The
.Nm
command was designed to be similar in functionality
to the corresponding command in
.Tn "SunOS 4.1.3" .
.Sh AUTHOR
.Bl -tag
Terrence R. Lambert, terry@cs.weber.edu
.El

View File

@ -1,8 +1,8 @@
# @(#)Makefile 5.13.1.1 (Berkeley) 5/7/91
MAN4= bpf.0 clnp.0 cltp.0 drum.0 esis.0 fd.0 icmp.0 idp.0 imp.0 inet.0 \
ip.0 iso.0 kadb.0 lo.0 netintro.0 ns.0 nsip.0 null.0 pty.0 route.0 \
spp.0 tcp.0 termios.0 tp.0 udp.0 unix.0
ip.0 iso.0 kadb.0 lkm.0 lo.0 netintro.0 ns.0 nsip.0 null.0 pty.0 \
route.0 spp.0 tcp.0 termios.0 tp.0 udp.0 unix.0
MLINKS= netintro.4 networking.4
SUBDIR= man4.hp300 man4.tahoe man4.vax man4.i386

148
share/man/man4/lkm.4 Normal file
View File

@ -0,0 +1,148 @@
.\" Copyright (c) 1993 Christopher G. Demetriou
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. The name of the author may not be used to endorse or promote products
.\" derived from this software withough specific prior written permission
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $Id: lkm.4,v 1.1 1993/06/08 03:07:33 cgd Exp $
.\"
.Dd June 7, 1993
.Dt LKM 4
.Os NetBSD 0.8a
.Sh NAME
.Nm LKM
.Nd Loadable Kernel Modules interface
.Sh SYNOPSIS
.Cd "options LKM"
.Sh DESCRIPTION
Loadable kernel modules allow the system administrator to
dynamically add and remove functionality from a running system.
This ability also helps software developers to develop
new parts of the kernel without constantly rebooting to
test their changes.
.Pp
Various types of modules can be loaded into the sytem.
There are several defined module types, listed below, which can
be added to the system in a predefined way. In addition, there
is a generic type, for which the module itself handles loading and
unloading.
.Pp
The
.Nm
interface is used by performing
.Xr ioctl 2
calls on the
.Pa /dev/lkm
device. Normally all operations involving
Loadable Kernel Modules are handled by the
.Xr modload 8 ,
.Xr modunload 8 ,
and
.Xr modstat 8
programs. Users should never have to interact with
.Pa /dev/lkm
directly.
.Sh "MODULE TYPES"
.Bl -tag -width indent
.It System Call modules
System calls may be replaced by loading
new ones via the
.Nm
interface. All system calls may be
replaced, but special care should
be taken with the
.Xr ioctl 2
system call, as it is used to load and
unload modules.
.Pp
When a system call module is unloaded,
the system call which
was replaced by the loadable module
is returned to its rightful place
in the system call table.
.It Virtual File System modules
Virtual file systems may be added
via the
.Nm
interface. At this time, only
file systems which are already
known to the system can be added,
because of the way the
.Xr mount 2
system call is implemented.
.It Device Driver modules
New block and character device
drivers may be loaded into the system with
.Nm LKM .
The major problem with loading
a device driver is that the driver's
device nodes must be exist for the
devices to be accessed. They are usually
created by instructing
.Xr modload 8
to run an appropriate program when
the driver has been successfully loaded.
.It Execution Interpreters
Execution interpreters allow
the loading and execution of
binaries which are normally not
usable by the operating system.
.It Miscellaneous modules
Miscellaneous modules are modules
for which there are not currently
well-defined or well-used interfaces
for extension. The user is expected
to write their own loader to manipulate
whatever kernel data structures necessary
to enable and disable the new module
when it is loaded and unloaded.
.El
.Sh FILES
.Bl -tag -width /usr/include/sys/lkm.h -compact
.It Pa /dev/lkm
.Nm
interface device
.It Pa /usr/include/sys/lkm.h
file containing defitions of module types
.It Pa /usr/share/lkm
example source code implementing several of the modules types
.Sh SEE ALSO
.Xr modload 8 ,
.Xr modunload 8 ,
.Xr modstat 8
.Sh HISTORY
The
.Nm
facility was designed to be similar in functionality
to the loadable kernel modules facility provided by
.Tn "SunOS 4.1.3" .
.Sh AUTHOR
.Bl -tag
Terrence R. Lambert, terry@cs.weber.edu
.El
.Sh BUGS
Loading a bogus module is likely to kill your machine.
.Pp
Loadable streams modules should and will be implemented
when a streams implementation is written.
.Pp
Loadable execution interpreters are not currently supported.

View File

@ -33,12 +33,12 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $Id: Makefile,v 1.1 1993/06/07 19:52:57 cgd Exp $
# $Id: Makefile,v 1.2 1993/06/08 03:07:23 cgd Exp $
#
PROG= modstat
CFLAGS=-DKERNEL
NOMAN= noman
MAN8= modstat.0
BINGRP= kmem
BINMODE=2555

69
usr.bin/modstat/modstat.8 Normal file
View File

@ -0,0 +1,69 @@
.\" Copyright (c) 1993 Christopher G. Demetriou
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. The name of the author may not be used to endorse or promote products
.\" derived from this software withough specific prior written permission
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $Id: modstat.8,v 1.1 1993/06/08 03:07:25 cgd Exp $
.\"
.Dd June 7, 1993
.Dt MODSTAT 8
.Os NetBSD 0.8a
.Sh NAME
.Nm modstat
.Nd display status of loaded kernel modules
.Sh SYNOPSIS
.Nm modstat
.Op Fl i Ar id
.Op Fl n Ar name
.Sh DESCRIPTION
The
.Nm
utility displays the status of any loadable kernel modules
present in the kernel.
.Pp
The options are as follows:
.Bl -tag -width indent
.It Fl i Ar id
Display the status of only the module with this ID.
.It Fl n Ar name
Display the status of only the module with this name.
.El
.Sh DIAGNOSTICS
The
.Nm
utility exits with a status of 0 on success
and with a nonzero status if an error occurs.
.Sh SEE ALSO
.Xr lkm 4 ,
.Xr modunload 8 ,
.Xr modstat 8
.Sh HISTORY
The
.Nm
command was designed to be similar in functionality
to the corresponding command in
.Tn "SunOS 4.1.3" .
.Sh AUTHOR
.Bl -tag
Terrence R. Lambert, terry@cs.weber.edu
.El