Top

A Linux User Reference

Search tips
  • search ignores words that are less than 4 characters in length
  • searches are case insensitve
  • if a search does not return anything try it in Boolean mode then Query expansion mode by checking the appropriate radio button e.g. searching for 'cron' in just the Administration category returns nothing - presumably because the 50% threshold is reached. Boolean mode ignores this threshold so a search for 'cron' returns several hits
  • in Boolean mode preceding a word with a '+' means the result must include that word, a '-' means it must not
  • in Boolean mode '+crontab -anacron' means match articles about crontab that DO NOT mention anacron
  • to match a phrase e.g. 'manage system' check the Boolean mode radio button and enclose the phrase in quotes "some phrase ..."
  • in Query expansion mode the search context is expanded beyond the keywords you entered - relevancy of hits may well be degraded

HARDWARE

BIOS

  • Basic Input Output System
    • During boot most PCs display a way of accessing the BIOS configuration screens via the use of one or more keys e.g. Del, Esc, Fn ...

    • The BIOS is part of the bootstrapping/booting process and is responsible for loading an OS's Boot-loader and initialising hardware. In older systems the BIOS is stored in ROM (Read Only Memory) chips, newer ones in EEPROMs (Electronically Erasable Programable Read Only Memory).

    It provides general configuration options such as

    • hardware clock (date and time)
    • storage devices (internal hard disks, cdroms, floppy drives)
    • boot devices (boot order, usb, disk, cdrom, network)
    • resource assignments (ioports, dma, interrupts)

    This information along with component descriptions, serial numbers and revision levels are held in the DMI/SMBIOS table.

    • SMBIOS stands for System Management BIOS
    • DMI stands for Desktop Management Interface

    Both standards are tightly related.

  • DMI table decoder
    /usr/sbin/dmidecode

    Dump the DMI/SMBIOS table contents in a human-readable format.

    $ dmidecode --help
    Usage: dmidecode [OPTIONS]
    
    Options are:
     -d, --dev-mem FILE     Read memory from device FILE (default: /dev/mem)
     -h, --help             Display this help text and exit
     -q, --quiet            Less verbose output
     -s, --string KEYWORD   Only display the value of the given DMI string
     -t, --type TYPE        Only display the entries of given type
     -u, --dump             Do not decode the entries
         --dump-bin FILE    Dump the DMI data to a binary file
         --from-dump FILE   Read the DMI data from a binary file
     -V, --version          Display the version and exit
    

    DMI TYPES:

    Type Information Type Information Type Information
    0 BIOS 15 System Event Log 30 Out-of-band Remote Access
    1 System 16 Physical Memory Array 31 Boot Integrity Services
    2 Baseboard 17 Memory Device 32 System Boot
    3 Chassis 18 32-bit Memory Error 33 64-bit Memory Error
    4 Processor 19 Memory Array Mapped Address 34 Management Device
    5 Memory Controller 20 Memory Device Mapped Address 35 Management Device Component
    6 Memory Module 21 Built-in Pointing Device 36 Management Device Threshold Data
    7 Cache 22 Portable Battery 37 Memory Channel
    8 Port Connector 23 System Reset 38 IPMI Device
    9 System Slots 24 Hardware Security 39 Power Supply
    10 On Board Devices 25 System Power Controls 40 Additional Information
    11 OEM Strings 26 Voltage Probe 41 Onboard Devices Extended Information
    12 System Configuration Options 27 Cooling Device 42 Management Controller Host Interface
    13 BIOS Language 28 Temperature Probe
    14 Group Associations 29 Electrical Current Probe

    Keywords can be used instead of type numbers with '--type'. Each keyword is equivalent to a list of type numbers:

    Keyword Types
    bios 0, 13
    system 1, 12, 15, 23, 32
    baseboard 2, 10, 41
    chassis 3
    processor 4
    memory 5, 6, 16, 17
    cache 7
    connector 8
    slot 9

    Report processor information

    $ sudo dmidecode -t 4
    [sudo] password for mark: 
    # dmidecode 2.11
    SMBIOS 2.7 present.
    
    Handle 0x0004, DMI type 4, 42 bytes
    Processor Information
        Socket Designation: Socket FT1
        Type: Central Processor
        Family: E-Series
        Manufacturer: AMD processor
        ID: 20 0F 50 00 FF FB 8B 17
    

    Display bios inof uding keyword type

    $ sudo dmidecode --type bios
    # dmidecode 2.11
    SMBIOS 2.7 present.
    
    Handle 0x0000, DMI type 0, 24 bytes
    BIOS Information
        Vendor: LENOVO
        Version: 6CCN96WW(V8.08)
        Release Date: 01/16/2013
    ..... 
        BIOS Revision: 0.96
        Firmware Revision: 0.0
    
    Handle 0x0021, DMI type 13, 22 bytes
    BIOS Language Information
        Language Description Format: Long
        Installable Languages: 4
            en|US|iso8859-1
            fr|CA|iso8859-1
            ja|JP|unicode
            zh|TW|unicode
        Currently Installed Language: en|US|iso8859-1
    
    $ 
    

    keywords are case-insensitive.

  • Direct Memory Access (DMA), parallel ports
    DMA

    DMA enabled devices access memory directly via a DMA channel.

    Non-DMA devices rely on the processor to read from the ioport, store in memory, read from memory and then write to the ioport.

    Parallel ports

    Used for legacy printers and cd-rom/tape drives. Not uncommon to share interrupt(s) with a sound card.

    Type Function
    Enhanced Parallel Port (EPP) Designed for cd-roms/tape drives
    Enhanced Capabilities Port (ECP) Designed for use with printers
    Port Address IRQ
    LPT1 378-37F 7
    LPT2 278-27F 5
    LPT* 3BC-3BE
  • 1024 cylinder limit
    old, old BIOS's

    No longer applicable unless you are installing an old, old distribution on an old, old system with and old, old BIOS.

    • Due to an addressing limit, the BIOS requires a Boot-loader to be within the first 1024 cylinders of a boot device, often in the Master Boot Record (MBR).
    • Old versions of LILO (without LBA support) required that the kernel image also reside within the first 1024 cylinders.
    • At least one Boot-loader (for multi-OS booting) needs to be within the first 1024 cylinders.
  • PC system bus types
    • Such devices, including those built into the motherboard, communicate with the CPU over a bus.

    • They are slower than the system bus (cannot keep up with to-days CPU speeds) and are used for communicating with things like hard disks, sound cards, peripherals ...

    • They connect to the system bus through a bridge, a part of the computer's chipset, that manages data communication between the other buses and the system bus.

    Bus Type Comment
    PCI Peripheral Component Interconnect Supports 32-bit devices
    ISA Industry Standard Architecture also called AT bus Supports 8-bit and 16-bit cards
    AGP Accelerated Graphics Port
    PCI-E, PCIe PCI Express Steadily replacing AGP
    USB Universal Serial Bus Several standards for peripheral attachment - printers, cameras, DVDs, ...
  • List PCI devices
    /usr/bin/lspci

    A utility for displaying information about PCI buses in the system and devices connected to them.

    lspci [<switches>]
    
    Basic display modes:
    -mm     Produce machine-readable output (single -m for an obsolete format)
    -t      Show bus tree
    
    Display options:
    -v      Be verbose (-vv for very verbose)
    -k      Show kernel drivers handling each device
    -x      Show hex-dump of the standard part of the config space
    -xxx        Show hex-dump of the whole config space (dangerous; root only)
    -xxxx       Show hex-dump of the 4096-byte extended config space (root only)
    -b      Bus-centric view (addresses and IRQ's as seen by the bus)
    -D      Always show domain numbers
    
    Resolving of device ID's to names:
    -n      Show numeric ID's
    -nn     Show both textual and numeric ID's (names & numbers)
    -q      Query the PCI ID database for unknown ID's via DNS
    -qq     As above, but re-query locally cached entries
    -Q      Query the PCI ID database for all ID's via DNS
    
    Selection of devices:
    -s [[[[<domain>]:]<bus>]:][<slot>][.[<func>]]   Show only devices in selected slots
    -d [<vendor>]:[<device>]            Show only devices with specified ID's
    

    See man pages for full details

    List installed PCI devices

    $ lspci
    00:00.0 RAM memory: nVidia Corporation MCP65 Memory Controller (rev a3)
    00:01.0 ISA bridge: nVidia Corporation MCP65 LPC Bridge (rev a3)
    .....
    

    List in format useful for parsing with a script

    $ lspci -mm
    00:00.0 "RAM memory" "nVidia Corporation" "MCP65 Memory Controller" -ra3 "Micro-Star International Co., Ltd." "Device 7369"
    00:01.0 "ISA bridge" "nVidia Corporation" "MCP65 LPC Bridge" -ra3 "Micro-Star International Co., Ltd." "Device 7369"
    .....
    

    List in a tree format

    $ lspci -tv
    -[0000:00]-+-00.0  nVidia Corporation MCP65 Memory Controller
               +-01.0  nVidia Corporation MCP65 LPC Bridge
               +-01.1  nVidia Corporation MCP65 SMBus
    .....
    
  • Query and configure PCI devices
    /usr/bin/setpci

    A utility for querying and configuring PCI devices. All numbers are entered in hexadecimal notation. This is for low-level device stuff - see man pages if you ever want to use.

  • Display information about installed hardware
    /usr/bin/lsdev

    Is part of the procinfo package, uses the following files and has no cmd-line options.

    /proc/interrupts     IRQ channels
    /proc/ioports        I/O memory addresses
    /proc/dma            DMA channels
    

    List installed devices

    $ lsdev
    Device            DMA   IRQ  I/O Ports
    ------------------------------------------------
    0000:00:01.0                   3000-30ff
    0000:00:11.0                   3100-310f   3110-3117   3118-311f   3120-3123   3124-3127
    0000:02:00.0                     2000-20ff
    acpi                      9 
    ACPI                             0400-0403     0404-0405     0408-040b     0410-0415     0420-0427   0800-0800
    ahci                     43      3100-310f     3110-3117     3118-311f     3120-3123     3124-3127
    brcmsmac                 17 
    cascade             4       
    .....
    
  • Serial Advanced Technology Attachment (SATA)
    • A bus interface for connecting host bus adapters to mass storage devices such as hard disks and optical drives.
    • It was designed to replace the older ATA (AT Attachment) standard (also known as EIDE) and can use the same low level commands, host-adapters and devices.
    • It communicates via a high-speed serial cable over two pairs of conductors.
    • Parallel ATA uses 16 data conductors each operating at a much lower speed.

    Get, set SATA, ATA device params - /sbin/hdparm

    $ hdparm --help
    
    hdparm - get/set hard disk parameters - version v9.43, by Mark Lord.
    
    Usage:  hdparm  [options] [device ...]
    
    Options:
     -a   Get/set fs readahead
     -A   Get/set the drive look-ahead flag (0/1)
     -b   Get/set bus state (0 == off, 1 == on, 2 == tristate)
     -B   Set Advanced Power Management setting (1-255)
    .....
     -s   Set power-up in standby flag (0/1) (DANGEROUS)
    .....
     --fwdownload      Download firmware file to drive (EXTREMELY DANGEROUS)
    .....
     --write-sector    Repair/overwrite a (possibly bad) sector directly on the media (VERY DANGEROUS)
    

    Display driver identification

    $ sudo hdparm /dev/sda
    
    /dev/sda:
     multcount     = 16 (on)
     IO_support    =  1 (32-bit)
     readonly      =  0 (off)
     readahead     = 256 (on)
     geometry      = 121601/255/63, sectors = 1953525168, start = 0
    

    Get detailed, current information directly from drive

    $ sudo hdparm -I /dev/sda
    
    /dev/sda:
    
    ATA device, with non-removable media
        Model Number:       ST1000LM024 HN-M101MBB                  
        Serial Number:      S2U5J9DD149646      
        Firmware Revision:  2AR10001
        Transport:          Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0
    Standards:
    .....
        DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 *udma5 
             Cycle time: min=120ns recommended=120ns
        PIO: pio0 pio1 pio2 pio3 pio4 
             Cycle time: no flow control=120ns  IORDY flow control=120ns
    Commands/features:
    .....
        206min for SECURITY ERASE UNIT. 206min for ENHANCED SECURITY ERASE UNIT. 
    Logical Unit WWN Device Identifier: 50004cf209726a8a
        NAA     : 5
        IEEE OUI    : 0004cf
        Unique ID   : 209726a8a
    Checksum: correct
    

    * signifies the current active mode i.e. udma5

  • Expansion Cards

    Configuring expansion cards depends on the age of the hardware. For older devices it is necessary to ensure that there are no resource (IRQ, IO address and DMA) conflicts.

    Jumpers

    Configure via jumper settings on the card - somewhat dated.

    Non-volatile memory

    Requires support software, usually MS-DOS based. To configure hardware on Linux may require a working DOS system to provide initial hardware configuration.

    Hot Plugging

    More recent cards work with the PCI bus to configure themselves (udevd).

  • Plug and Play BIOS devices
    /sbin/lspnp (obsolete)
    • A legacy specification, NOT to be confused with UPnP (a networking specification).
    • It used to present a formatted interpretation of the contents of the /proc/bus/pnp tree.
    • Is part of the 'pnputils' package if that still exists.
    • Default output is a list of Plug and Play device node numbers, product identifiers and descriptions.
    lspnp [-b] [-v[v]] [device ...]
    
    Options:
     -b           Boot mode: read device resource information that will be used
                  at next boot (as opposed to current resource info).
     -v           One or more levels of verbosity.
    

    List all installed pnp devices

    $ lspnp
    00:00 PNP0a03 PCI bus
    00:01 PNP0200 AT DMA controller
    00:02 PNP0800 AT speaker
    .....
    00:0c PNP0c02 Motherboard resources
    00:0d PNP0c01 System board
    

    List current resources of device node 00:05

    $ lspnp -v 00:05
    00:05 PNP0700 PC standard floppy disk controller
        state = active
        io 0x3f0-0x3f5
        io 0x3f7-0x3f7
        irq 6
        dma 2
    
  • Modify Plug and Play BIOS device resources
    /sbin/setpnp (obselete)
    • Updates the system resource information for Plug and Play BIOS device nodes.
    • Is part of the 'pnputils' package.
    • By default, current (dynamic) device configuration information is modified.
    • A device is specified by its two-digit hex node number.
    • Some devices may only be reconfigured for the following boot. Be especially careful when modifying your system's boot configuration. Improper use of this command may disable vital system devices and render your system unbootable.
    setpnp [-b] device resource-list ...
    setpnp [-b] device {on|off} 
    
    Options:
     -b           Boot mode: 
                  update the device resource information that will be used at next boot.
    
    • A 'resource-list' consists of one or more space-separated pairs of a resource type with one or more values.
    • There are four types of resources - io, mem, irq and dma.
    • Multiple values for one resource type can be separated by commas.
    • Values can be either unitary or dash-separated ranges.
    • The order of items of different types is not important, but if more than one item of the same type is present, their relative order is significant.
    • The Plug and Play BIOS will reject invalid configuration attempts - 'setpnp' will not attempt to determine why a configuration was rejected.

    Manpage examples - set various resources for various devices

    # setpnp 0d io 0x2f8-0x2ff irq 3
    # setpnp 12 io 0x350-0x35f,0x2f8-0x2ff irq 3 irq 10
    # setpnp 0b irq off
    
  • Scan ISA PnP devices
    pnpdump (obsolete)
    • A utility that can determine what settings an ISA PnP card will work with.
    • It scans all the ISA PnP cards, dumping their resource data (IO ports, interrupts, DMA channels) to stdout.
    • Can be used with '-c|--config' and '--script=outputfile' to generate a script that can be used to configure the devices.
    pnpdump [--config] [--script[=outputfile]] [devs]
    
  • Configure ISA PnP devices
    isapnp (obsolete)

    Configures ISA PnP cards based on the information/instructions contained in the configuration file or gathered from 'pnpdump' and the /proc filesystem.

    isapnp [options] conffile