You get a bonus - 1 coin for daily activity. Now you have 1 coin

FreeBSD: how to view the list of PCI devices on a computer (or lspci on FreeBSD)

Practice



Task: display the list of PCI devices present in a system (computer) running FreeBSD - i.e. all PCI expansion cards connected to the motherboard, and all integrated PCI devices.


Method I - the pciconf utility

This utility is available out of the box in FreeBSD.

Run:

$ sudo pciconf -lv

The output will look roughly like this:

hostb0@pci0:0:0:0:      class="0x060000" card=0x82b01043 chip=0x29c08086 rev=0x10 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'P35/G33 (Bearlake) Processor to I/O Controller'
    class      = bridge
    subclass   = HOST-PCI
vgapci0@pci0:0:2:0:     class="0x030000" card=0x82b01043 chip=0x29c28086 rev=0x10 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'P35/G33 (Bearlake) Integrated Graphics Controller'
    class      = display
    subclass   = VGA
pcib1@pci0:0:28:0:      class="0x060400" card=0x81791043 chip=0x27d08086 rev=0x01 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = '82801G (ICH7 Family) PCIe Root Port'
    class      = bridge
    subclass   = PCI-PCI
pcib2@pci0:0:28:1:      class="0x060400" card=0x81791043 chip=0x27d28086 rev=0x01 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = '82801G (ICH7 Family) PCIe Root Port'
    class      = bridge
    subclass   = PCI-PCI
uhci0@pci0:0:29:0:      class="0x0c0300" card=0x81791043 chip=0x27c88086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801G (ICH7 Family) USB Universal Host Controller'
    class      = serial bus
    subclass   = USB
uhci1@pci0:0:29:1:      class="0x0c0300" card=0x81791043 chip=0x27c98086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801G (ICH7 Family) USB Universal Host Controller'
    class      = serial bus
    subclass   = USB
uhci2@pci0:0:29:2:      class="0x0c0300" card=0x81791043 chip=0x27ca8086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801G (ICH7 Family) USB Universal Host Controller'
    class      = serial bus
    subclass   = USB
uhci3@pci0:0:29:3:      class="0x0c0300" card=0x81791043 chip=0x27cb8086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801G (ICH7 Family) USB Universal Host Controller'
    class      = serial bus
    subclass   = USB
ehci0@pci0:0:29:7:      class="0x0c0320" card=0x81791043 chip=0x27cc8086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801G (ICH7 Family) USB 2.0 Enhanced Host Controller'
    class      = serial bus
    subclass   = USB
pcib3@pci0:0:30:0:      class="0x060401" card=0x81791043 chip=0x244e8086 rev=0xe1 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = '82801 Family (ICH2/3/4/5/6/7/8/9,63xxESB) Hub Interface to PCI Bridge'
    class      = bridge
    subclass   = PCI-PCI
isab0@pci0:0:31:0:      class="0x060100" card=0x81791043 chip=0x27b88086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Intel 82801GB/GR (ICH7 Family) LPC Interface Controller - 27B8 (945GL)'
    class      = bridge
    subclass   = PCI-ISA
atapci0@pci0:0:31:2:    class="0x01018a" card=0x81791043 chip=0x27c08086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801GB/GR/GH (ICH7 Family) Serial ATA Storage Controller'
    class      = mass storage
    subclass   = ATA
none0@pci0:0:31:3:      class="0x0c0500" card=0x81791043 chip=0x27da8086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801G (ICH7 Family) SMBus Controller'
    class      = serial bus
    subclass   = SMBus
ale0@pci0:1:0:0:        class="0x020000" card=0x831c1043 chip=0x10261969 rev=0xb0 hdr=0x00
    vendor     = 'Attansic (Now owned by Atheros)'
    device     = 'PCI-E ETHERNET CONTROLLER  (AR8121/AR8113 )'
    class      = network
    subclass   = ethernet
rl0@pci0:3:0:0: class="0x020000" card=0x13011186 chip=0x13001186 rev=0x10 hdr=0x00
    vendor     = 'D-Link System Inc'
    device     = 'DFE-528TX/530TX+/538TX Fast Ethernet Adapter (DL 10038C Chipset)'
    class      = network
    subclass   = ethernet



Method II - the lspci utility

1) Install pciutils

$ cd /usr/ports/sysutils/pciutils
$ sudo make install clean


2) Use the lspci command

$ sudo lspci

The output will look like this:

00:00.0 Host bridge: Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller (rev 10)
00:02.0 VGA compatible controller: Intel Corporation 82G33/G31 Express Integrated Graphics Controller (rev 10)
00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 01)
00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 01)
00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 01)
00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 01)
00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 01)
00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 01)
00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 01)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev e1)
00:1f.0 ISA bridge: Intel Corporation 82801GB/GR (ICH7 Family) LPC Interface Bridge (rev 01)
00:1f.2 IDE interface: Intel Corporation 82801GB/GR/GH (ICH7 Family) SATA IDE Controller (rev 01)
00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 01)
01:00.0 Ethernet controller: Attansic Technology Corp. L1 Gigabit Ethernet Adapter (rev b0)
03:00.0 Ethernet controller: D-Link System Inc RTL8139 Ethernet (rev 10)

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Operating Systems and System Programming"

Terms: Operating Systems and System Programming