Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Dec 2001 03:48:07 -0500
From:      Mike Barcroft <mike@freebsd.org>
To:        Mike Smith <msmith@freebsd.org>
Cc:        hackers@freebsd.org
Subject:   Re: loadable aio
Message-ID:  <20011231034807.D45114@espresso.q9media.com>
In-Reply-To: <200112310508.fBV58MI03596@mass.dis.org>; from msmith@freebsd.org on Sun, Dec 30, 2001 at 09:08:22PM -0800
References:  <20011230215630.B45114@espresso.q9media.com> <200112310508.fBV58MI03596@mass.dis.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Mike Smith <msmith@freebsd.org> writes:
> > Terry Lambert <tlambert2@mindspring.com> writes:
> > > There is so much "goo" around the module loading these days; there
> > > are incursions into "mount" and all sorts of other programs that
> > > should not know about module loading.
> > 
> > The kldload(2) interface alone is enough to make me cringe.  The way
> > in which it locates a module to load appears to be black magic.
> 
> What part of searching a path for a matching file is "black magic"?  
> 
> Shells have been doing this for decades...

%%%
/*
 * Load /boot/kernel/procfs.ko
 * XXX: why does this work?
 */
chdir("/");
kldload("procfs");

/*
 * Load /boot/kernel/procfs.ko
 * XXX: why does this work?
 */
chdir("/");
kldload("procfs.ko");

/*
 * Load /boot/kernel/procfs.ko
 */
kldload("/boot/kernel/procfs.ko");	/* Proper interface */

/*
 * Move procfs.ko from /boot/kernel to /tmp, then load the copy in /tmp.
 */
system("/bin/mv /boot/kernel/procfs.ko /tmp");
chdir("/tmp");
kldload("procfs.ko");			/* XXX: this doesn't work. */
%%%

If that's not black magic, I'd like to know what is.  I'd like to
refer you to the kldload(2) manual, but unfortunately it doesn't
document how kldload(2) works. :(

Best regards,
Mike Barcroft

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




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