1.\" $NetBSD: modload.8,v 1.7 1997/09/15 09:27:53 darrenr Exp $ 2.\" 3.\" Copyright (c) 1993 Christopher G. Demetriou 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. The name of the author may not be used to endorse or promote products 15.\" derived from this software without specific prior written permission 16.\" 17.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 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 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'. If `xxxinit' cannot be 71found, an attempt to use `<module_name>_lkmentry' will be made, where 72<module_name> is the filename being loaded without the `.o'. 73.It Fl p Ar postinstall 74Specify the name of a shell script or program that will 75be executed if the module is successfully loaded. It 76is always passed the module id (in decimal) and module 77type (in hexadecimal) as the first two arguments. 78For loadable drivers, the third argument is 79the block or character major device number. 80For a loadable system call, the third argument is the system 81call number. 82.It Fl o Ar output_file 83Specify the name of the output file that is produced by 84the linker. 85.El 86.Sh FILES 87.Bl -tag -width /usr/include/sys/lkm.h -compact 88.It Pa /netbsd 89default file passed to the linker to resolve external 90references in the module 91.It Pa /usr/include/sys/lkm.h 92file containing definitions of module types 93.\" .It Pa output file. 94.\" default output file name 95.Sh DIAGNOSTICS 96The 97.Nm 98utility exits with a status of 0 on success 99and with a nonzero status if an error occurs. 100.Sh SEE ALSO 101.Xr ld 1 , 102.Xr lkm 4 , 103.Xr modstat 8 , 104.Xr modunload 8 105.Sh HISTORY 106The 107.Nm 108command was designed to be similar in functionality 109to the corresponding command in 110.Tn "SunOS 4.1.3" . 111.Sh AUTHOR 112.Bl -tag 113Terrence R. Lambert, terry@cs.weber.edu 114.El 115.Sh BUGS 116The loadable device driver framework can 117only reserve either a character or block device entry, not both. 118