Instructor Guide

Unit 6. Devices

What This Unit Is About

This unit introduces the concepts of devices, their different states and their location codes.

What You Should Be Able to Do

After completing this unit, you should be able to:

•  Describe the difference between logical and physical devices

•  Describe the purpose of the ODM predefined and customized databases

•  Describe different states of a device

•  Describe the format of device location codes

• Use SMIT to Add/Show/Change/Delete devices

How You Will Check Your Progress

Accountability:

•  Checkpoint questions

•  Exercises

References

AlX Version 4/5 Management Guide: Operating System and Devices

56

Instructor Guide

Objectives

After completing this unit, student should be able to:

•  Describe the difference between logical and physical devices

•  Describe the purpose of the predefined and customized databases

•  Describe different states of a device

•  Describe the format of device location codes

•  Use SMIT to Add/Show/Change/Delete devices

Figure 6-1. Objectives

Notes:

56

Instructor Guide

Device Terminology

Physical Devices

Ports

Device Drivers

Logical Devices

/dev Directory

Figure 6-2. Device Terminology

Notes:

In order to attach peripherals such as terminals and printers to an AlX system, we must tell AlX the characteristics of these devices so that the operating system can send the correct signals to the adapter to which the device is connected. A number of pieces of hardware and software must interact correctly for the device to function correctly.

•  Physical Devices - Actual hardware that is connected in some way to the system.

•  Ports - The physical connectors/adapters in the system where physical devices are attached. Most ports are programmable by the system software to allow attachment of many different types of devices.

•  Device Drivers - Software in the kernel that controls the activity on a port and the format of the data that is sent to the device.

•  Logical Devices - Software interfaces (special files) that present a means of accessing a physical device to the users and application programs. Data appended to logical devices will be sent to the appropriate device driver. Data read from logical devices will be read from the appropriate device driver.

•  /dev - The directory which contains all of the logical devices that can be directly accessed by the user. (Some of the logical devices defined are only referenced in the ODM customized database and cannot be accessed by users.)

56

Instructor Guide

Instructor Notes:

Purpose — Explain the terminology used when dealing with devices.

Details — Suggestion: Try to get the students to define these for you. In most cases, you will have some pretty good definitions coming from the class.

Additional Information — What is your definition of a physical device?

Answer: Something you can touch.

Transition Statement — We shall now look at the different types of devices that are present on the system.

56

Instructor Guide

Listing of /dev Directory

# Is -1 /dev
brw-rw-— / 1 / root system / 13,0 / Jan 24 02:25 / fd0
brw-rw-— / 1 / root system / 13,64 / Jan 24 02:25 / fd1
crw-rw-— / 1 / root system / 13,0 / Jan 24 02:25 / rfd0
crw-rw— / 1 / root system / 13,64 / Jan 24 02:25 / rfd1
crwxr-xr-x / 1 / root system / 20,0 / Jan 24 02:25 / rmt0
crwxr-xr-x / 1 / root system / 20,1 / Jan 24 02:25 / rmt0.1
crwxr-xr-x / 1 / root system / 20,2 / Jan 24 02:25 / rmt0.2
crwxr-xr-x / 1 / root system / 20,3 / Jan 24 02:25 / rmt0.3
crwxr-xr-x / 1 / root system / 20,4 / Jan 24 02:25 / rmt0.4
crwxr-xr-x / 1 / root system / 20,5 / Jan 24 02:25 / rmt0.5
crwxr-xr-x / 1 / root system / 20,6 / Jan 24 02:25 / rmt0.6
crwxr-xr-x / 1 / root system / 20,7 / Jan 24 02:25 / rmt0.7

Figure 6-3. Listing of/dev Directory

Notes:

There are a large number of devices that can be configured in the system. Devices can be one of two types:

•  Block Device - a structured random access device. Buffering is used to provide a block-at-a-time method of access. Usually only disk file systems.

•  Character (raw) device -a sequential, stream-oriented device which provides no buffering.

Most block devices also have an equivalent character device. For example, /dev/hd1 provides buffered access to a logical volume whereas /dev/rhd1 provides raw access to the same logical volume.

The Is -I command allows you to see the type of a file. A special file (in the /dev directory) will be indicated by a b in the first column for a block device or a c for a character device.

Normally the fifth field contains a numeric value indicating the number of bytes in the file. For devices, it shows the major and minor device numbers. The device rmt0 shown in the listing has a major device number of 20 and a minor device number of 0.

56

Instructor Guide

This indicates that the code to handle major device 20 must already be in the kernel, and it must handle device number 0 correctly. In the case of two tape drives, again the major device number of 20 is already in the kernel, and it must handle device number 1 correctly. More precisely, the major number refers to the software section of code in the kernel which handles that type of device, and the minor number to the particular device of that type.

Examples of block devices:

cd0 CD-ROM

fd0, fool, fd0h Diskette

hd1, Ivor Logical Volume

hdisk0 Physical Volume

Examples of character (raw) devices:

console, Ift, tty0 Terminal

Ip0 Printer

rmt0 Tape Drive

tok0, ent0, en0 Adapter

kmem, mem, null Memory

rfd0, rfd01, rfd0h Diskette

rhd1, rlv00 Logical Volume

rhdisk0 Physical Volume

56

Instructor Guide

Instructor Notes:

Purpose — Show the difference between the various types of device files.

Details — Often a physical device will have a number of logical device drivers.

Another example would be:

fd0

fd0h

fd01

fd0.9

fd0.18

fd0.36

rfd0

rfd0h

rfd01

rfd0.9

rfd0.18

rfd0.36

All these refer to the physical device fd0 (the first floppy diskette drive) but they work with the physical device in different ways.

How these are created and which are created is dependant on the device type.

Students may try the Is -I /dev command at their systems. If they do, they may notice that the major and minor numbers for a device may differ from system to system. For example, the major and minor numbers for the CD-ROM will be different depending on whether the system is a classical RS/6000 or a PCI-based RS/6000. The major and minor numbers are most important to those who are going to write device drivers.

Additional Information —

Transition Statement — All device information is stored in a database.

56

instructor Guide

Device Configuration Database

Figure 6-4. Device Configuration Database

Notes:

The predefined and customized databases store information about all of the logical devices in the system and their attributes managed by the ODM (Object Data Manager).

The predefined database contains configuration data for all possible devices supported by the system. The SMIT menus have options to install non-supported drivers. The contents of the predefined database is largely defined at installation time, ensuring that you always have support for devices in your system.

The customized database contains configuration data for all currently defined and configured (available) devices.

When installing new ISA devices, you may be asked for diskettes containing device driver code.

The Configuration Manager is a program that automatically configures devices on your system during system boot and run time. The Configuration Manager uses the information from the predefined and customized databases during this process, and updates the customized database afterwards.

56

Instructor Guide

Instructor Notes:

Purpose — Show how the device information and support are held in AlX.

Details — The ODM (Object Data Manager) is a repository for information about this system.

It contains device support, device vital product data, software support for these devices, etc.

The ODM is divided into two areas:

1.  Predefined contains the supported devices

2.  Customized contains the configured devices

There is a small terminology mismatch between SMIT and the ODM menu interfaces that look after devices in AlX:

SMIT ODM The World

supported predefined (unknown, not installed

yet)
defined customized defined

configured customized available

When the system is installed, support is added for all self-configuring devices discovered during the installation phase. Support for other devices is available on the install media.

Additional Information —

Transition Statement — We will now take a look at these classifications of devices and see the differences between the ODM databases.

56

Instructor Guide

List All Supported Devices

Pdbv (Predefined Devices)

# Isdev -P -H

class type subclass description

56

adapter / ethernet / isa
adapter / ppa / sio
adapter / token ring / pci
disk / 2000MB / SCSI
disk / odisk / scsi
memory / totmem / sys
printer / 4029 / parallel
printer / osp / rs232
tape / 150mb / SCSI
tty / tty / rs232
adapter / ncr810 / pci


IBM ISA Ethernet Adapter

Standard I/O Parallel Port Adapter

IBM PCI Token Ring Adapter

2.0GB SCSI Disk Drive

Other SCSI Disk

Memory Card

IBM 4029 Laser Printer

Other serial printer

150 MB 1/4-Inch Tape Drive

Asynchronous Terminal

Standard SCSI I/O Controller

56

# Isdev -Pc tape

56

tape tape


1200mb 150mb


SCSI

scsi


1.2 GB 1/4-Inch Tape Drive 150MB 1/4-Inch Tape Drive

56

Figure 6-5. List All Supported Devices

Notes:

Default characteristics for known device types are stored in the ODM predefined database.

Devices are classified by Class, Type and Subclass where "Class" indicates what the device does, "Type" indicates what model it is and "Subclass" indicates how it can be attached to the system.

There are also definitions for some unknown devices which can be attached to the system (for example, non-IBM serial or parallel printers or SCSI disk drives). These devices are either intelligent and need little configuration, or the device attachment method is standard (for example, parallel or RS232) and no "features" of the device are assumed when it is added.

To find out what devices are listed in the predefined database, use the SMIT option List All Supported Devices which runs the command Isdev -P

To find out the attributes of a predefined device, use the SMIT option Show Characteristics of a Supported Device which runs the command Isattr -D

56

Instructor Guide

The -P option pulls information from the predefined database in the ODM.

The -H option shows the headers for the output.

The -c option specifies the class of device.

SMIT is the best way to obtain a listing of currently supported devices for the system: smit devices -> List Devices -> List All Supported Devices

The devices listed may not physically exist on the system, but device support for them has been installed.

56

Instructor Guide

Instructor Notes:

Purpose — Show a sample of the supported devices and the information that is available from the list.

Details — If a SCSI disk was detected at installation time, then there will be a number of types of SCSI disks in the list.

If, on the other hand, there is no tape drive on the system then there will be none in this list. (More on installing device support later)

Additional Information —

Transition Statement — We shall now look at the configured devices on our systems.

56

List All Defined Devices

56

CuDv (Customized Devices)
# Isdev -C -H
name / status / location / description
sys0 / Available / 00-00 / System Object
bus0 / Available / 00-00 / PCI Bus
bus1 / Available / 04-A0 / ISA Bus
ppa0 / Available / 01-G0 / Standard I/O Parallel Port Adapter
IPO / Available / 01-G0-00-00 / IBM 4039 LaserPrinter
sa0 / Available / 01-J0 / Standard I/O Serial Port 1
tty0 / Available / 01-J0-00-00 / Asynchronous Terminal
memo / Available / 00-00 / Memory
scsi0 / Available / 04-C0 / Standard SCSI I/O Controller
hdiskO / Available / 04-C0-00-4.0 / 16 Bit SCSI Disk Drive
rmt0 / Available / 04-C0-00-2,0 / 5.0 GB 8mm Tape Drive
tr0 / Defined / Token-Ring Network Interface

# Isattr -E -I sys0 -a realmem

False

realmem 131072 Amount of usable physical memory in Kbytes

description user_settable

State of system keylock at boot time False

Amount of usable physical memory Kbytes False
Continuously maintain DISK I/O history True

# Isattr -EH -I sys0
attribute value

keylock normal

131072 true

realmem iostat

Figure 6-6. List All Defined Devices

Notes:

The devices that have been customized in the system are described in the ODM customized database. Each device has a logical device name, a status, a location and various attributes.

The Isdev -CH command provides information on the resource name, its status (or state), the address or location, and a brief description of all devices in the customized database.

This list contains those devices that are found on the system. The status column will contain :

Available: The device is ready and can be used Defined: The device is unavailable

Devices may appear in a defined state after a restart. If this is the case, it may be due to the fact that the device is powered off or the fact that the device no longer exists on the system.

56

Instructor Guide

Every logical device is assigned a location code when it is attached to the system. Location codes depend on the type of device and the adapter to which the device is connected. Note that tr0 is a network interface and thus has no location code.

The Isattr -E -I [resource name] command provides detailed information on the effective attributes currently configured for specified devices. In the example, it provides configuration information on the system itself.

The -C option for Isdev pulls the customized information from the ODM.

The -E option for Isattr shows the effective attributes.