Book: LPI Linux Certification in a Nutshell
Section: Chapter 13.  Hardware and Architecture (Topic 1.1)



13.2 Objective 2: Set Up SCSI and NIC Devices

As described in Objective 1, when you add hardware to a PC you must accommodate the resource requirements of all installed devices. Some devices, in particular SCSI controllers and older network interfaces, require special configuration. This Objective describes in general terms some of these considerations.

13.2.1 NICs

More than ever before, today's PCs are expected to be connected to a network. This means that some form of network interface card (or NIC) is used to make the connection between the computer and the network. Older hardware, particularly Industry Standard Architecture (ISA) bus hardware, requires manual configuration. Exam 102 requires familiarity with these configuration problems.

Generally speaking, we may think about device configuration methodologies from one of three general eras:

Jumper era

This hardware was constructed in such a way that settings were controlled by changing the position of shorting jumpers on terminal strips. This method is inconvenient in that it requires internal access to the PC as well as available documentation on the jumper locations. On the other hand, it is a hardware-only solution, and the settings are obvious to the observer. Many such devices are still in service on older PCs.

Nonvolatile era

These more recent hardware designs abandoned jumpers in favor of settings that, while still manually set, are stored in a nonvolatile memory space. This design eliminated the physical access problem with jumpered hardware, but introduced a requirement that custom configuration programs be written, supported, and provided to consumers by hardware vendors. This software was almost always based on MS-DOS. Using these configuration tools to program a card for use under Linux may require a working MS-DOS machine to provide initial configuration.

Modern era

Most recent NICs work with the PCI bus to automatically configure themselves. The settings are done during system initialization, prior to loading the operating system. This automation eliminates manual configuration and frees the user from worrying about device conflicts.

To configure an older NIC, you may need to set jumpers or possibly run MS-DOS and a proprietary configuration utility. More often than not, factory default settings can be used with the Linux networking drivers. However manual configuration is accomplished, you'll need to be sure that you don't have conflicts with IRQs, I/O addresses, and possibly DMA channel assignments.

13.2.1.1 Using the /proc filesystem

When adding new hardware to an existing Linux system, you may wish to verify which resources the existing devices are using. The /proc filesystem, the kernel's status repository, contains this information. The proc files -- interrupts, dma, and ioports -- show how system resources are currently utilized. Here is an example of /proc/interrupts from a dual-CPU system with an Adaptec dual-AIC7895 SCSI controller:

# cat /proc/interrupts
           CPU0       CPU1
  0:   98663989          0          XT-PIC  timer
  1:      34698      34858    IO-APIC-edge  keyboard
  2:          0          0          XT-PIC  cascade
  5:       7141       7908    IO-APIC-edge  MS Sound System
  6:          6          7    IO-APIC-edge  floppy
  8:   18098274   18140354    IO-APIC-edge  rtc
 10:    3234867    3237313   IO-APIC-level  aic7xxx, eth0
 11:         36         35   IO-APIC-level  aic7xxx
 12:     233140     216205    IO-APIC-edge  PS/2 Mouse
 13:          1          0          XT-PIC  fpu
 15:      44118      43935    IO-APIC-edge  ide1
NMI:          0
ERR:          0

In this example, you can see that interrupt 5 is used for the sound system, thus it isn't available for a second parallel port. The two SCSI controllers are using interrupts 10 and 11, respectively, while the Ethernet controller shares interrupt 10. You may also notice that only one of the two standard IDE interfaces is enabled in the system BIOS, freeing interrupt 14 use for another device.

Here are the /proc/dma and /proc/ioports files from the same system:

# cat /proc/dma
 0: MS Sound System
 1: MS Sound System
 2: floppy
 4: cascade
# cat /proc/ioports
0000-001f : dma1
0020-003f : pic1
0040-005f : timer
0060-006f : keyboard
0070-007f : rtc
0080-008f : dma page reg
00a0-00bf : pic2
00c0-00df : dma2
00f0-00ff : fpu
0170-0177 : ide1
02f8-02ff : serial(auto)
0370-0371 : OPL3-SAx
0376-0376 : ide1
0388-0389 : mpu401
03c0-03df : vga+
03f0-03f5 : floppy
03f7-03f7 : floppy DIR
03f8-03ff : serial(auto)
0530-0533 : WSS config
0534-0537 : MS Sound System
e800-e8be : aic7xxx
ec00-ecbe : aic7xxx
ef00-ef3f : eth0
ffa0-ffa7 : ide0
ffa8-ffaf : ide1

On the Exam

You should be aware of the default resource assignments listed in Table 13-1. You should also know how to examine a running Linux system's resource assignments using the /proc filesystem.

13.2.2 SCSI

SCSI is an interface for streaming devices and block storage devices such as tape drives, hard disks, CD-ROMs, and other peripheral instruments. SCSI is the standard interface on server-style PCs, Unix workstations, and many older Apple models (mostly 604 and earlier systems). Desktop PCs and newer Apple systems (G3 and above) usually opt for the IDE (ATA)-style disk interfaces because they are less expensive. The advantage that SCSI has over IDE is that it offers much more flexibility and expandability, as well as faster throughput.

SCSI defines a bus to which multiple devices are connected. The medium is a high-quality cable or a series of cables connected to daisy-chained devices in series. One of the devices in the chain is the SCSI controller, which is the host interface to the other connected SCSI devices. The controller and all of the other devices on the bus are assigned a permanent SCSI address, also known as the SCSI ID, which defines each SCSI device uniquely on the bus. The controller can access devices individually by using the unique SCSI address to access a specific device.

13.2.2.1 SCSI types

The world of SCSI can be a little confusing, despite the standards set by ANSI. The original SCSI-1 interface is a 5-MBps (megabytes per second) 8-bit interface. It uses a 50-pin Centronics connector, similar to but larger than those found on most printers. This interface is still in popular use today, although the connector is usually replaced by a 50-pin micro-D connector. (This connector is similar to the DB-25 used for serial ports but has a much higher pin density.) As performance demands escalated, manufacturers began offering enhanced products with faster data transfer rates:

SCSI-1

The original: 8-bit, 5-MBps Centronics 50 connector.

SCSI-2

8-bit, 5-MBps Micro-D 50-pin connector. Interchangeable with SCSI-1. This interface is still adequate for low-end to midrange tape drives but is too slow for current technology disks.

Wide SCSI

16-bit, 10-MBps, Micro-D 68-pin connector. This standard uses a wider cable to support 16-bit transfers, obtaining faster throughput using the same clock rate.

Fast SCSI

8-bit, 10-MBps, Micro-D 50-pin connector. Higher throughput is obtained by doubling the original clock rate.

Fast Wide SCSI

16-bit, 20-MBps, Micro-D 68-pin connector. This interface combines both the higher clock rate and the wider bus.

Ultra SCSI

8-bit, 20-MBps, Micro-D 50-pin connector. Additional changes to clocking yield still better performance.

Ultra Wide SCSI (also known as SCSI-3)

16-bit, 40-MBps.

Ultra2

8-bit, 40-MBps.

Wide Ultra2

16-bit, 80-MBps.

Recent developments have yielded additional SCSI interface types with up to 160 MBps throughput, and efforts continue to keep SCSI competitive with other technologies. As performance increases, however, constraints on cabling and connectors become more significant. Such constraints are a major factor in deploying large SCSI-based systems. Also, with the variety of connectors, cables, and transfer rates available in the SCSI standards, it's important to plan carefully. The other inhibiting factor, at least on the consumer level, is that SCSI hard drives tend to cost two to three times the amount of a similar-sized IDE drive.

13.2.3 SCSI IDs

Each device on a SCSI bus, including the controller, has an address based on a binary reading of the address lines. The 8-bit SCSI buses have three address lines and thus will accommodate 23=8 devices, including the controller. For the 16-bit busses, there are four address lines resulting in a possible 24=16 devices. This results in a maximum of 7 and 15 devices, respectively. These addresses can be configured using jumpers (typical for disk drives) or switches. SCSI addresses run from to 7 for 8-bit buses and from to 15 for 16-bit buses. It is customary for the controller to occupy address 7 for both bus widths. Disks and other devices must be assigned a unique address on the bus, and they must be provided with proper termination, discussed later in this section.

13.2.3.1 SCSI logical unit numbers

Some SCSI devices, such as RAID controllers, appear to the SCSI controller as a disk drive with a single SCSI address. In order for the controller to access multiple logical devices using a single SCSI address, an accompanying logical unit number (LUN), is reported to the controller. Single disks and tape drives don't usually use the LUN or report LUN zero.

13.2.3.2 Linux SCSI disk device files

On Linux systems, IDE disk devices are known as /dev/hda, /dev/hdb, /dev/hdc, and /dev/hdd. For SCSI, a similar pattern emerges, with /dev/sda, /dev/sdb, and so on. The first partition on disk /dev/sda will be /dev/sdal -- but remember that the partition number has nothing to do with the SCSI ID. Instead, the letter names of the Linux SCSI devices start with sda and proceed across all SCSI IDs and LUNs. The numbers are sequentially assigned to partitions on a single ID/LUN combination.

For example, a SCSI-2 bus with two disks, a tape drive, a RAID controller with two LUNs, and the SCSI controller might be assigned addresses as shown in Table 13-2.

Table 13-2. Sample SCSI Configuration

Device

SCSI Address

LUN

Linux Device

Disk 0

0

-

/dev/sda

Disk 1

1

-

/dev/sdb

Tape drive

5

-

/dev/st0

RAID controller device 0

6

0

/dev/sdc

RAID controller device 1

6

1

/dev/sdd

Controller

7

-

-

If a disk on the SCSI bus is to be bootable, you may need to configure the SCSI controller's BIOS with the disk's address. By default, address is expected to be a bootable disk.

13.2.3.3 Termination

Another facet of SCSI that can be confusing is termination. A SCSI bus can be considered a cable with devices connected along its length, but not at the ends. Instead of devices, the ends of the SCSI bus have terminators, which are simple electrical devices that condition the signal and reduce electrical noise on the bus. However, most external terminators look like a bare connector at the end of a SCSI cable. Without a terminator, a SCSI bus can be marginally functional, but it's more likely that it will fail completely, so proper termination is extremely important. Termination can be particularly problematic if you attempt to mix 8- and 16-bit devices on a single bus and use an 8-bit terminator, leaving half of the 16-bit SCSI bus unterminated.

External terminators are straightforward because they are visible. Most device manufacturers include termination circuitry on their devices, so the application of an external terminator device is not always necessary. SCSI controllers can terminate one end of the SCSI bus while an external terminator or a disk's internal terminator is used on the other end. Whichever type of terminator is being used, you must be sure that exactly one terminator is placed at each end of the SCSI bus (for a total of exactly two terminators), otherwise the bus may fail.

13.2.3.4 SCSI controllers on PCs

Most PCs don't come with integrated SCSI controllers, but a number of add-on cards are available. SCSI controllers have their own firmware installed along with an accompanying BIOS, which has its own configuration menus. If you're using SCSI on a PC, it's important to be able to manipulate these settings appropriately.

Like the BIOS, a SCSI controller BIOS usually has a keyboard combination, announced at boot time, to enter the setup utility. Once the utility is launched, you can control a number of aspects of the controller, including:

Controller SCSI address

The default controller address is usually 7, but you may use any address.

Default boot device

Typically this is set to address 0 for a hard disk.

Onboard termination

Depending upon how a controller is utilized (internal or external bus, or both) you may elect to turn on the controller's terminator.

SCSI bus speed

Most SCSI adapters that are capable of higher speeds (Ultra SCSI, for example) can be manually set to lower speeds to accommodate older devices or longer cable lengths.

On the Exam

Be sure to be familiar with SCSI IDs, termination, the SCSI BIOS, and Linux SCSI device naming for the 102 exam.