> 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 is handleable by just not loading 'A'
> but what about the following:
> 
> kldload 'B' where B is defined to have a dependency on 'A'
> and 'A' is already loaded..
> 
> A get's loaded again.. leading to REALLY strange behaviour
> if the kernel is talking to one copy of A and B is talking 
> to the other.

That's definitely not correct behaviour, but again it's because the 
dependancy is implemented as a NEEDED reference to a *file*, not a 
module.

> I've had a look at the code, but 
> I think this would be a 20 minute thing for the right person, 
> rather than a 2 day thing for me...

It's been about 2 months for me so far, so I guess either I'm not the 
right person, or it's not that easy.  I can't see a "right" way of 
fixing it short of completely separating "files" and "modules".

Here's another scenario guaranteed to flummox the current code; link A 
and B together in a single file, name it after A.  Then have C, which 
depends on B, and try to load that.  It's going to look for a file 
named after B...

-- 
\\  Sometimes you're ahead,       \\  Mike Smith
\\  sometimes you're behind.      \\  m...@smith.net.au
\\  The race is long, and in the  \\  msm...@freebsd.org
\\  end it's only with yourself.  \\  msm...@cdrom.com



To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-current" in the body of the message

Reply via email to