[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: hardware detection using libpci

David Whedon wrote:
> My approach is similar, I have a tiny utility that converts the list
> of known hardware from the format that lib detect uses (a *.lst file)
> into a header file.  My program (ddetect) includes said header file.
> ddetect makes calls into libdetect (which itself uses libisapnp
> internally). I got it to link with uC-ulibc (though the udeb at the
> url above links with glibc) and it was ~55k (staticily linked), 10k of
> which was the header file (could be smaller if I was clever like Genn
> and left out the card names :-) )

Can libdetect actually work with just pci id numbers, not names?

Glenn McGrath wrote:
> I guess the card names are handy for the user if all doesnt go to plan,
> i just left them out because the program didnt _need_ them, and they
> take the most space.

That's true, it is nice to be able to look at /proc/pci and figure out
what module to load by hand. But that 80k is pretty nice too.

> From the three modules i looked at there appears to be a few pci ids
> that arent in libdetects list, so maybe a kernel module based list would
> be more complete.

Yes, if at all possible we really need to grub this list of of the
kernel so you don't have to keep maintaining it.

> I noticed that libdetect uses /proc to get the pci ids, it cant do
> hardware probes to get the ids. Whilst Joey has said that we wouldnt
> ever ship a kernel without /proc support, i think that having the option
> to do without /proc is a good thing, if we want to make it easy for
> users to build a disk with there own kernel then its best is we depend
> on as few kernel features as possible.

I think we're surely going to depend on some features, probably even 
features that a user wouldn't think to compile into their kernel. I'm
afraid doing without /proc is going to waste more space than it saves by
making code try to do without it. Thus, asking users to compile in
/proc, which _is_ the default, is not undue hardship.

Remember making a kernel for the boot-floppies requires it be built with
all kinds of unlikely stuff like msdos fs support. That is well
documented though, and I guess some people have managed to do it.

see shy jo

Reply to: