Previous Section  < Day Day Up >  Next Section

Recipe 5.2. Detecting Hardware with lspci

5.2.1 Problem

You're looking at new systems, or installing Linux on a box that used to run a different OS, and you're wondering if all the components—video, modem, Ethernet, sound—will work on Linux. The vendors can't, or won't, tell you if their products will work on Linux. You need to know what the chipsets are, to find out if there are Linux drivers.

Alternatively, you want to know what components are installed inside a computer, and you don't feel like hauling the thing out, popping the case open, and tearing it apart.

5.2.2 Solution

Use lspci:

# /sbin/lscpi

# /sbin/lspci -v

# /sbin/lspci -vv

To show a summary of all devices connected to the PCI bus, use:

$ /sbin/lspci

00:00.0 Host bridge: VIA Technologies, Inc. VT8363/8365 [KT133/KM133] (rev 02)

00:01.0 PCI bridge: VIA Technologies, Inc. VT8363/8365 [KT133/KM133 AGP]

00:06.0 Ethernet controller: Linksys Network Everywhere Fast Ethernet 10/100 model NC100 

(rev 11)

...

Use the -v or -vv flags to display more information:

# /sbin/lspci -v

0000:01:00.0 VGA compatible controller: 3Dfx Interactive, Inc. Voodoo 3 (rev 01) (prog-if 

00 [VGA])

        Subsystem: 3Dfx Interactive, Inc.: Unknown device 1252

        Flags: 66MHz, fast devsel, IRQ 10

        Memory at d4000000 (32-bit, non-prefetchable) [size=32M]

        Memory at d8000000 (32-bit, prefetchable) [size=32M]

        I/O ports at c000 [size=256]

        Expansion ROM at <unassigned> [disabled] [size=64K]

        Capabilities: [54] AGP version 1.0

        Capabilities: [60] Power Management version 1

If you're looking for drivers, you can now take this output (e.g., VT8363/8365 or 3Dfx Interactive, Inc. Voodoo 3 (rev 01)) to run a Google search.

5.2.3 Discussion

lspci reads some information from the PCI bus, then displays additional information from its own database of hardware IDs—vendors, devices, classes and subclasses—at /usr/share/misc/pci.ids. There is even a command to update this file:

# update-pciids

The lspci maintainers welcome submissions of new data; please read /usr/share/misc/pci.ids for how to make submissions.

If there is a device attached to the system that the lspci simply does not recognize, such as a very old, odd ISA device, you'll have to open the case to see what it is. Or try running dmesg (Recipe Recipe 5.3).

5.2.4 See Also

  • lspci(8)

    Previous Section  < Day Day Up >  Next Section