From owner-freebsd-hackers Tue Jul 11 18: 8:42 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from mass.osd.bsdi.com (mass.osd.bsdi.com [204.216.28.234]) by hub.freebsd.org (Postfix) with ESMTP id EFEF137B763 for ; Tue, 11 Jul 2000 18:08:39 -0700 (PDT) (envelope-from msmith@mass.osd.bsdi.com) Received: from mass.osd.bsdi.com (localhost [127.0.0.1]) by mass.osd.bsdi.com (8.9.3/8.9.3) with ESMTP id SAA00755; Tue, 11 Jul 2000 18:16:57 -0700 (PDT) (envelope-from msmith@mass.osd.bsdi.com) Message-Id: <200007120116.SAA00755@mass.osd.bsdi.com> X-Mailer: exmh version 2.1.1 10/15/1999 To: "Gary T. Corcoran" Cc: FreeBSD Hackers Subject: Re: Module parameters? In-reply-to: Your message of "Tue, 11 Jul 2000 20:58:45 EDT." <396BC2C5.E89AD827@lucent.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 11 Jul 2000 18:16:57 -0700 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > : The Linux approach is bad insofar as the arguments are per-module rather > > : than per-instance. In our case we need per-module and per-instance even > > : though the arguments are supplied per-file. > > You're right, Mike. I hadn't thought about it (since one usually won't > have more than one DSL card in a PC :), but to be generally useful, we really > should have per-instance arguments for modules that support multiple > instances of the same device. I'm not sure what you mean though, by > "even though the arguments are supplied per-file" ? If you say "kldload foo", you load the file foo.ko. However, that file may contain more than one module. So in order to pass arguments to each of those modules, you need some way of associating an argument with a module. > It sounds pretty good to me, too. And yes, even though my initial > example concerned just an int, you also need to be able to set strings > for tunable parameters (e.g. the Service Name for PPPoE). > Forgive my ignorance (since I'm unfamiliar with this hint stuff), but > I presume the above hints.foo... stuff just goes in some config file > somewhere? And this config file would be consulted whenever a module > is loaded? Just curious, what would "userconfig" be for? The hints mechanism is what we are currently using to pass in the information that used to be in the kernel configuration file. Each hint is an entry in the kernel environment space; these are currently read from a file by the loader when it's loading the kernel, but we must also have an interface for setting these after the system starts. In addition, it should be possible to pass arguments to a module as you load it, however it's not clear yet that this is the "clean" way to do it. I think the initial approach is going to look like this: # kenv hint.foo.0.parameter=15 # kldload foo ie. the hints can be set entirely independently of the module load. -- ... 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] To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message