Subject: Re: LKM & autoconf ?
To: Bill Studenmund <wrstuden@netbsd.org>
From: Quentin Garnier <netbsd@quatriemek.com>
List: tech-kern
Date: 09/23/2003 22:22:51
Le Tue, 23 Sep 2003 09:19:36 -0700 (PDT)
Bill Studenmund a ecrit :
> On Tue, 23 Sep 2003, Quentin Garnier wrote:
[...]
> > Our LKM subsystem provides a way to write character device drivers
> > which is quite independent from autoconf(9): the LKM receives a major
> > device number that can be used by userland to access the device.
> >
> > For a single driver that works quite well, and you don't need
> > autoconf(9), you just call the probe and attach routines in one shot
> > in the module init function. Of course there will be no real
> > autoconf(9) attachment.
> 
> In general, we'd like to be able to let LKMs tie into autoconf as full-
> class drivers. Among other things, with hot-swap slots, if the driver is
> hooked into autoconf, the right thing will happen when a card is
> inserted.

It is already possible, and that's precisely what I did. The only issue we
have right now is that bus drivers are not aware there can be LKMs that
attach later, thus the LKM has to probe the bus itself to find
corresponding devices. That is for fixed devices or removable devices that
are already inserted.

Arguably, the interface to autoconf(9) could be simpler for LKMs. Right
now you have to declare (apparently) weird structures that usually are
auto-generated by config(8).

-- 
Quentin Garnier - cube@cubidou.net - cube@NetBSD.org
"Feels like I'm fiddling while Rome is burning down.
Should I lay my fiddle down and take a rifle from the ground ?"
Leigh Nash/Sixpence None The Richer, Paralyzed, Divine Discontents, 2002.