Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Feb 1999 17:57:14 -0800 (PST)
From:      Archie Cobbs <archie@whistle.com>
To:        mike@smith.net.au (Mike Smith)
Cc:        current@FreeBSD.ORG
Subject:   Re: KLD confusion..
Message-ID:  <199902080157.RAA29718@bubba.whistle.com>
In-Reply-To: <199902072258.OAA08165@dingo.cdrom.com> from Mike Smith at "Feb 7, 99 02:58:35 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
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



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