*BSD News Article 13685


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!agate.berkeley.edu!cgd
From: cgd@erewhon.CS.Berkeley.EDU (Chris G. Demetriou)
Newsgroups: comp.os.386bsd.bugs
Subject: Re: my bug list
Date: 30 Mar 93 02:32:16
Organization: Kernel Hackers 'r' Us
Lines: 116
Message-ID: <CGD.93Mar30023216@erewhon.CS.Berkeley.EDU>
References: <1993Mar15.223046.10278@fcom.cc.utah.edu> <DERAADT.93Mar25200858@newt.fsa.ca>
	<DERAADT.93Mar25202827@newt.fsa.ca>
	<1993Mar30.020058.3999@fcom.cc.utah.edu>
NNTP-Posting-Host: erewhon.cs.berkeley.edu
In-reply-to: terry@cs.weber.edu's message of Tue, 30 Mar 93 02:00:58 GMT

this discussion is getting stupid.

In article <1993Mar30.020058.3999@fcom.cc.utah.edu> terry@cs.weber.edu (A Wizard of Earth C) writes:
>I agree that a hardware inventory, per se, is not required, *proivided* that
>you have a means of identifying which cards IRQ goes with which port; for
>instance, I could have two we devices defined in one box; how do you
>probe:
>
>device we0 at isa? port ? net irq ? iomem ? iosiz ? vector weintr
>device we1 at isa? port ? net irq ? iomem ? iosiz ? vector weintr
>
>and come up with what IRQ goes with what port?

theo didn't say that you could do a completely ?'d specification --
it's *obvious* that on a bus that is as brain-dead as the ISA bus,
that's not possible.

all he said that it should be easy enough in lots of cases to have
the irq automatically determined, and i'd *really* like to see
a convincing argument that it can't.

for example, bruce evans' serial driver forces and interrupt,
though i forget whether or not it checks to see which one it is...
in any case, that should be easy enough.

>Agreed on the interrupts being enabled; disagreed that an interrupt alone
>is sufficient to identify a device; for instance, 386BSD 0.1 came with
>almost all it's network cards at IRQ 2; the probe was responsible for
>identifying the network card, usually by checksumming the ROM or other
>silly method (which is about the best you can do).

earth to terry...  earth to terry...

no, of course you can't identify a device on IRQ alone.

you look at the addresses that the device is sitting at,
see if it looks right, then make it interrupt.  if it does
the right thing, THEN AND ONLY THEN do you say that it's the
device, and, while you're at it, you get it's real IRQ number
for free.

that's the problem with the we0 vs. is0 thing in the default kernel:
it never bothered checking to see if the device actually interrupted
when given a certain command.  in the case of the default kernel,
the device should only have been considered valid if it interrupted
at the correct address.  that's what a fully spec'd config line
is supposed to mean, but because of the screwed up 386bsd probe
routines, it doesn't mean that, hence the problems.

>Much better to provide a shutdown routine (read: wait until 0.2 or 0.1.5
>if Bill agrees to include such a massive change that will be required of
>every device driver.

this is almost irrelevant.

>I agree that the "interrupts disabled during boot" is ridiculous (assuming
>all interrupts have been redirected to interrupt counting routines so they
>can be picked up during boot); but fixing this alone is not enough to
>identify *which* possible device on IRQ2 the interrupt came from.

device we0 at isa? port 0x280 net irq 2 iomem 0xd0000 iosiz 8192 vector weintr
device ne0 at isa? port 0x300 net irq 2 vector neintr
device ec0 at isa? port 0x250 net irq 2 iomem 0xd8000 iosiz 8192 vector ecintr
device is0 at isa? port 0x280 net irq 10 drq 7 vector isintr

let me spell out what this sequence of lines in the config file is
supposed to say:

"gee, there might be a we0 in the system.  let's look at
port 280.  if that looks ok, let's check out that i/o memory.
if that looks ok, then check to see if it interrupts at irq 2.
if AND ONLY IF all of the above are true, then it's we0."

"gee, there might we a ne0 in the system.  let's look to see if
there's one at ne0.  if so, let's make sure it interrupts at
irq2.  if AND ONLY IF all of the above are true, then it's ne0"

and so on down the list.  it should be obvious (perhaps painfully
so) how this would keep we0 and is0 from conflicting.


and if you said:

device we0 at isa? port 0x280 net irq ? iomem 0xd0000 iosiz 8192 vector weintr

then it would do all of the checks, but not *require* irq 2,
and instead remember which IRQ the device interrupted at.



>A lot of it, at least in this area (booting) is a result of enforcement
>of copyright laws -- the VAX stuff isn't exactly public domain, and neither
>is the Xenix or Linux stuff that has been suggested.


the word "BULLSHIT" applies here.

if you want an example of autoconfig done right,
get the BNR2 sources, and look in sys/hp300.


no, that's not _public domain_ either...  but it was in the same source tree.

if you can't go one subtree over to look for ideas... <sigh>


oh yeah, i "forgot"...  bill didn't a lot of /sys in 386bsd...



chris
who, as you can tell, is happy.
--
Chris G. Demetriou                                    cgd@cs.berkeley.edu

 In case you didn't know: There are blondes and bogons in the VM system!