Re: Quick question.

Dan Merillat (harik@ao.net)
Sun, 15 Sep 1996 23:36:08 -0400 (EDT)


> Indeed there is. Its in the KHG. Doh! sorry for bandwidth wastage.
>
> Now. What I'm actually working on is a hardware autodetect utility
> for Linux. Something along the lines of the Win95 autodetection of
> hardware while setting up.
>
> There is a simple reason for this. It would make setting up a
> Linux/GNU (keep RS happy my mentioning it like that!!) system a great
> deal simpler for the 'personal' user.
>
> The premise is that you start with a completely bog-standard kernel
> that talks either IDE(and ATAPI) or SCSI, Floppy and not much more.
>
> At the moment I'm basically pulling the probing mechanisms from all
> the various drivers and running through them in user mode.
>
> Now, the way I see it, I can do the autodetection in one of 3 ways.
>
> 1. A user-mode app that goes tromping through the I/O bus regions
> probing for this and that. This has the advantage of making the
> utility readily available and useable by 'distribution' vendors.
> I really dislike this idea cos I've tried it and found that for
> instance, probing for a 3c503 messes up my WD8013 ethernet card so
> that it no longer answers up for probes without a hard reset.)
> It also has the disadvantage that it will require a great deal of
> fiddling to make sure things are probed for in the correct order. And
> even then there's no guarantee of 100% accuracy and reliablity
>
> 2. An actual autodetection 'driver' or module. I think (but I may be
> wrong) that this might be a little safer than running it in user mode
> but will probably suffer from the same drawbacks as mentioned above.
>
> 3. Do it ala NT or 95. load a driver module, see if it gets a hit and
> then unload it and move on to the next module. I absolutely hate this
> brain dead method :>

Well, 95 has one thing right... They ask you one set of important
questions at the beginning:

"Do you have a network card?"
"Do you have a sound card?"

and one other... I thought it was scsi but don't hold me to it.
may have been modem.

Anyway, network cards are the worst in tearms of autoprobe, in my
experiance (starting with a dain-bramaged NE2k clone.. speww)

But the user USUALLY knows if they have a network card/sound card.
note: 95 did not ask what KIND of card they had, just if they had one or
not.

the other trick to take from them is auto-continue. write a file and
block untill written (caching would be bad when autoprobeing) and do the
"If this stops, leave the disk in the drive and press reset" message.

In tearms of probing, usermode as root is just about as safe as a module.
and the other option (installing and uninstalling each module) I agree is
brain-damaged. Simple solution is to cut and paste all the autodetect
code from each module to your program, and the resource managment stuff.
(Also, doing it user-mode lets you port it to DOS... so you could run it
from the dos command line, or blows 3.1 ( a la redhat )

In terms of probing, best bet would be to get a list of "badly behaved
devices" and probe for them first. That way if you find them the other
drivers don't probe the same space. (This is from lots of experience hard
locking systems when I told a driver the wrong thing... why can't people
just make clean hardware? ;-)

--Dan