Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Jul 2000 18:16:57 -0700
From:      Mike Smith <msmith@freebsd.org>
To:        "Gary T. Corcoran" <gcorcoran@lucent.com>
Cc:        FreeBSD Hackers <freebsd-hackers@FreeBSD.ORG>
Subject:   Re: Module parameters? 
Message-ID:  <200007120116.SAA00755@mass.osd.bsdi.com>
In-Reply-To: Your message of "Tue, 11 Jul 2000 20:58:45 EDT." <396BC2C5.E89AD827@lucent.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> > : 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




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