From owner-freebsd-current Sun Feb 7 17:58:08 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA24311 for freebsd-current-outgoing; Sun, 7 Feb 1999 17:58:08 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from bubba.whistle.com (s205m7.whistle.com [207.76.205.7]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id RAA24306 for ; Sun, 7 Feb 1999 17:58:07 -0800 (PST) (envelope-from archie@whistle.com) Received: (from archie@localhost) by bubba.whistle.com (8.9.2/8.9.2) id RAA29718; Sun, 7 Feb 1999 17:57:14 -0800 (PST) From: Archie Cobbs Message-Id: <199902080157.RAA29718@bubba.whistle.com> Subject: Re: KLD confusion.. In-Reply-To: <199902072258.OAA08165@dingo.cdrom.com> from Mike Smith at "Feb 7, 99 02:58:35 pm" To: mike@smith.net.au (Mike Smith) Date: Sun, 7 Feb 1999 17:57:14 -0800 (PST) Cc: current@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL38 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Mike Smith writes: > > This may be oversimplifying, but why wouldn't this work: just do > > everything at the module level: > > > > - All dependencies are inter-*module* dependencies. > > - Only one *module* with the same name can be loaded at one time. > > - KLD files (eg, foo.ko) are simply containers for one or more modules. > > This is basically what I've been working on. > > > We'd take the conservative stance on loading: if you tried to > > kldload foo.ko, it would fail unless *all* the modules in it were > > successfully able to link & load. > > > > It seems if you just make consistent what the atomic unit of linking > > is (is it a file?? it is a module??) then all will be well. We just > > have to make sure we have unique names for all modules as we do now > > for files. > > There's a problem here in that the atomic linkage unit (file) is not > the same as the atomic identity unit (module). > > This means that you need to associate information with modules, and > then teach everything that's going to try to load files how to read > this infomation and apply it to the currently-loaded arrangement. This is where it gets a bit murky for me. I thought you could handle this discrepancy (ie, that likage occurs per file and not per module) by simply asserting that if a KLD file does not completely link, then ALL of the modules in that file are rejected and not loaded. So if you KLD load a file containing a module that's already loaded, or whose symbols cannot be fully resolved, the whold file would be rejected. > It's all doable; it's just moderately complex and I've not had the time > to attack it properly. If this is something of interest/relevance to > you and you'd like to take it on, please let me know and I'll dump > everything I've been doing and thinking on you and we can talk about it > at length. I'd have to educate myself a bit more before attempting this.. :-) > > Now, there remains the problem of how do you find the file foo.ko > > containing module "bar", eg, if you want to auto-load dependencies? > > For starters, we could just assert that only module "foo" can be > > found this way. > > I was planning on using that as a base rule; Doug (IIRC) suggested an > optimisation whereby we'd keep a database of module:file mappings lying > around. That sounds appropriate. -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message