2005-02-15 19:05:31

by Chris White

[permalink] [raw]
Subject: Kernel Driver Automation

Hi, My question was regarding automation of the driver compile process
in the kernel.

Basically, as it is, I have seen lots of people scared half to death of
linux because of one of its most powerful features: the kernel. Windows
users are so used to "Insert device, windows sees device, windows finds
driver, windows installs driver, reboot and pray driver works ;)". The
kernel, however (not in all cases mind you), is full of lots of
searching around for the right driver, making sure the right SCSI/IDE
controller is selected for DMA, and getting the network setup.
Ironically, if the network card driver is not working, there's no way to
google around for information on what modules to compile in for various
drivers.

Now then.. on to the real stuff. Basically it comes down to the
question of what the kernel does so far as to have capabilities in
interfacing with a userspace application that would analyze the hardware
and attribute the proper driver for it. I've seen techinques such as
compiling all modules and loading until one finally works. This is
somewhat effective.. but in the long run leaves a lot of kernel bloat.
There are also wizards out there during distro install phase that help
with the process. Is there any other technique as far as attributing
hardware to driver? Something like the way USB can attribute a driver
to a product by the id and vendor?

The basic idea would be to have a userspace program that would be run
before the kernel compile process and check the device identification
string (using /proc?) and match it up against the correct module. This
would, I'm guessing, require that modules would have an array containing
the appropriate device string that it works with, enabling the userspace
application to match the two up and generate the proper configure
option. Though another propblem I ran into is "You need this module
compiled for this module to work". Maybe there's some sort of module
dependancy information I'm not aware of.

Let me know if any of this makes sense or if I need to redirect my ideas
to something more realistic. Thanks ahead of time for the
responses/criticism/flames.

--
Chris White <[email protected]>
------------------------
Sound | Video | PPC
ChrisWhite @ irc.freenode.net


Attachments:
signature.asc (189.00 B)
このメッセージにはデジタル署名された部分があります

2005-02-16 21:59:41

by Pete Zaitcev

[permalink] [raw]
Subject: Re: Kernel Driver Automation

On Wed, 16 Feb 2005 04:05:47 +0900, Chris White <[email protected]> wrote:

> Ironically, if the network card driver is not working, there's no way to
> google around for information on what modules to compile in for various
> drivers. [...]

I always google for the PCI IDs which lspci -n shows.

> The basic idea would be to have a userspace program that would be run
> before the kernel compile process and check the device identification
> string (using /proc?) and match it up against the correct module. [...]

We already do have such a program, it's called /sbin/hotplug. The missing
piece for your scheme, however, is that the maps which govern hotplug are
generated from C files. Therefore, the code is patched to add new IDs.
AFAIK, Greg Kroah worked on a more configurable way to match drivers with
devices within the hotplug framework. You might want to talk to Greg
about this.

By the way, Greg is a Gentoo developer as well, but pleas keep this to
a common forum. I'm sure folks from other distros are be interested.

Jaa ne,
-- Pete