From owner-freebsd-current Sat Jan 4 00:45:45 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id AAA06523 for current-outgoing; Sat, 4 Jan 1997 00:45:45 -0800 (PST) Received: from mira.net.au (eplet.mira.net.au [203.9.190.17]) by freefall.freebsd.org (8.8.4/8.8.4) with SMTP id AAA06518 for ; Sat, 4 Jan 1997 00:45:42 -0800 (PST) Received: (qmail 20033 invoked from network); 4 Jan 1997 08:45:37 -0000 Received: from melb.werple.net.au (203.9.190.18) by eplet.mira.net.au with SMTP; 4 Jan 1997 08:45:37 -0000 Received: (from uucp@localhost) by melb.werple.net.au (8.7.6/8.7.3/2) with UUCP id TAA10223; Sat, 4 Jan 1997 19:32:44 +1100 (EST) Received: (from jb@localhost) by freebsd1.cimlogic.com.au (8.7.5/8.7.3) id TAA29928; Sat, 4 Jan 1997 19:36:03 +1100 (EST) From: John Birrell Message-Id: <199701040836.TAA29928@freebsd1.cimlogic.com.au> Subject: Re: MOD_DECL in lkm.h To: bde@zeta.org.au (Bruce Evans) Date: Sat, 4 Jan 1997 19:36:02 +1100 (EST) Cc: current@FreeBSD.org In-Reply-To: <199701040643.RAA26494@godzilla.zeta.org.au> from Bruce Evans at "Jan 4, 97 05:43:54 pm" X-Mailer: ELM [version 2.4ME+ PL22 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-current@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk Bruce Evans wrote: > >modload -c config_file -p postinstall XXX_mod.o > > > >where the config_file might contain something similar to that given to > >the kernel config. Then I'd like the number of units to come from the > >config_file rather than from the NXXX in the XXX.h header file. > > How about something like: > > modload XXX_mod.o XXX_config.o > > where XXX_config.o is a small object file (something like one line out > of ioconf.c compiled to an object)? The config info could be loaded > separately but it's not clear how it would be associated with the > driver then. I looked at doing this today, but I realised the number of symbols that would not longer be static. Even if you sorted out the config - driver association, you can't guarantee that symbols will be unique. I was thinking that the "modload -c config_file XXX_mod.o" version could load the XXX module to get the driver entry initially with no devices, then modload (having processed the config file) could open the driver and use an ioctl-like (driver, not device) interface to configure it. You'd need to be able to reference drivers by name or ID (like lkms). [Changing my mind as I write 8-)] I should be able to write an lkm using the current interface that has a minimum of one device with configuration (port & IRQ) unspecified. Then come along later and do ioctls on that device to configure it. And use a specific ioctl call on any device on the driver to tell it to allocate space for more devices. That should work? > > Bruce > -- John Birrell CIMlogic Pty Ltd jb@cimlogic.com.au; jb@netbsd.org 119 Cecil Street Ph +61 3 9690 6900 South Melbourne Vic 3205 Fax +61 3 9690 6650 Australia Mob +61 18 353 137