Sunday, March 25, 2007

Using 'prtpci' to list PCI devices

On Solaris, if you want to check the details of the hardware installed
in your PC, you can use the command 'prtconf -pv'. However, the output is
very long, and gives too great a level of detail. Sun's Dan Mick has written
a perl program, called 'prtpci' which gives a more useful summary.
Here is how I installed the program:

bash-3.00# wget ftp://playground.sun.com/pub/dmick/prtpci.tar.Z
--00:08:09-- ftp://playground.sun.com/pub/dmick/prtpci.tar.Z
=> `prtpci.tar.Z'
Resolving playground.sun.com... 192.9.5.5
Connecting to playground.sun.com|192.9.5.5|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD /pub/dmick ... done.
==> PASV ... done. ==> RETR prtpci.tar.Z ... done.
Length: 163,050 (159K) (unauthoritative)

100%[====================================>] 163,050 57.69K/s

00:08:16 (57.54 KB/s) - `prtpci.tar.Z' saved [163050]

bash-3.00# gunzip < prtpci.tar.Z | tar xvf -
x prtpci, 5954 bytes, 12 tape blocks
x pciids/pci.ids, 349313 bytes, 683 tape blocks
x pciids/class.ids, 3445 bytes, 7 tape blocks
x pciids/getnew.pci.ids, 81 bytes, 1 tape blocks

bash-3.00# chown -R root:root prtpci pciids/

bash-3.00# ls -l
total 350
drwxr-xr-x 2 root root 512 Mar 25 00:10 pciids
-r-xr-xr-x 1 root root 5954 Jul 12 2005 prtpci
-rw-r--r-- 1 root root 163050 Mar 25 00:08 prtpci.tar.Z

bash-3.00# ls -l pciids/
total 714
-rw-rw-r-- 1 root root 3445 Mar 24 2002 class.ids
-rwxrwxr-x 1 root root 81 Mar 18 2005 getnew.pci.ids
-rw-rw-r-- 1 root root 349313 May 27 2005 pci.ids

And here is the (edited) output of what it shows
on my Dell Precision 380:

bash-3.00# ./prtpci
0/0x0/0 8086,2774 (1028,1a8) rev 0x0
Intel Corporation 955X Memory Controller Hub
class 6/0/0: Bridge/Host bridge

0/0x1/0 8086,2775 0 rev 0x0
Intel Corporation 955X PCI Express Graphics Port
class 6/4/0: Bridge/PCI bridge

1/0x0/0 1002,71d2 (1002,3b02) rev 0x0
ATI Technologies Inc
class 3/0/0: Display controller/VGA compatible controller
BAR[0]: prefetchable 64-bit memory 0xe0000000 0x10000000
BAR[2]: 64-bit memory 0xfe9e0000 0x10000
BAR[4]: I/O 0xdc00 0x100
legacy reg #3: aliased I/O 0x3b0 0xc
legacy reg #4: aliased I/O 0x3c0 0x20
legacy reg #5: 32-bit memory 0xa0000 0x20000

1/0x0/1 1002,71f2 (1002,3b03) rev 0x0
ATI Technologies Inc
class 3/80/0: Display controller/Display controller
BAR[0]: 64-bit memory 0xfe9f0000 0x10000

0/0x1c/0 8086,27d0 1 rev 0x0
Intel Corporation 82801G (ICH7 Family) PCI Express Port 1
class 6/4/0: Bridge/PCI bridge

4/0x0/0 14e4,1677 (1028,1a8) rev 0x1
Broadcom Corporation NetXtreme BCM5751 Gigabit Ethernet PCI Express
class 2/0/0: Network controller/Ethernet controller
BAR[0]: 64-bit memory 0xfe7f0000 0x10000

0/0x1f/0 8086,27b8 1 rev 0x0
Intel Corporation 82801GB/GR (ICH7 Family) LPC Interface Bridge
class 6/1/0: Bridge/ISA bridge

0/0x1f/1 8086,27df (1028,1a8) rev 0x1
Intel Corporation 82801G (ICH7 Family) IDE Controller
class 1/1/8a: Mass storage controller/IDE interface
BAR[0]: I/O 0x1f0 0x8
BAR[1]: I/O 0x3f6 0x1
BAR[2]: I/O 0x170 0x8
BAR[3]: I/O 0x376 0x1
BAR[4]: I/O 0xffa0 0x10

0/0x1f/2 8086,27c1 (1028,1a8) rev 0x1
Intel Corporation 82801GR/GH (ICH7 Family) Serial ATA Storage Controllers cc=AHCI
class 1/6/1: Mass storage controller/
BAR[0]: I/O 0xfe00 0x8
BAR[1]: I/O 0xfe10 0x4
BAR[2]: I/O 0xfe20 0x8
BAR[3]: I/O 0xfe30 0x4
BAR[4]: I/O 0xfea0 0x10
BAR[5]: 32-bit memory 0xfebfbc00 0x400

0/0x1f/3 8086,27da (1028,1a8) rev 0x1
Intel Corporation 82801G (ICH7 Family) SMBus Controller
class c/5/0: Serial bus controller/SMBus
BAR[4]: I/O 0xece0 0x20

The above clearly shows the ATI graphics card, the Broadcom Gigabit Ethernet card, and the ICH7 SATA card (using AHCI).

Here's the link to the post on Dan Mick's blog.

No comments: