Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 02 Oct 2000 23:50:32 -0700
From:      Lee Ann Goldstein <lgoldste@leeann.snedmail.com>
To:        stable@FreeBSD.ORG
Cc:        lgoldste@leeann.snedmail.com
Subject:   Re: A new file for the base system? 
Message-ID:  <200010030650.XAA16701@leeann.snedmail.com>
In-Reply-To: Your message of Mon, 02 Oct 2000 11:34:10 PDT. <200010021834.LAA15467@leeann.snedmail.com> 

next in thread | previous in thread | raw e-mail | index | archive | help

--Your message was: (from Lee Ann Goldstein)
> 
> --Your message was: (from "Kevin Oberman")
> > You script seems to miss several IRQs including my Ethernet and my
> > sound card.
>  
> [snip]
>  
> > Could this be related to the fact that I am running 4.1-Stable?
> 
> Could be, since I've not yet seen 4.1 dmesg output. But I can also
> see where some assumptions I made based on my own dmesg output bit
> me. Bleh.

Thanks to folks sending me dmesg output for 3.x, 4.x, and 5.x I now
have an awk script that should do the right thing up until someone
changes the dmesg output format again ;) There's some sample output
at the very end of this message.

find_irq.sh
-----------
#!/bin/sh

dmesg | \
./find_irq.awk | \
sort -n +2 -3
-----end sh script-----

find_irq.awk
------------
#!/usr/bin/awk -f

! /irq\>/ {next}

/at device/ && /on pci/ {irqinfo = gensub(/(^[a-z0-9]+[: ]).*(irq [0-9]+).*([0-9]+\.[0-9]+).*(pci[0-9]+)/, "\\1	\\2 \\4.\\3", 1)
	 sub(/:/, "", irqinfo)
	 sub(/ [0-9] /, " &", irqinfo)
	 print irqinfo
	 next
	}

/on pci/ {irqinfo = gensub(/(^[a-z0-9]+[: ]).*(irq [0-9]+).*(pci[0-9]+\.[0-9]+\.[0-9]+)/, "\\1	\\2 \\3", 1)
	 sub(/:/, "", irqinfo)
	 sub(/ [0-9] /, " &", irqinfo)
	 print irqinfo
	 next
	}

/^pci[0-9]+/ {irqinfo = gensub(/(^[a-z0-9]+[: ]).*(<[[:print:]]+>).*([0-9]+\.[0-9]+) (irq [0-9]+$)/,"\\1	\\4 \\1.\\3 \\2", 1)
	 gsub(/:/, "", irqinfo)
	 sub(/ [0-9] /, " &", irqinfo)
	 print irqinfo
	 next
	}

	{irqinfo = gensub(/(^[a-z0-9]+[: ]).*(irq [0-9]+).*/, "\\1	\\2", 1)
	 sub(/:/, "", irqinfo)
	 sub(/ [0-9]$/, " &", irqinfo)
	 print irqinfo
	 next
	}
-----end awk script-----

There is a tab after the initial "\\1" in the substitution strings. I
noticed quite a number of PCI devices that refer only to pci0 or pci1,
so for them I also included the manufacturer's description returned by
the probe.

A question about the line

IOAPIC #0 intpin 2 -> irq 0

Should I be filtering it out or transmogrifying it?

> Anyone who's sufficiently interested is welcome to send me (not the
> list!) the output of "dmesg | grep -i irq", and I'll beat the blasted
> thing into submission.

Thank you to the following people for providing test input:

James E. Housley <housley@thehousleys.net>
Gary Kline <kline@thought.org>
Kevin Oberman <oberman@es.net>
Sean O'Connell <sean@stat.Duke.EDU>
Mark Ovens <marko@freebsd.org>
Igor Timkin <ivt@logger.gamma.ru>

Here is some sample input and output:

4.1.1-STABLE FreeBSD 4.1.1-STABLE #0: Mon Oct  2 21:53:06 MSD 2000
IOAPIC #0 intpin 2 -> irq 0
ata0: at 0x1f0 irq 14 on atapci0
ahc0: <Adaptec 2940 Ultra SCSI adapter> port 0xe000-0xe0ff mem 0xfa000000-0xfa000fff irq 19 at device 9.0 on pci0
ahc1: <Adaptec 2940 Ultra SCSI adapter> port 0xd800-0xd8ff mem 0xf9800000-0xf9800fff irq 18 at device 10.0 on pci0
fxp0: <Intel Pro 10/100B/100+ Ethernet> port 0xd400-0xd41f mem 0xf9000000-0xf90fffff,0xfb000000-0xfb000fff irq 17 at device 11.0 on pci0
ahc2: <Adaptec 2940 Ultra SCSI adapter> port 0xd000-0xd0ff mem 0xf8800000-0xf8800fff irq 16 at device 12.0 on pci0
fdc0: <NEC 72065B or clone> at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
sio1 at port 0x2f8-0x2ff irq 3 on isa0
ed0 at port 0x280-0x29f iomem 0xd8000-0xdbfff irq 5 on isa0

produces:

IOAPIC #0 intpin 2 -> irq  0
atkbd0  irq  1
sio1    irq  3
sio0    irq  4
ed0     irq  5
fdc0    irq  6
ata0    irq 14
ahc2    irq 16 pci0.2.0
fxp0    irq 17 pci0.1.0
ahc1    irq 18 pci0.0.0
ahc0    irq 19 pci0.9.0

-----

5.0-CURRENT FreeBSD 5.0-CURRENT #0: Mon Oct  2 15:26:43 MSD 2000
ata0: at 0x1f0 irq 14 on atapci0
ata1: at 0x170 irq 15 on atapci0
pci0: <Intel 82371AB/EB (PIIX4) USB controller> at 7.2 irq 9
pci0: <ATI Mach64-GU graphics accelerator> at 8.0 irq 9
pcm0: <AudioPCI ES1371> port 0xf4c0-0xf4ff irq 10 at device 13.0 on pci0
pci0: <unknown card> (vendor=0x1011, dev=0x0009) at 14.0 irq 11
atkbd0: <AT Keyboard> flags 0x1 irq 1 on atkbdc0
fdc0: <NEC 72065B or clone> at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0
ppc0: <Parallel port> at port 0x378-0x37f irq 7 on isa0
sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
sio1 at port 0x2f8-0x2ff irq 3 on isa0

produces:

atkbd0  irq  1
sio1    irq  3
sio0    irq  4
fdc0    irq  6
ppc0    irq  7
pci0    irq  9 pci0.7.2 <Intel 82371AB/EB (PIIX4) USB controller>
pci0    irq  9 pci0.8.0 <ATI Mach64-GU graphics accelerator>
pcm0    irq 10 pci0.3.0
pci0    irq 11 pci0.4.0 <unknown card>
ata0    irq 14
ata1    irq 15


Lee Ann

--
Lee Ann Goldstein
		Caffeine is *not* a substitute for sleep.
lgoldste@leeann.snedmail.com	lgoldste@lafn.org	leeann@rand.org


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200010030650.XAA16701>