Perhaps, then, we need to redesign the driver interface - whether we like it or
not is irrelevant.
Currently, module loading is user-initated. Modules are loaded and hardware
probed for when a userspace program attempts to use a device.
I suggest that we should do this the other way round - hardware-initiated.
Rather than waiting for a user to access the device, we scan the busses and
load drivers for all the hardware we find attached.
In the kernel, we keep a mapping for each bus type from vendor/device ID (or
their equivalent) to the driver routine which can handle those devices -
much like CardBus and PCMCIA already does.
This only needs to be done for drivers which are actually loaded - then when
we discover a device which isn't in this list, we can use kmod to request a
driver for it - request_module("pci_device_102b_1100") etc.
Adding MODULE_SUPPORTED_HARDWARE entries to signify which devices are handled
by each driver module is a fairly simple task while will keep depmod/modprobe
happy.
The only drawback I see with this is that it doesn't allow you to save kernel
memory by unloading drivers while they're not being used. I'm sure if I spent
more than five minutes thinking about it, I'd be able to sort that out too,
though.
-- dwmw2
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/