Thursday, 15 July 2010

Hardware in Linux

Links




Devices

  • Block devices - is an abstraction layer for any storage device that can be formatted in fixed-size blocks; individual blocks may be accessed independently of access to other blocks. Such access is often called random access.

  • Character device

  • ATA devices - /dev/hdx

  • SATA devices - /dev/hdx or /dev/sdx

  • SCSI devices - /dev/sdx

  • ATA magnetic tape devices - /dev/htx or /dev/nhtx

  • SCSI magnetic tape devices - /dev/stx or /dev/nstx



Information about hardware

  • /proc/partitions - shows all block devices

  • /proc/dma - shows which DMA channels are in use

  • /proc/cpuinfo - all information about CPU

  • The sysfs virtual filesystem, mounted at /sys, exports information about devices so that user space utilities can access the information.

  • HAL -  Daemon The Hardware Abstraction Layer (HAL) Daemon, or hald, is a user space program that runs at all times (that is, as a daemon) that provides other user space programs with information about available hardware.

  • D-Bus - The Desktop Bus (D-Bus) provides a further abstraction of hardware information access. Like hald, D-Bus runs as a daemon. D-Bus enables processes to communicate with each other as well as to register to be notified of events, both by other processes and by hardware (such as the availability of a new USB device).

  • udev -  Traditionally, Linux has created device nodes as conventional files in the /dev directory tree. The existence of hotplug devices and various other issues, however, have motivated the creation of udev: a virtual filesystem, mounted at /dev, which creates dynamic device files as drivers are loaded and unloaded. You can configure udev through files in /etc/udev, but the standard configuration is usually sufficient for common hardware.



Tools



  • lspci - lists all PCI devices.

  • lspnp - display information about PnP devices

  • lsusb - shows all usb devices

  • usbmodules - list kernel driver modules available for a plugged in USB device

  • hotplug - relies on kernel support added with the 2.4.x kernel series. This system uses files stored in /etc/hotplug to control the configuration of specific USB devices. In particular, /etc/hotplug/usb.usermap contains a database of USB device IDs and pointers to scripts in /etc/hotplug/usb that are run when devices are plugged in or unplugged. These scripts might change permissions on USB device files so that ordinary users can access USB hardware, run commands to detect new USB disk devices, or otherwise prepare the system for a new (or newly removed) USB device.

  • usbmgr - a program that runs in the background to detect changes on the USB bus. When it detects changes, it loads or unloads the kernel modules that are required to handle the devices. This package uses configuration files in /etc/usbmgr to handle specific devices and /etc/usbmgr/usbmgr.conf to control the overall configuration.

  • setserial - configures serial interface

  • pnpdump - Dump ISA Plug-And-Play devices resource information

  • sndconfig - easy configuration of sound card

  • scsi_info, sginfo, sg_map - shows information about scsi device

  • hdparm - dispalys information about hard drives and configure them.

  • setpci - utility to directly query and adjust PCI devices’ configurations


Tips
If USB device is self disconnected during boot and you see for example the following in dmesg:
usb 2-1: USB disconnect, address 9
removing kernel module ehci_hcd can help you:
sudo modprobe -r ehci_hcd


No comments:

Post a Comment

Ping does not work

Today I would like to discuss a banal situation: host A is directly connected to host B, ping from host A to host B does not work. What are...