Connect With Us

LPI Exam Objective 101.1: Determine and Configure Hardware Settings

Objective 101.1 of the LPI exam focuses on how to determine the settings of various hardware components as well as how to make hardware settings.

The first objective in the LPIC-1 certification that we're going to take a look at is objective 101.1: determine and configure hardware settings. Remember that the questions on the LPI certification exam are geared toward a PC architecture/implementation, so there will be some concepts (e.g., ISA) that won't apply to a PowrLinux implementation. In these blogs, I'll present information specific to PowerLinux; to help you quickly and easily find this information, PowerLinux-related text will be bolded. 

The LPI weight and description of this topic are as follows: 

Weight

 2

Description

Candidates should be able to determine and configure fundamental system hardware

The questions in topic 101.1 are designed to concentrate on the following key knowledge areas:

  • Enable and disable integrated peripherals
  • Configure systems with or without external peripherals (e.g., the keyboard)
  • Differentiate between various types of mass storage devices
  • Set the correct hardware ID for different devices, especially boot defines
  • Know the difference between coldplug and hotplug devices
  • Determine hardware resources for devices.
  • Tools and utilities to list various hardware information (e.g., lsusb, lspci)
  • Tools and utilities to manipulate USB devices
  • Conceptual understanding of sysfs, udcv, hald, and dbus

Terms and utilities that are likely to be seen in topic 101.1 include:

  • /sys: A directory that contains information about the hardware in the system
  • /proc: A directory used to access process and other system information from the Linux kernel
  • /dev: A directory that contains special files used to represent the various hardware devices installed in the system
  • modprobe: Command to load a module based on a detected device
  • lsmod: Command to list loaded kernel modules
  • lspci: Command to list PCI devices
  • lsusb: Command to list USB devices

/sys and /proc aren’t directories in the usual sense; rather, they're pseudo-file systems that are created dynamically whenever they're accessed and represent real-time information from the OS.

Hotplug vs. Coldplug

Hotplug is a mechanism used to keep the state of the OS updated when pluggable hardware devices are added or removed. Hotplug typically refers to USB devices, although it's possible to hotplug SCSI devices as well. Commands related to the hotplug capability of the Linux OS will be covered later in this entry.

Listing Allocated Resources

The kernel keeps information related to allocated resources in the /proc directory.  Relevant files in the /proc file system include:

  • /proc/cpuinfo: Identifies the type of processor used in the system
  • /proc/devices: Displays the various character and block devices currently configured
  • /proc/dma: Contains a list of the registered ISA DMA channels in use
  • /proc/fb: Contains a list of frame buffer devices
  • /proc/interrupts: Records the number of interrupts per IRQ
  • /proc/ioports: Provides a list of currently registered port regions used for input or output communication with a device
  • /proc/pci: Listing of every PCI device on the system

Allocated resources can be listed using tools such as lspci and dmesg. The lspci command is used to list chipset information of all attached PCI components. Additionally, lspci can list I/O and IRQ settings with the –v flag. The –b (BUS centric) option for lspci will show allocations assigned by the PCI bus rather than the kernel.

The dmesg command is used to continuously display kernel messages. dmesg can also be used to display the kernel messages logged at boot time during the “kernel” stage.

The following table shows some typical resource allocations:

Device

I/O port

IRQ

/dev/ttyS0

0x03f8

4

/dev/ttyS1

0x02f8

3

/dev/lp0

0x378

7

/dev/lp1

0x278

5

Soundcard

Ox220

 

Keep in mind that these allocations are typical PC-based resource allocations.

The interrupt information on a Power system will be different. For example, on a Power 5-520, the /proc/interrupts file on a SuSE SLES 11 shows the following:
          

<strong>           CPU0       CPU1
 16:     242554     467437   XICS      Level     IPI
 17:        266          0   XICS      Level     hvc_console
 18:    2899354          0   XICS      Level     eth0
 19:     734100          0   XICS      Level     ibmvscsi
 20:          0          0   XICS      Level     RAS_EPOW
BAD:     191591


</strong>

The hvc_console device is used to present the console via the HMC or IBM i virtual console support.  The eth0 device is the Ethernet device (in this case a virtual device), and the ibmvscsi devices are the virtual SCSI devices that are used to present virtual disk storage from an IBM i or VIOS partition to the Linux partition.

PC Expansion Cards

ISA and PCI are the most common types of expansion cards. Modern Linux kernels (2.4 and above) have full support for ISA and PCI busses. Prior to the 2.4 kernel, ISA busses had to be scanned in order to detect existing expansion cards (e.g., sound, Ethernet). The following process would be followed:

  • The pnpdump command, included in the isapnptools package, scanned the ISA bus for Plug and Play (pnp) devices
  • Output from the pnpdump command would be redirected to the /etc/isapnp.conf configuration file
  • During the booting process, the isapnp command would read the isapnp.conf file and configure the ISA pNp devices

The PnP installation has been supported since the 2.4 version of the Linux kernel through a kernel module called isapnp.o

USB Support

Universal Serial Bus (USB) is a communication architecture designed to connect devices to a PC. USB devices are divided into the following classes:

  • Display Devices
  • Communication Devices
  • Audio Devices
  • Mass Storage Devices
  • Human Interface Devices (HID)

USB devices are plugged into a USB port, which is driven by a USB controller.

Information on how USB devices are physically attached to a Linux system can be displayed with the lsbusb command:

# lsusb &ndash;t

There are three types of USB host controllers supported by the Linux kernel:

Host Controller

Kernel Module

USB Version

Open Host Controller Interface (OHCI) – compaq)

usb-ohci.o

1.1

Universal Host Controller Interface (UHCI) – (Intel)

usb-uhci.o

1.1

Enhanced Host Controller Interface (EHCI) – (USB v2.0)

ehci-hdc.o

2.0

SCSI Devices

Linux supports two types of SCSI interfaces:

  • 8-bit interface with a bus that supports 8 devices (including the controller), so there's space for 7 block devices (tape, disk, etc.)
  • 16-bit interface with a bus that supports 16 devices (including the controller), so there's space for 15 block devices

SCSI devices are uniquely identified using a set of three numbers called the SCSI ID:

Component

Description

SCSI Channel

Each SCSI adapter supports one data channel on which to attach SCSI devices (disk, CDROM, etc). These channels are numbered from 0 onwards.

Device ID number

Each device is assigned a unique ID number that can be set using jumpers. The IDs range from 0 to 7 for 8-bit controllers and from 0 to 15 for 16-bit controllers

Logical Units

The Logical Unit Number (LUN) is used to differentiate between devices with a SCSI target number. This is used, for example, to include a particular partition within a disk drive on a particular tape drive within a multi-drive tape robot.

PowerLinux systems can have real/physical SCSI devices as well as virtual SCSI devices. The virtual SCSI devices are presented to PowerLinux through a client/server adapter relationship between the Linux partition and the partition (VIOS or IBM i) that's abstracting the storage to the Linux partition—where the client SCSI adapter is allocated to the Linux partition and the server SCSI adapter is allocated to the host (VIOS or IBM i) partition.

From a device representation viewpoint, Linux makes no distinction between the real and virtual SCSI devices. For example, SCSI disk devices are represented as /dev/sd? devices, where the ? is replaced with an ascending letter (a for the first drive, b for the second, and so forth). This representation is used for physical and virtual SCSI disk devices.

SCSI devices can be added to the SCSI device while Linux is running. So, if a Linux partition has been allocated virtual disk resources from an IBM i partition, a new virtual disk can be allocated through the linking of a Network Server Storage Space to the Network Server Description associated with the Linux partition’s virtual SCSI adapter. Once the device has been added, the SCSI device can be scanned with the command:

<strong>echo &ldquo;0 0 0&rdquo; > /sys/devices/vio/30000003/host0/scsi_host/host0/scan
</strong>

where the 30000003 portion of the directory name indicates the partition number of the hosting partition (the first 3). The adapter number of the virtual SCSI serve adapter on the hosting partition that's providing the virtual storage (the trailing 3) and the host0 portion of the directory name indicate the first scsi bus.

There are some additional interesting files in the above directory that are worth taking a look at:

  • config: Contains the name of the partition, network server description, host name, domain name, and nameservers
  • partition_name: Contains the name of the partition hosting the virtual storage (i.e., the name of the partition that the virtual scsi server adapter is allocated to)
  • partition_number: Contains the partition number of the partition hosting the virtual storage
  • proc_name: Indicates the process/driver for this scsi bus (in this case, ibmvscsi)

Network Cards

Network Interface Cards (NIC) installed in a Linux system must be supported by the kernel. Information concerning the current network card can be obtained from a number of Linux tools, including dmesg, lspci, scanpci, /proc/interrupts, /sbin/lsmod, and /etc/modules.conf.  Here are examples of some of these commands and the output they provide:

# dmesg

Linux Tulip driver version 0.9.14 (Feburary 20, 2001)
PCI: Enabled device 00:0f.0 (0004 -> 0007)
PCI: Found IRQ 10 for device 00:0f.0

 

# cat /proc/interrupts

0:         87269602   XT-PIC timer
1:                4   XT-PIC keyboard
2:                0  XT-PIC cascade
7:                0   XT-PIC parport0
8:                1   XT-PIC rtc
10:           622417  XT-PIC eth0
11:                0  XT-PIC usb-uhci
14:           143040  XT-PIC ide0
15:              180  XT-PIC ide1

Networking for PowerLinux can be provided through physical network adapters allocated to the Linux partition and/or virtual Ethernet adapters configured for the Linux partition. Both physical and virtual network adapters will present themselves to Linux as network devices, and network identifiers (such as eth0) will be assigned by the OS.

For virtual network adapters, support is provided through the ibmveth driver as shown in output from the dmesg command:

<strong>drivers/net/ibmveth.c: ibmveth: IBM i/pSeries Virtual Ethernet Driver 1.03
vio_register_driver: driver ibmveth registering
</strong>

Likewise, the lsmod (list modules) command shows the ibmveth driver. Notice that it also shows the ibmvscsic driver, which provides support for virtual SCSI devices:

<strong>Module                  Size  Used by
binfmt_misc            14836  1
ipv6                  408208  20
fuse                   84384  1
loop                   25620  0
dm_mod                107136  0
sr_mod                 24828  0
cdrom                  46816  1 sr_mod</strong>
<strong>st                     50972  0
sg                     50048  0
ibmveth                27600  0
sd_mod                 46360  3
crc_t10dif              2376  1 sd_mod
ibmvscsic              34224  2
scsi_transport_srp      9992  1 ibmvscsic
scsi_tgt               20424  1 scsi_transport_srp
scsi_mod              232776  7 sr_mod,st,sg,sd_mod,ibmvscsic,scsi_transport_srp,scsi_tgt

</strong>

The /sys directory for Virtual Ethernet adapters on PowerLinux can be found at /sys/devices/vio/30000002/net/eth0, where the 30000002 portion of the directory name indicates the virtual Ethernet adapter slot (in this case, 2) and eth0 indicates the device name that Linux has assigned to the network device.  Files of interest in the directory include:

  • address:  The MAC address of the network adapter

  • mtu:  The frame size supported by the adapter

Files

A successful candidate for LPI certification will be familiar with the following files:

File

Description

/etc/isapnp.conf

A configuration file for isapnp

/proc/dma

List of currently used DMA channels

/proc/interrupts

List of currently used interrupts

/proc/ioports

List of currently used I/O ports

/proc/pci

List current information about the PCI bus

/etc/hotplug/usb.usermap

List of recognized USB devices

/var/log/dmesg

Log file for current and boot time kernel messages

/proc/scsi/scsi

Information about all SCSI devices.

Commands

A successful candidate for the LPI certification will be familiar with the following Linux commands:

Command

Description

dmesg

Print kernel messages since boot time

hotplug

Program used by the kernel to handle hardware related events

Isapnp

Tools used to initialize ISA cards prior to kernel 2.4

lspci

List all PCI devices

lsusb

List all USB devices

pnpdump

Dump ISA plug-and-play device resource information

scsi_info

SCSI device description tool

setserial

Get/set Linux serial port information

usbmgr

User space daemon, which loads or unloads USB modules

usb.agent

A hotplug agent, which handles USB related events.

wvidal

A PPP dialer

 

 

 

 

Please or Register to post comments.

What's PowerLinux Blog?

PowerLinux tips along with 42 topics and 10 objectives designed to help POWER Pros pass the Linux Professional Institute level 1 exams

Contributors

Erwin Earley

Erwin Earley is a managing consultant at IBM who has worked with the Rochester, Minn., development lab since 1996. Erwin currently works with customers implementing open-source solutions on the IBM...
Blog Archive