From owner-freebsd-hackers Tue Jul 11 14:32: 1 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from bubba.whistle.com (bubba.whistle.com [207.76.205.7]) by hub.freebsd.org (Postfix) with ESMTP id D5D9E37B7EE; Tue, 11 Jul 2000 14:31:55 -0700 (PDT) (envelope-from archie@whistle.com) Received: (from archie@localhost) by bubba.whistle.com (8.9.3/8.9.2) id OAA39254; Tue, 11 Jul 2000 14:31:48 -0700 (PDT) From: Archie Cobbs Message-Id: <200007112131.OAA39254@bubba.whistle.com> Subject: Re: Module parameters? In-Reply-To: <396B8BBB.4AA1867D@lucent.com> from "Gary T. Corcoran" at "Jul 11, 2000 05:03:55 pm" To: gcorcoran@lucent.com (Gary T. Corcoran) Date: Tue, 11 Jul 2000 14:31:48 -0700 (PDT) Cc: archie@whistle.com (Archie Cobbs), imp@village.org (Warner Losh), msmith@FreeBSD.ORG (Mike Smith), freebsd-hackers@FreeBSD.ORG (FreeBSD Hackers) X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Gary T. Corcoran writes: > > > : I was wondering if you (or anyone on this list) has had time > > > : to add module parameters to kldload? (and before anyone suggests > > > : it, sorry, but I am barely able to squeeze out enough time to > > > : even work on this unofficial driver, I can't work on kldload) > > > > > > You can use the hint mechanism that we've developed for other things. > > > > Another possibility is the netgraph binary <-> ASCII conversion stuff: > > > > http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/netgraph/ng_parse.h?rev=1.3 > > Are you suggesting that these routines could be used to > easily add parameters to kldload? (hint, hint) :-) > No, I know it's not that easy. We need to be able to do things > like have "TransmissionMode=4" on the kldload command line, and > have that parse the decimal value 4, and then go into the module > and set the value of the TransmissionMode variable to actually be > 4 immediately after loading the module into memory, before any of > its subroutines are called. This is what the Linux module loader > allows, and it's extremely useful... This is the kind of thing ng_parse.c can do. In fact kldload could just pass the parameters as a single, opaque ASCII string and the kernel (the KLD, actually) can decode it back into a binary C structure using the ng_parse routines. -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message