From owner-freebsd-stable Wed Mar 28 16:13:28 2001 Delivered-To: freebsd-stable@freebsd.org Received: from mass.dis.org (mass.dis.org [216.240.45.41]) by hub.freebsd.org (Postfix) with ESMTP id 129DF37B71C for ; Wed, 28 Mar 2001 16:13:23 -0800 (PST) (envelope-from msmith@mass.dis.org) Received: from mass.dis.org (localhost [127.0.0.1]) by mass.dis.org (8.11.2/8.11.2) with ESMTP id f2T0BsX03821; Wed, 28 Mar 2001 16:11:55 -0800 (PST) (envelope-from msmith@mass.dis.org) Message-Id: <200103290011.f2T0BsX03821@mass.dis.org> X-Mailer: exmh version 2.1.1 10/15/1999 To: Harry Newton Cc: freebsd-stable@freebsd.org Subject: Re: KLD at boot time In-reply-to: Your message of "29 Mar 2001 00:57:05 +0100." <86r8zhfnw5.fsf@basilisk.locus> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 28 Mar 2001 16:11:54 -0800 From: Mike Smith Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > ( 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