Tuesday, October 4, 2016

lspci and device information

Citation from wikipedia "device file"
In Unix-like operating systems, a device file orspecial file is an interface for a device driverthat appears in a file system as if it were an ordinary file. There are also special files inMS-DOSOS/2, and Microsoft Windows. They allow software to interact with a device driver using standard input/output system calls, which simplifies many tasks and unifies user-space I/O mechanisms.
Device files often provide simple interfaces to peripheral devices such as printers and serial ports, but they can also be used to access specific resources on those devices, such asdisk partitions. Finally, device files are useful for accessing system resources that have no connection with any actual device such asdata sinks and random number generators.

And... device information like PCI devices which Linux kernel is detecting can be seem by using lspci command:

$ lspci

The detail of lspci is:

Citation from https://linux.die.net/man/8/lspci
lspci is a utility for displaying information about PCI buses in the system and devices connected to them.

By default, it shows a brief list of devices. Use the options described below to request either a more verbose output or output intended for parsing by other programs.

If you are going to report bugs in PCI device drivers or in lspci itself, please include output of "lspci -vvx" or even better "lspci -vvxxx" (however, see below for possible caveats).

Some parts of the output, especially in the highly verbose modes, are probably intelligible only to experienced PCI hackers. For exact definitions of the fields, please consult either the PCI specifications or the header.h and/usr/include/linux/pci.h include files.

Access to some parts of the PCI configuration space is restricted to root on many operating systems, so the features of lspci available to normal users are limited. However, lspci tries its best to display as much as available and mark all other information with <access denied>text.

Options

Basic display modes

-m

Dump PCI device data in a backward-compatible machine readable form. See below for details.

-mm

Dump PCI device data in a machine readable form for easy parsing by scripts. See below for details.

-t

Show a tree-like diagram containing all buses, bridges, devices and connections between them.

Display options

-v

Be verbose and display detailed information about all devices.

-vv

Be very verbose and display more details. This level includes everything deemed useful.

-vvv

Be even more verbose and display everything we are able to parse, even if it doesn't look interesting at all (e.g., undefined memory regions).