Datenverwaltung, Ein-/Ausgabe

it-Akademie Bayern z/OS und OS/390 Lehrgang 2008

Prof. Dr.-Ing. Wilhelm G. Spruth

Teil 8

Adressierung des Ein-/Ausgabe Subsystems

EA 0701 ww6 © copyright W. G. Spruth, 08-2004 wgs 10-02

Adressierung im Ein-/Ausgabe Subsystems

IBM zSeries Connectivity Handbook International Technical Support Organization, May 2003 SG24-5444-03

f:\grx\redbooks\connect1.pdf

Devices

System z verwendet den Begriff “Device”, eine Abkürzung für I/O Device.

Typische Devices sind

• Plattenspeicher (DASD, Disk Drive), • Magnetbänder, • Drucker, • ......

Heute werden fast ausschließlich logische DASDs vom Typ 3390 eingesetzt. Diese werden von einem Enterprise Storage Subsystem (ESS) auf regulären 3 ¼ Zoll Platten emuliert.

Devices werden von einem System mit Hilfe eines Device Identifiers adressiert

Early system design

The DASD (disk drive) marked with an X has address 132, derived as shown below

8 Bit 8 Bit

Device Address

The disk drive marked with an Y can be addressed as 171, 571, or 671 because it is connected through three channels. By convention the device is known by its lowest address (171), but all three addresses could be used by the to access the disk drive.

Multiple paths to a device are useful for performance and for availability. When an application wants to access disk 171, the operating system will first try channel 1. If it is busy (or not available), it will try channel 5, and so forth.

Shown is another S/360 system with two channels connected to control units used by the first system. This sharing of I/O devices is common in all mainframe installations. Tape drive Z is address A31 for the first system, but is address 331 for the second system.

Current mainframes use a different approach.

In the good old S/360 days, a device address such as 583 meant channel 5, control unit 8, device 3 and this was the address of the device. No S/390 machines work this way today, but the old terminology is often used. This terminology is technically incorrect, but is so widely used that you must understand it. If someone tells you to “IPL from address 583” they really mean to IPL from device number 583.

For all S/390 machines, the hardware address of a device will be something like chipd 05, CU 3, UA 7. This is similar to the old S/390 addresses; a chpid is a channel, the CU number is a control unit address, and the UA is a unit address (that can normally range up to x’FF’). However, the software never sees this hardware address. The S/390 I/O subsystem, using the IOCDS data, converts the chpid/CU/UA “hardware address” into a device number. The operating system uses the device number to connect to I/O devices. The operating system and applications never see the actual hardware addresses (the chpid, CU, and UA numbers).

Historische Entwicklung

Parallel-I/O-interface

For a channel path of the parallel-I/O-interface type, the device identifier is called a device address (unit address) and consists of an eight-bit value.

ESCON-I/O interface

For the ESCON-I/O interface, the device identifier consists of a four-bit control-unit address and an eight-bit unit address .

FICON-I/O interface

For the FICON-I/O interface, the device identifier consists of an eight-bit control-unit-image ID (address) and an eight-bit unit address.

The unit address (device address) identifies the particular I/O device (and, on the parallel-I/O- interface, the control unit) associated with a subchannel.

E/A Konfigurations-Netzwerk

Channel Subsystem

Hauptspeicher FF ... FF

CPU CPU CPU Benutzer Prozesse

Ke r n e l SAP SAP 00 ... 00 HSA

CH. CH. CH. CH. Kanäle

Channel Subsystem

CU CU CU CU CU CU

CU = Control Unit

Plattenspeicher

Das Channel Subsystem wird durch mehrere Prozessoren (als System Assist Prozessoren, SAP, bezeichnet) und entsprechenden Code verwirklicht. Die SAPs greifen parallel zu den CPUs auf den Hauptspeicher zu und entlasten diese von Ein-/Ausgabe Aufgaben.

Die HSA (Hardware System Area) ist ein Teil des Hauptspeichers. Sie liegt außerhalb des Adressenraums, auf den die CPUs zugreifen können. Das Channel Subsystem besteht aus SAP Prozessoren und Code in der HSA. Es bildet das virtuelle E/A Subsystem, mit dem der Betriebssystem Kernel glaubt zu arbeiten, auf die reale E/A Struktur ab.

Es 0370 ww6 wgs 10-04

Haupt- CPU speicher

256 Kanäle

Kanal Kanal Kanal Kanal Kanal

CU CU CU CU CU

256 Devices pro CU CU CU CU CU Kanal

max.

S/390 Device Identifikation

0 7 8 15

16 Bit I/O Address Channel Device Address Address max. 256 Channels und max. 256 Devices pro Channel

Heutige Konfiguration

Die früheren parallelen Kanäle wurden durch serielle ESCON und FICON Kanäle ergänzt. Letztere werden gemeinsam als „Channel Path“ bezeichnet und durch eine 8 Bit Channel Path ID (CHPID) or physical channel identifiers (PCHIDs) gekennzeichnet. Ein Channel Subsystem kann maximal 256 Channel Path unterstützen.

Auf eine Control Unit kann über unterschiedliche Channel Path zugegriffen werden,

Heutige Konfiguration (3)

Eine Ein/Ausgabe Einheit (Device), z.B. ein Plattenspeicher, wird eines 16 Bit Device Identifiers angesprochen. Für FICON besteht dieser aus einer 8 Bit Control Unit Nr. und einer 8 Bit Device Address. Letztere wird auch als Unit Address bezeichnet.

0 7 8 15 16 Bit Device Identifier Control Device Unit Nr. Address

Auszug aus

z/Architecture Principles of Operation (1)

One subchannel is provided for and dedicated to each I/O device accessible to the channel sub- system.

Up to 256 I/O devices can be addressed on a single parallel-I/O interface.

Up to 256 devices can be attached to each control unit that uses the serial-I/O interface

The channel subsystem provides information about associated I/O devices to CPUs, which obtain this information by executing I/O instructions. The actual number of subchannels provided depends on the model and the configuration; the maximum addressability is 65,536.

The maximum addressability of channel paths provided by a channel subsystem is 256.

Auszug aus

z/Architecture Principles of Operation (2)

A device identifier is an address, not apparent to the program, that is used by the channel subsystem to communicate with I/O devices. The type of device identifier used depends on the specific channel-path type and the protocols provided.

Each subchannel contains one or more device identifiers. For the FICON-I/O inter-face, the device identifier consists of an eight-bit control-unit-image ID and an eight-bit device address.

Identifikation von Fritz Müller

Normalerweise:

Fritz Müller geb. 21. Juni 1985 Geburtsort Augsburg

Vater Staat benutzt statt dessen für die deutsche Rentenversicherung eine Nummer, z.B.:

970 63210685S048 11 die Fritz Müller eindeutig identifiziert.

Identifikation von Fritz Müller

System z Devices

Normalerweise:

Fritz Müller geb. 21. Juni 1985 Device Nr. Geburtsort Augsburg

Vater Staat benutzt statt dessen für die deutsche Rentenversicherung eine Nummer, z.B.:

970 63210685S048 11 Device Identifier die Fritz Müller eindeutig identifiziert.

Heutige Konfiguration (1)

4 Begriffe:

Channel Path ID (CHPID) 8 Bit Subchannel Number 16 Bit Device Nr. (1 pro Subchannel) 16 Bit Device Identifier 16 Bit

Der Device Identifier besteht aus einer

8 Bit Control Unit Address und einer 8 Bit Device Address.

Die 8 Bit Device Address wird häufig auch als Unit Address bezeichnet und ist nicht zu verwechseln mit der 16 Bit Device Nr.

Subchannel

A subchannel provides the logical appearance of a device to the program and contains the information required for sustaining a single I/O operation.

The subchannel consists of internal storage (UCW) that contains information in the form of a

• CCW address, • channel-path identifier, • device number, as well as additional Information like count, status indications, and I/O-interruption sub-class code, path availability and functions pending or being performed.

I/O operations are initiated with a device by exe- cuting I/O instructions that designate the subchannel associated with the device.

Subchannel Number

A subchannel number is a system-unique 16-bit value used to address a subchannel. The subchannel is addressed by eight I/O instructions:

• CANCEL SUBCHANNEL, • CLEAR SUBCHANNEL, • HALT SUBCHANNEL, • MODIFY SUBCHANNEL, • RESUME SUBCHANNEL, • START SUBCHANNEL, • STORE SUBCHANNEL, and • TEST SUBCHANNEL.

Each I/O device accessible to the channel subsystem is assigned a dedicated subchannel at installation time. All I/O functions relative to a specific I/O device are specified by the program by designating the subchannel assigned to the I/O device.

Normally, subchannel numbers are only used in communication between the CPU program and the channel subsystem.

START SUBCHANNEL Machine Instruction

When START SUBCHANNEL is executed, parameters are passed to the target subchannel requesting that the channel subsystem perform a start function with the I/O device associated with the subchannel. The channel subsystem performs the start function by using information at the sub- channel, including the information passed during the execution of the START SUBCHANNEL instruction, to find an accessible channel path to the device. Once the device has been selected, execution of an I/O operation is accomplished by the decoding and executing of a CCW by the channel subsystem and the I/O device.

Am operation-request block (ORB) is designated by a START SUBCHANNEL instruction.

Subchannel Number

• Device identification used for communication between z/OS and channel subsystem • 16 Bit, 65 536 possible devices • Index for the UCW table (Unit Control Word table) within the HSA. • Used by microcode during execution of the SSCH (Start Subchannel) machine instruction • Stored in the UCB at IPL time • Independent of device number • Used for communication between I/O Supervisor and Channel Subsystem (CSS)

UCW Table

UCW

Subchannel Number

Each device is identified to

• humans by a 16- bit device number • the Channel Subsystem by a 16- bit subchannel number

Subchannel Number

A subchannel number is a system-unique 16-bit value used to address a subchannel. The sub- channel is addressed by eight I/O instructions, e.g START SUBCHANNEL.

Each I/O device accessible to the channel subsystem is assigned a dedicated subchannel at installation time. All I/O functions relative to a specific I/O device are specified by the program by designating the subchannel assigned to the I/O device.

Normally, subchannel numbers are only used in communication between the CPU program and the channel subsystem.

The Channel subsystem uses a Device Identifier to communicate with a particular device.

z/OS Channel Adressenraum Subsystem des Kernels HSA

UCB UCW

Subchannel Device Unit Address Nr. Nr. (Device Address)

Unit Control Block (UCB) Unit Control Word (UCW)

Der (UCB) wird vom Betriebssystem unterhalten. Er enthält die Subchannel Nr. und die entsprechende Device Nr.

Das Unit Control Word (UCW) wird vom Channel Subsystem unterhalten. Er enthält die Device Nr. und die entsprechende Unit Address

Device Number

Each subchannel that has an I/O device assigned to it also contains a system-unique parameter called the device number. The device number is a 16-bit value that is assigned as one of the parameters of the subchannel at the time the device is assigned to the subchannel.

The device number provides a means to identify a device, independent of any limitations imposed by the system model, the configuration, or channel- path protocols. The device number is used in communications concerning the device that take place between the system and the system operator.

For example, the device number is entered by the system operator to designate the input device to be used for initial program loading.

Any operator command that refers to a device uses the device number.

The subchannel number is assigned to the subchannel (UCW) representing the device at POR time. It indicates the relative position of the UCW in the UCW table. The specific value depends on the position of the statement I/O DEVICE in the Input/Output Configuration Program (IOCP).

It is used to reference the device during the communication between z/OS and the channel subsystem as well as during execution of the SSCH instruction and during interrupt processing. The subchannel number was designed to speed up the search of a UCW during the SSCH processing. The same device accessed by different logical partitions has one UCW per image.

The subchannel number is expressed in a 16-bit value, whose valid range is 0000-FFFF, allowing for a maximum of 65,536 devices per z/OS image. Stored in the UCB at IPL, it is not declared during Hardware Configuration Definition.

Unit address

The unit address (UA) or device address is used to reference the device during the communication between a channel and the control unit serving the device. The UA is two-hex digits in the range 00-to-FF stored in the UCW as declared in HCD, and it is transmitted over the I/O interface to the control unit by the channel.

Each parallel channel supports the full unit address range of 00-to-FF and so allows connection of up to 256 devices. For an ESCON interface, architecturally the control unit supports the full unit-address range of 00-to-FF and may support up to 256 devices.

Mapping subchannel number in unit address

The UCB has all the information needed for the preparation of the SSCH instruction by IOS, including the subchannel number.

The subchannel number is used by the channel subsystem to find the UCW in its UCW Table.

A device identifier (for FICON an 8 bit control unit address plus 8 bit unit address) is an address, that is used (not apparent to the program) by the channel subsystem to communicate with I/O devices. The channel subsystem, will find in the UCW the receiver address (link, control unit, and unit address) to be sent over a FICON or ESCON connection.

Any operator command that refers to a device uses the device number.

Device number

The device number is a kind of nickname for the device. It is assigned at HCD creation by the installation. It is used to reference the device during the communication between z/OS and human beings, as well as in messages and console commands, JCL, RMF device reports, and at IPL to indicate the SYSRES device.

A device number is contained in a 16-bit value field, whose valid range is 0000-FFFF, which allows for a maximum of 65,536 devices. The device number is stored in the UCW table (within the HSA) at power-on reset (POR) and in UCB at IPL. UCW represents the device from the channel subsystem point of view; a UCB represents the device from the I/O Supervisor (IOS) point of view.

8 Bit Control Unit Nr. 8 Bit Unit Address = Device Address

0 7 8 15 16 Bit FICON Device Identifier

The Unit Address (UA) has no relationship to the device number or the subchannel number for a device. During Hardware Configuration Definition (HCD) the unit address frequently defaults to the last two digits of the device number, if not explicitly specified.

The unit address defined in HCD must match the unit address on the control unit where the device has been physically installed by the hardware service representative.

In the example, the operator issues the V PATH command for device number 2004. A separate I/O operation must be started for each device. The device number 2004 corresponds to the UA 04 and this is the address that the channel sends to the control unit

In summary, the device number is used in communication between an operator and z/OS; the subchannel number is used in communication between z/OS and channel subsystem; and the unit address is used in communication between the channel and the control unit.

Channel-Path Identifier

The channel-path identifier (CHPID) is a system- unique eight-bit value assigned to each installed channel path of the system. A CHPID identifies a physical channel path device, independent of any limitations imposed by the system model, the configuration, or channel-path protocols.

A device can be accessed over one of several channel path. The device identifier is thus unrelated to the channel path identifier.

Ein-/Ausgabe Steuerblöcke

Anwendungsprogramm DCB DEB Data Extend Block UCB Unit Control Block

Access Method IOB Input/Output Block ECB Event Control Block

I/O Driver, z.B. EXCP SRB System Request Block IOSB Input/Output Supervisor Control Block

IOS UCB Unit Control Block IOQ Input/output Queue ORB Object Request Block IRB Interrupt Request Block PSA Prefixed Save Area HSA Hardware System Area

Channel Subsystem CPID Channel Path Identifier UCW Unit Control Word

Hardware HSA Hardware System Area

Devices Device Nr. 16 Bit Subschannel Nr. 16 Bit Unit Address 8 Bit Channel Path Identifier 8 Bit

EA 0803 ww6 wgs 10-02

Konfigurieren des Ein-/Ausgabe Subsystems

Das Konfigurieren des Ein-/Ausgabe Subsystems erfolgt mit Hilfe eines Hardware Configuration Dialogs (HCD).

HDC Functions

The channel subsystem and the operating system need to know what hardware resources are available in the system and how these resources are connected. This information is called hardware configuration.

The Hardware Configuration Definition (HCD) facility is an interactive interface that is used to define the hardware configuration for both the channel subsystem and the operating system.

The output of HCD is a central repository of configuration information called the Input/Output Definition File (IODF).

Hardware Configuration Definition facility

The Hardware Configuration Definition (HCD) facility runs under TSO. It is a panel-driven facility which prompts the user.

I/O Devices, Channels

Inhaltlich beschreibt eine I/O-Konfiguration ein Netzwerk, dessen Endpunkte die Channel Adapter Karten des Systems und die I/O-Devices darstellen. Host Channel Path IDs (CPID) werden über Steuereinheiten (CU) mit Device-Nummern verbunden.

Die Device-Nummer ist eine vierstellige (16 Bit) Hexadezimalzahl.

es 3037 ww2000 meyburg wgs 10-02

I/O Definition

Ein z/OS Betriebssystem benötigt eine I/O Definition, um externe Geräte ansprechen zu können. Diese I/O Definition ist in der I/O Definition File (IODF) gespeichert.

Die Informationen in dieser Datei müssen zum Zeitpunkt des IPL dem Betriebssystem bekannt gegeben werden.

Die I/O Definition wird über das z/OS Konfigurationsprogramm HCD (Hardware Configuration Dialog) erstellt. Dabei werden zwei unterschiedliche Konfigurationsdateien erstellt. Die zweite Lage hat historische Gründe. Sie entstand um die Migration von älteren auf neuere Systeme zu erleichtern.

• IOCP (I/O Configuration Program) für die Hardware erstellt IOCDS Datei (Input/Output Configuration Data Set) • IODF (I/O Definition File) wird vom Betriebssystem benutzt.

IOCP wird während des IML (Initial Microprogram Load) benötigt, damit der Microcode die externen Geräte ansprechen kann.

Im Wesentlichen werden aus dem IOCP die Subchannel und aus dem IODF die UCBs generiert.

HDC

IOCP IODF

IOCDS gespeichert in der HSA

Channel z/OS Subsystem Kernel

System Initialisierung

The Hardware Configuration Definition (HCD) facility is used at system installation time to generate a central repository of configuration information called the Input/Output Definition File (IODF).

The Input/Output Configuration Program (IOCP) is used to build the I/O hardware configuration used by the channel subsystem. The HCD facility uses the IODF to generate input for IOCP. The output of the IOCP is the Input/Output Configuration Data Set (IOCDS).

The IODF is also used at Initial Program Load (IPL) time to build the I/O configuration for the z/OS and OS/390 software.

Operating System I/O Configuration Information

Bei Power-On-Reset wird die IOCDS-Information in die Hardware System Area (HSA) geladen. Einzelne Devices werden durch Unit Control Words (UCW) repräsentiert.

The HSA is addressable only by hardware.

When an Initial Program Load (IPL) is performed for the z/OS (or OS/390) system, the IODF that defines the configuration to the system is selected and used. The Hardware Management Console (HMC) Load Profile identifies the system residence (SYSRES) volume and specifies the load parameter.

The load parameter identifies the device number of the IODF volume.

Die IPL-Daten leitet z/OS aus dem durch den Loadparameter angesprochenen LOADxx-Member ab. Die IODF-Zeile dieses LOADxx-Members benennt den High Level Qualifier und den Suffix der Datenkomponente eines IODF. z/OS

When an Initial Program Load (IPL) is performed for the z/OS or OS/390 system, the IODF that defines the configuration to the system is used to create the I/O hardware configuration in the z/OS or OS/390 system area of storage. The eligible device table is also created at IPL time.

Dynamic Reconfiguration Management

Dynamic reconfiguration support allows changes to be made to the configration and system defintions without stopping the system.

Dynamic Reconfiguration Management using HCD allows an installation to define the new I/O interactively and placing the definitions in the new IODF. Once the I/O is defined it may be selected using either the HCD panels (HCD ACTIVATE option) or the ACTIVATE system command.

The activation process updates the z/OS or OS/390 control blocks, the hardware information in the HSA and also writes the information to the IOCDS if requested.