From owner-freebsd-hackers Mon Dec 31 0:50:34 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from espresso.q9media.com (espresso.q9media.com [216.254.138.122]) by hub.freebsd.org (Postfix) with ESMTP id 91BB837B423; Mon, 31 Dec 2001 00:50:31 -0800 (PST) Received: (from mike@localhost) by espresso.q9media.com (8.11.6/8.11.6) id fBV8m7D55463; Mon, 31 Dec 2001 03:48:07 -0500 (EST) (envelope-from mike) Date: Mon, 31 Dec 2001 03:48:07 -0500 From: Mike Barcroft To: Mike Smith Cc: hackers@freebsd.org Subject: Re: loadable aio Message-ID: <20011231034807.D45114@espresso.q9media.com> References: <20011230215630.B45114@espresso.q9media.com> <200112310508.fBV58MI03596@mass.dis.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200112310508.fBV58MI03596@mass.dis.org>; from msmith@freebsd.org on Sun, Dec 30, 2001 at 09:08:22PM -0800 Organization: The FreeBSD Project Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Mike Smith writes: > > Terry Lambert 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