Lspci command on Linux (shows PCI devices)
During the system load process, the Kernel detects the PCI devices connected to the micro. The list of expansion cards found can be read using the lspci command.
The lspci Command in Linux is useful for showing all the information about the system’s PCI buses and the devices connected to them.
Your most common options are:
- -v Shows detailed information about all devices.
- -vv shows even more information about the devices.
- -n Shows the codes of the manufacturers and devices.
- -x. Shows the first 64 bytes of the PCI configuration in hexadecimal.
- -xxx Shows the entire PCI configuration in hexadecimal.
Example of use:
$ lspci00:00 .0 Host bridge: ALi Corporation M1541 (rev 04)00:01 .0 PCI bridge: ALi Corporation M1541 PCI to AGP Controller (rev 04)00:02 .0 USB Controller: ALi Corporation USB 1.1 Controller (rev 03)00:03 .0 Bridge: ALi Corporation M7101 PMU00:07 .0 ISA bridge: ALi Corporation M1533 PCI to ISA Bridge [Aladdin IV]00:09 .0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)00:0 b.0 SCSI storage controller: Adaptec AHA-2940/2940W/AIC-787100:0 f.0 IDE interface: ALi Corporation M5229 IDE (rev c1)01:00 .0 VGA compatible controller: nVidia/SGS Thomson (Joint Venture) Riva128 (rev 10)
Models that use the PCI bus most of the time dispense with the manual configuration of the resources expended.
You can check the addressing and interruption of the devices by consulting the contents of the /proc/interrupts and /proc/ioports files.
$ cat /proc/interruptsCPU00:288898893 XT-PIC timer1:230 XT-PIC keyboard2:0 XT-PIC cascade5:7085061 XT-PIC eth08:2 XT-PIC etc90: XT-PIC usb-ohci10:152038 XT-PIC aic7xxx12:411599 XT-PIC eth114:2 XT-PIC ide0
To check the entry and exit ports:
$ cat /proc/ioports0000-001f: dma10020-003f: pic10040-005f: timer0060-006f: keyboard0070-007f: rtc0080-008f: dma page reg5c20-5c3f: Ali Corporation. [ALi] M7101 PMUb800-b80f: Ali Corporation. [ALi] M5229 IDEd000-d0ff: Adaptec AHA-2940/2940W/AIC-7871d000-d0ff: aic7xxxd400-d4ff: 8139tood800-d8ff: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+
Thus, to enable the hardware, the kernel module corresponding to the device must be loaded. To load the module, you must use the modprobe command followed by the module name:
# modprobe 8139too
Some non-PCI cards require I/O addressing and IRQ to be entered as arguments for the modprobe command to allocate resources correctly:
# modprobe ne io=0x300 irq=10
Learn much more about Linux in our online course. You can register here. If you already have an account, or want to create one, just log in or create your user here.
Did you like it?
Share