Subject: Re: LKM support
To: None <current-users@NetBSD.ORG>
From: Jim Wise <>
List: current-users
Date: 11/06/1996 22:58:55
On Wed, 6 Nov 1996, Frank van der Linden wrote:

> Quoting Matthias Scheler,
> > Michael Graff said:
> > > IMHO, mount should try to mount, and if the FS isn't compiled in, try to
> > > modload it, then mount again.  That would make everything happy, no?  :)
> > > And this functionality should be put into a library.
> > Hmmm... some kind of if-a-kernel-feature-is-not-there-try-to-modload-it-call?
> > Not bad... but how should the interface for this look like?
> FreeBSD loads LKMs (if necessary) from the different mount_xxx programs,
> you might want to look at their interface (vfsent, vfsload, vfsisloadable).

Irix (don't you shudder at me, young man) has a neat way of handling this.

When you load a module, using ml, you can use `ml ld ...' to load a
module, which is the same as modload under NetBSD, or you can use
`ml reg ...' to `register' a module.  A registered module is duly noted by
the kernel, but is not loaded until it is used.  This makes it possible,
for example, to have a kernel which can use any supported device, but
which is hardly larger than a kernel stripped to just those devices which
are present.

IMHO, this is a _much_ better solution than having the kernel go looking
for LKMs as needed, as it allows explicit control over which LKMs the
kernel can load, and also allows ldconfig-style shortcuts to be built for
registered modules


				Jim Wise
				System Administrator
				GSAPP, Columbia University
				* Finger for PGP public key *