From owner-freebsd-current Sun Feb 7 15:02:58 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA00389 for freebsd-current-outgoing; Sun, 7 Feb 1999 15:02:58 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from dingo.cdrom.com (castles235.castles.com [208.214.165.235]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id PAA00375 for ; Sun, 7 Feb 1999 15:02:54 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Received: from dingo.cdrom.com (localhost [127.0.0.1]) by dingo.cdrom.com (8.9.1/8.8.8) with ESMTP id OAA08165; Sun, 7 Feb 1999 14:58:35 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Message-Id: <199902072258.OAA08165@dingo.cdrom.com> X-Mailer: exmh version 2.0.2 2/24/98 To: Archie Cobbs cc: mike@smith.net.au (Mike Smith), julian@whistle.com, current@FreeBSD.ORG Subject: Re: KLD confusion.. In-reply-to: Your message of "Wed, 03 Feb 1999 12:29:34 PST." <199902032029.MAA25871@bubba.whistle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 07 Feb 1999 14:58:35 -0800 From: Mike Smith Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Mike Smith writes: > > > Take the following scenario: > > > > > > compiled in: module A > > > > > > kldstat -v shows module 'A' > > > > > > kldload A > > > damned thing succeeds. > > > > That's correct. There's a fundamental problem here in that there's a > > confusion between file names and module names. This is a basic flaw in > > the way that KLD was implemented (no offense to Doug; it was initially > > meant to be a better LKM, not necessarily a whole new ball of wax). > > > > I've taken about four different runs at a "right" way of doing this > > subsequently. I think that, with some help and advice from Doug and > > Peter, I'm on the right track now, but there's no hope of it being > > ready for 3.1. > > 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. 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. > 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. -- \\ Sometimes you're ahead, \\ Mike Smith \\ sometimes you're behind. \\ mike@smith.net.au \\ The race is long, and in the \\ msmith@freebsd.org \\ end it's only with yourself. \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message