Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Mar 2001 16:11:54 -0800
From:      Mike Smith <msmith@freebsd.org>
To:        Harry Newton <harry_newton@telinco.co.uk>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: KLD at boot time 
Message-ID:  <200103290011.f2T0BsX03821@mass.dis.org>
In-Reply-To: Your message of "29 Mar 2001 00:57:05 %2B0100." <86r8zhfnw5.fsf@basilisk.locus> 

next in thread | previous in thread | raw e-mail | index | archive | help
> ( 4.3-RC FreeBSD 4.3-RC #0: Wed Mar 28 )
> I was just playing around with putting the support for my Soundblaster
> Live card in modules, when I came across a quirk:
> 
> In /boot/loader.conf:
> 
> snd_emu10k1_load="YES"
> snd_pcm_load="YES"
> 
> ( having removed device pcm from kernel config file ).
> 
> But this doesn't work ! The boot messages give:
> 
>   Preloaded elf module "snd_emu10k1.ko" at 0xc035e0fb
>   link_elf: symbol sndbuf_getbps undefined
>   Preload elf module "snd_pcm.ko" at 0xc035e19c
>
> Changing the order of the lines in /boot/loader.conf makes no
> difference. However, if I unload the modules by hand at boot time, and
> then explicitly load them in the right order ( pcm then emu10k1 )
> and then boot, there's no problem.
> 
> I can easily work round this by either doing what I've suggested
> above, or just using kldload when the system's up, but I suspect
> there's a small problem somewhere: I think the dependencies may be
> slightly askew.

This actually sheds some light on a problem that was being discussed a 
little while back; it looks like the module list is not being sorted in 
dependancy order, probably because the depend-ing module is loaded before 
the depended-on module, and the linker traverses the list linearly rather 
than either multi-passing or sorting by dependancy.

There are a couple of possible fixes for this:

 - Change the loader to sort modules in dependancy order as it loads 
   them.  This would involve moving loaded modules around in memory (but 
   this isn't very hard).

 - Change the kernel linker to make multiple passes over the module list,
   repeating until on a pass it fails to successfully link anything and 
   then complaining about what's left unlinkable.  This would be a bit 
   harder, but makes the kernel more robust to unsorted modules.

I can probably help with the first item, I suspect that Peter Wemm at 
least could help with the second if someone cared to pick this up and fix 
it.

-- 
... every activity meets with opposition, everyone who acts has his
rivals and unfortunately opponents also.  But not because people want
to be opponents, rather because the tasks and relationships force
people to take different points of view.  [Dr. Fritz Todt]
           V I C T O R Y   N O T   V E N G E A N C E



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




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