From owner-freebsd-current Tue Nov 3 08:56:04 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA04273 for freebsd-current-outgoing; Tue, 3 Nov 1998 08:56:04 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from spinner.netplex.com.au (spinner.netplex.com.au [202.12.86.3]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA04199 for ; Tue, 3 Nov 1998 08:55:43 -0800 (PST) (envelope-from peter@netplex.com.au) Received: from spinner.netplex.com.au (localhost [127.0.0.1]) by spinner.netplex.com.au (8.9.1/8.9.1/Spinner) with ESMTP id AAA24458; Wed, 4 Nov 1998 00:53:52 +0800 (WST) (envelope-from peter@spinner.netplex.com.au) Message-Id: <199811031653.AAA24458@spinner.netplex.com.au> X-Mailer: exmh version 2.0.2 2/24/98 To: Brian Feldman cc: John Hay , freebsd-current@FreeBSD.ORG Subject: Re: Booting Elf Kernel : replying to myself In-reply-to: Your message of "Tue, 03 Nov 1998 09:40:40 EST." Date: Wed, 04 Nov 1998 00:53:51 +0800 From: Peter Wemm Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Brian Feldman wrote: > I am referring also that it would check to see if this file exists, and > return a malloced answer, else return NULL. This way it would be asy to > say something like > char *name; > if ((name = getkldbyname("mfs")) != NULL { > kldload(name); > free(name); > } else { > fprintf(stderr, "Could not load mfs.\n"); > exit(1); > } Well, it would have to parse the module path: $ sysctl kern.module_path kern.module_path: /;/boot/;/modules/ The kernel searches the path already, the best way to do the code above is: if (kldload("mfs") == -1) { fprintf(stderr, "Could not load mfs.\n"); exit(1); } .. but the kernel will already try this in mount(2) now. I have already got one "What???" response about having just made mount do this, so I guess we'll have to wait and see if this is going to stay. > Brian Feldman > > On Tue, 3 Nov 1998, Brian Feldman wrote: > > > So should we take the VFS loading out of libc and add it to mount? Or > > should there be a wrapper function in libc, getkldbyname (char *name) and > > return "/modules/name.ko"? > > > > Brian Feldman > > > > On Tue, 3 Nov 1998, Peter Wemm wrote: > > > > > Brian Feldman wrote: > > > > Ahhhh, that's where it is! I have no good idea on how to allow, with th is > > > > code, lkm's and kld's to coexist.... so is it time to completely phase out > > > > lkm's yet? > > > > > > I think the best way is to have mount(2) initiate a kldload if needed. W e > > > will need this functionality sooner or later. If mount(2) does it, we ca n > > > garbage collect unused, unmounted filesystems after a while and unload > > > them. > > > > > > > Brian Feldman > > > > > > > > On Mon, 2 Nov 1998, John Hay wrote: > > > > > > > > > > Be sure to let me know when ELF kernels can autoload kld modules li ke the > > > > > > current a.out kernel does with lkm's. > > > > > > > > > > It's not the kernel that loads them. Go and look in lib/libc/gen/getv fsent. > > > c > > > > > > > > > > John > > > > > -- > > > > > John Hay -- John.Hay@mikom.csir.co.za Cheers, -Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message