lspci
lspci is a command-line utility in Unix-like operating systems that displays detailed information about all PCI (Peripheral Component Interconnect) buses and devices in the system. It is part of the pciutils package.
How lspci Works
Scanning PCI Buses:
lspciscans the PCI buses in the system to identify all connected PCI devices. It reads the PCI configuration space of each device to gather information.Reading Configuration Space: The PCI configuration space contains registers that provide details about the device, such as vendor ID, device ID, class code, and more.
Decoding Information:
lspcidecodes the raw data from the configuration space into human-readable information. It uses a database of known vendor and device IDs to provide meaningful names.Displaying Information: The utility displays the information in a structured format, showing details like the bus number, device number, function number, vendor, device name, and more.
Key Features
Basic Information: By default,
lspcishows a summary of each PCI device.Detailed Information: Using the
-v(verbose) option,lspciprovides more detailed information about each device.Tree View: The
-toption displays the devices in a tree format, showing the hierarchy of buses and devices.Database Lookup: The
-nnoption includes both numeric and textual IDs for vendors and devices.Kernel Drivers: The
-koption shows the kernel drivers handling each device.
Example Usage
Supported Systems
lspci works on Unix-like operating systems, including:
Linux: Commonly used on various Linux distributions.
FreeBSD: Available as part of the
pciutilspackage.NetBSD: Supported with the
pciutilspackage.OpenBSD: Available with the
pciutilspackage.
It is not natively available on Windows or macOS, but similar functionality can be achieved using other tools specific to those operating systems.