Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Feb 1999 12:57:34 +1030
From:      Greg Lehey <grog@lemis.com>
To:        John Smith <cr@eta.ee.fit.edu>, freebsd-questions@FreeBSD.ORG
Subject:   Re: /dev/lkm
Message-ID:  <19990224125734.V93492@lemis.com>
In-Reply-To: <Pine.LNX.3.96.990223163357.23290A-100000@eta.ee.fit.edu>; from John Smith on Tue, Feb 23, 1999 at 04:38:26PM -0500
References:  <Pine.LNX.3.96.990223163357.23290A-100000@eta.ee.fit.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
[moved to -questions]

On Tuesday, 23 February 1999 at 16:38:26 -0500, John Smith wrote:
>
>
> 	I am on 3.1; and when I try to do modload. i get /dev/lkm not
> configured.
>
> 	Do I need to compile my kernel with a special keyword so that it
> supports loadable kernel modules, (/dev/lkm exists); or lkm does not exist
> anymore?

This doesn't really qualify as an in-depth technical discussion, so
I'm moving it to -questions.

LKMs have gone away in 3.1, though support for them remains.  They've
been replaced by klds, for which unfortunately not much documentation
exists.  I'm attaching something that is going into a revised version
of ``The Complete FreeBSD''.

Greg

Kernel loadable modules
_______________________

Older versions of FreeBSD supplied Loadable  Kernel  Modules  or  LKMs,  object
files  which  could  be  loaded and executed in the kernel while the kernel was
running.  We discussed them in passing on page 294.

The ELF kernel and the new bootstrap of FreeBSD version 3  allow  you  to  load
additional  modules at boot time.  To do so, however, the format of the modules
needed to be changed.  To avoid (too much) confusion,  the  name  changed  from
loadable kernel module to kernel loadable module (kld).  FreeBSD still supports
LKMs as well, so klds are stored  in  a  different  directory  and  loaded  and
unloaded by different programs:

                 Table E-1.  Differences between LKMs and klds

                   +---------------+-----------+-----------+
                   |Parameter      | LKM       | kld       |
                   +---------------+-----------+-----------+
                   |Directory      | /lkm      | /modules  |
                   |Load program   | modload   | kldload   |
                   |Unload program | modunload | kldunload |
                   |List program   | modstat   | kldstat   |
                   +---------------+-----------+-----------+
Some  other  details  have changed as well.  kldload knows an internal path for
finding klds, so you don't need to specify the path.  It also assumes that  the
name  of  the  kld ends in .ko, and you don't need to specify that either.  For
example, to load the Linux emulator as an LKM, you might have entered:

# modload /lkm/linux_mod.o

To load the kld, you could enter:

# kldload linux

--
See complete headers for address, home page and phone numbers
finger grog@lemis.com for PGP public key


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990224125734.V93492>