Subject: Re: A potential step towards modularisation
To: None <hch@infradead.org>
From: M. Warner Losh <imp@bsdimp.com>
List: tech-kern
Date: 02/09/2004 19:46:48
In message: <20040209145005.A22853@infradead.org>
            Christoph Hellwig <hch@infradead.org> writes:
: (c) kernel does a userspace upcall when new hardware is found
:      + doesn't waste memory
:      + works fine with later added hardware (even while the kernel
:        is running)
:      - needs good coordination between kernel and userland.
: 
: Option (c) is very popular under Linux these days as the so-called
: hotplug model where the kernel calls /sbin/hotplug when the bus driver
: detects hardware or sees hardware removals (and a few other events)

FreeBSD does something similar with its devd.  Unknown device events
are genereated at the newbus level.  These filter to userland.  the
userland daemon is responsible for doing whatever it wants with the
information.  It can load a new module, which causes the bus' new
child driver routine to be called for each instance which casues
(typically) a bus rescan and the device to attach.  Since the loading
of the driver triggers a rescan, no tricky synchronization is
necessary.

The trouble becomes 'how do I extract the tables of pnp info from the
driver to load the right one' especially since the subset of the pnp
info that a given driver might use differs widely.  Some driver attach
to specific IDs, while other drivers attach to whole classes of
devices.

Warner