LinuxCommandLibrary

pcidump

Display PCI device configuration information

SYNOPSIS

pcidump [options] [device|file]

Common usage:
pcidump [-b] [-r file] [-s [[bus]:][device][.function]] [-x] [-v]

PARAMETERS

-b
    Bus master dump. Dumps the configuration space for all PCI bus master devices found on the system.

-r file
    Reads PCI configuration space from a specified raw binary dump
file instead of the live system's
/proc/bus/pci interface.


-s [[bus]:][device][.function]
    Specifies a particular PCI device to dump.
The format allows optional bus, device, and function numbers for precise targeting (e.g.,
00:01.0 or
01.0).


-x
    Hex dump. Displays the PCI configuration space content in a raw hexadecimal format,
useful for byte-level analysis and detailed register inspection.


-v
    Verbose output. Shows more detailed information about the PCI configuration space,
often decoding certain fields into human-readable descriptions based on the PCI specification.


DESCRIPTION

pcidump is a command-line utility used to display the configuration space of PCI (Peripheral Component Interconnect) devices.
It is part of the pciutils package, which provides various tools for inspecting and manipulating PCI hardware.
The command can read PCI configuration data directly from the system's /proc/bus/pci interface, or it can process a raw binary dump file of PCI configuration space.
This tool is invaluable for hardware diagnostics, driver development, and system debugging, allowing users to examine vendor IDs, device IDs, class codes, BARs (Base Address Registers), and other crucial configuration registers for each PCI device present in the system.
It helps in understanding how devices are configured and interact with the system's memory and I/O space.

CAVEATS

Permissions:
Accessing live PCI configuration space via
/proc/bus/pci typically requires root privileges.
Without appropriate permissions,
pcidump might fail or show limited information.


File Format:
When using the
-r option, the specified
file must be a raw binary dump of PCI configuration data,
not a human-readable text file or an lspci output.


System Stability:
While
pcidump is a read-only tool and will not modify hardware configuration,
it interacts with low-level system components.
Misinterpretation of its output can lead to incorrect diagnoses in complex system debugging scenarios.

<B>USAGE EXAMPLES</B>


To dump the configuration space for all PCI devices in hexadecimal format:
pcidump -x

To dump a specific device (e.g., the device at bus 00, device 01, function 0) in verbose hexadecimal:
pcidump -s 00:01.0 -xv

To dump configuration from a previously saved binary file named
pci_dump.bin:
pcidump -r pci_dump.bin -x

<B>OUTPUT INTERPRETATION</B>


The output of
pcidump typically shows 64 bytes (16 DWORDS) of configuration space per device,
organized into 16-byte lines. Each byte or set of bytes represents a specific register or field as defined by the PCI Local Bus Specification.
Understanding the PCI specification documents (especially the 'Configuration Space Header' and 'Capabilities' sections) is crucial for accurately interpreting the raw hexadecimal output and identifying particular registers like Vendor ID, Device ID, Class Code, Status Register, Command Register, and Base Address Registers (BARs).

HISTORY

The pcidump command is an integral part of the pciutils package,
which originated in the Linux kernel development community to provide user-space tools for interacting with PCI hardware.
It has been a stable and essential utility for PCI diagnostics since the early days of Linux's support for the PCI bus,
evolving alongside the kernel's PCI subsystem to maintain compatibility with new PCI specifications and features.

SEE ALSO

lspci(8): Lists all PCI devices and their properties in a readable, summary format. Often the first command used for PCI device discovery., setpci(8): Allows reading from and writing to PCI configuration registers. This command can modify device behavior and should be used with extreme caution., pcilib(3): The PCI library used by these utilities (including pcidump), providing programmatic access to PCI configuration space for developers.

Copied to clipboard