From owner-freebsd-stable Tue Oct 3 1: 2:19 2000 Delivered-To: freebsd-stable@freebsd.org Received: from leeann.snedmail.com (lgoldste.dsl.speakeasy.net [64.81.34.20]) by hub.freebsd.org (Postfix) with ESMTP id 380E737B502 for ; Tue, 3 Oct 2000 01:02:13 -0700 (PDT) Received: from leeann.snedmail.com (lgoldste@localhost) by leeann.snedmail.com (8.9.3/8.9.3) with ESMTP id BAA16969; Tue, 3 Oct 2000 01:02:09 -0700 (PDT) (envelope-from lgoldste@leeann.snedmail.com) Message-Id: <200010030802.BAA16969@leeann.snedmail.com> To: Stijn Hoop Cc: stable@FreeBSD.org, lgoldste@leeann.snedmail.com Subject: Re: A new file for the base system? In-reply-to: Your message of Tue, 03 Oct 2000 09:41:26 +0200. <20001003094126.B91234@pcwin002.win.tue.nl> Date: Tue, 03 Oct 2000 01:02:09 -0700 From: Lee Ann Goldstein Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --Your message was: (from Stijn Hoop) > Hi, > > I've tried out your script on my > > FreeBSD 4.1.1-STABLE #0: Wed Sep 27 13:37:31 CEST 2000 > > system, and I like it! I noticed one small error however: my integrated > graphics adapter isn't printed in the same way as your examples. > This is my dmesg: [snipped] > And this is the output of ./find_irq.sh: > > ----------------------------------------------------------------------------- > pci1 at 0.0 irq 9 > atkbd0 irq 1 > pcm0 irq 5 > fdc0 irq 6 > uhci0 irq 11 pci0.7.2 > xl0 irq 11 pci0.7.0 > psm0 irq 12 > ata0 irq 14 > ata1 irq 15 > ----------------------------------------------------------------------------- Hrrm. I get: lgoldste@leeann 479% cat irqpci.txt | ./find_irq.awk | sort -n +2 -3 atkbd0 irq 1 pcm0 irq 5 fdc0 irq 6 pci1 irq 9 pci1.0.0 uhci0 irq 11 pci0.7.2 xl0 irq 11 pci0.7.0 psm0 irq 12 ata0 irq 14 ata1 irq 15 Might be a typo somewhere (which is why I cc:ed this to the list), so here's the awk script again: (because of the tabs, linewraps, etc., I recommend saving this whole message to a file and then editing all but the awk script away :) 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----- > Thanks for the script! You're welcome :) 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