Monday, June 27, 2011

Checking Hardware Configuration from the Console

Programs Covered

* linuxinfo - brief overview of linux system
* lshw - ists all hardware but allows filtering
* dmidecode -lists all hardware
* lsusb - lists usb stats
* lscpu - list cpu stats
* lspci - lists pci stats
* manual method - the configuration files


linuxinfo

$ linuxinfo
Linux laptop 2.6.32-5-686 #1 SMP Mon Jun 13 04:13:06 UTC 2011
Two Intel Unknown 1000MHz processors, 7979.80 total bogomips, 1011M RAM
System library 2.11.2


lshw
lshw-gtk (optional gui)

$ sudo lshw -x (optional gui)
$ sudo lshw -short (displays everything)

$ sudo lshw -c memory
shane@laptop:~$ sudo lshw -c memory
*-firmware
description: BIOS
vendor: Acer
physical id: 0
version: V1.14 (09/10/2008)
size: 1MiB
capacity: 1984KiB
capabilities: pci upgrade shadowing cdboot bootselect socketedrom edd int13floppynec int13floppytoshiba int13floppy360 int13floppy1200 int13floppy720 int13floppy2880 int9keyboard int10video acpi usb
*-memory
description: System Memory
physical id: 14
slot: System board or motherboard
size: 2GiB
*-bank:0
description: SODIMM DDR2 Synchronous 667 MHz (1.5 ns)
product: A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4
vendor: 7F7FFE0000000000
physical id: 0
serial: A76F87A4
slot: DIMM0
size: 1GiB
width: 64 bits
clock: 667MHz (1.5ns)
*-bank:1
description: SODIMM DDR2 Synchronous 667 MHz (1.5 ns)
product: A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4
vendor: 7F7FFE0000000000
physical id: 1
serial: B96F87A4
slot: DIMM2
size: 1GiB
width: 64 bits
clock: 667MHz (1.5ns)
*-cache:0
description: L2 cache
physical id: 20
slot: L2 Cache
size: 1MiB
capacity: 1MiB
capabilities: synchronous internal write-back unified
*-cache:1
description: L1 cache
physical id: 22
slot: L1 Cache
size: 32KiB
capacity: 32KiB
capabilities: synchronous internal write-back data
*-cache
description: L1 cache
physical id: 21
slot: L1 Cache
size: 32KiB
capacity: 32KiB
capabilities: synchronous internal write-back instruction

The various classes:
system, bridge, memory,processor, address, storage, disk, tape, bus, network, display, input, printer, multimedia, communication, power, volume, generic

dmidecode

$ sudo dmidecode (displays everything)

$ sudo dmidecode -t bios
# dmidecode 2.9
SMBIOS 2.4 present.

Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
Vendor: Acer
Version: V1.14
Release Date: 09/10/2008
ROM Size: 2048 kB
Characteristics:
PCI is supported
BIOS is upgradeable
BIOS shadowing is allowed
Boot from CD is supported
Selectable boot is supported
BIOS ROM is socketed
EDD is supported
Japanese floppy for NEC 9800 1.2 MB is supported (int 13h)
Japanese floppy for Toshiba 1.2 MB is supported (int 13h)
5.25"/360 KB floppy services are supported (int 13h)
5.25"/1.2 MB floppy services are supported (int 13h)
3.5"/720 KB floppy services are supported (int 13h)
3.5"/2.88 MB floppy services are supported (int 13h)
8042 keyboard services are supported (int 9h)
CGA/mono video services are supported (int 10h)
ACPI is supported
USB legacy is supported
Targeted content distribution is supported

lsusb

$ lsusb
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

lspci

$ lspci
00:00.0 Host bridge: Intel Corporation Mobile 4 Series Chipset Memory Controller Hub (rev 07)
00:02.0 VGA compatible controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07)
00:02.1 Display controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07)
00:1a.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4 (rev 03)
00:1a.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5 (rev 03)
00:1a.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2 (rev 03)
00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 03)
00:1c.0 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 1 (rev 03)
00:1c.1 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 2 (rev 03)
00:1c.2 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 3 (rev 03)
00:1c.4 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 5 (rev 03)
00:1d.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 (rev 03)
00:1d.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 03)
00:1d.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 (rev 03)
00:1d.3 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #6 (rev 03)
00:1d.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 (rev 03)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 93)
00:1f.0 ISA bridge: Intel Corporation ICH9M LPC Interface Controller (rev 03)
00:1f.2 SATA controller: Intel Corporation ICH9M/M-E SATA AHCI Controller (rev 03)
00:1f.3 SMBus: Intel Corporation 82801I (ICH9 Family) SMBus Controller (rev 03)
00:1f.6 Signal processing controller: Intel Corporation 82801I (ICH9 Family) Thermal Subsystem (rev 03)
04:00.0 Network controller: Atheros Communications Inc. AR928X Wireless Network Adapter (PCI-Express) (rev 01)
05:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5764M Gigabit Ethernet PCIe (rev 10)
07:00.0 System peripheral: JMicron Technology Corp. SD/MMC Host Controller
07:00.2 SD Host controller: JMicron Technology Corp. Standard SD Host Controller
07:00.3 System peripheral: JMicron Technology Corp. MS Host Controller
07:00.4 System peripheral: JMicron Technology Corp. xD Host Controller
08:00.0 CardBus bridge: O2 Micro, Inc. OZ601/6912/711E0 CardBus/SmartCardBus Controller (rev 40)


lscpu

$ lscpu
Architecture: i686
CPU op-mode(s): 32-bit, 64-bit
CPU(s): 2
Thread(s) per core: 1
Core(s) per socket: 2
CPU socket(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 15
Stepping: 13
CPU MHz: 1000.000
L1d cache: 32K
L1i cache: 32K
L2 cache: 1024K


Manual Method

You can refer to the various configuration files.

/usr/local/share/pci.ids
/usr/share/pci.ids
/etc/pci.ids
/usr/share/hwdata/pci.ids
A list of all known PCI ID's (vendors, devices, classes and subclasses).
/proc/bus/pci/*
Used to access the configuration of installed PCI busses and devices.
/proc/ide/*
Used to access the configuration of installed IDE busses and devices.
/proc/scsi/*, /dev/sg*
Used to access the configuration of installed SCSI devices.
/dev/cpu/*/cpuid
Used on x86 platforms to access CPU-specific configuration.
/proc/device-tree/*
Used on PowerPC platforms to access OpenFirmware configuration.
/proc/bus/usb/*
Used to access the configuration of installed USB busses and devices.
/sys/*
Used on 2.6 kernels to access hardware/driver configuration information.

No comments:

Post a Comment