From owner-freebsd-current Tue Feb 2 23:23:53 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA14580 for freebsd-current-outgoing; Tue, 2 Feb 1999 23:23:53 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from dingo.cdrom.com (castles138.castles.com [208.214.165.138]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA14564 for ; Tue, 2 Feb 1999 23:23:47 -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 XAA00601; Tue, 2 Feb 1999 23:19:52 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Message-Id: <199902030719.XAA00601@dingo.cdrom.com> X-Mailer: exmh version 2.0.2 2/24/98 To: Julian Elischer cc: current@FreeBSD.ORG Subject: Re: KLD confusion.. In-reply-to: Your message of "Mon, 01 Feb 1999 17:04:53 PST." <36B64F35.237C228A@whistle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 02 Feb 1999 23:19:52 -0800 From: Mike Smith Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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. \\ 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