Datenverwaltung, Ein-/Ausgabe
Total Page:16
File Type:pdf, Size:1020Kb
Datenverwaltung, Ein-/Ausgabe it-Akademie Bayern z/OS und OS/390 Lehrgang 2008 Prof. Dr.-Ing. Wilhelm G. Spruth Teil 7 Ein-/Ausgabe Verarbeitung EA 0601 ww6 © copyright W. G. Spruth, 08-2004 wgs 10-02 Program I/O Functions The data set organization and processing method are usually described in the program. In addition, some data set information may be specified on the DD statement. OPEN processing merges information from various sources to build a complete data set description. After OPEN processing the program is logically associated with the data set and the program can access the data records. The GET/PUT or READ/WRITE macro instructions are used to request the movement of data between the device and main storage. CLOSE processing breaks the logical connection between the data set and the program. CLOSE processing also does clean-up such as writing end-of-file marks. I/O Request Initiation Wenn das Anwendungsprogramm eine I/O Macro Instruction (GET/PUT oder READ/WRITE) ausführt, verzweigt das Anwendungsprogramm über einen SVC Befehl in die Access Method innerhalb des Kernels. Supervisor Status GET/PUT EXCP STARTI/O SSCH S 1 2 3 4 C U H B Program Access EXCP IOS A S Method Processor N Y N S 8 7 6 5 E T L E M Return Dispatcher Process Interrupt Interruption I/O Services IOS = Input/Output Supervisor Access Method I/O Functions In this example the Queued Sequential Access Method (QSAM) will be invoked by the GET macro. This access method: 1. Provides I/O buffers within the program's address space. 2. Builds the channel program which describes the I/O operation to the channel subsystem. As part of the I/O operation, the Access Method: 1. Builds control blocks containing information about the I/O request. 2. Passes control to an I/O driver 3. Issues a WAIT macro to suspend processing of the program's task until the I/O operation is completed. Gepufferte Ein/Ausgabe Im Gegensatz zu READ und WRITE benutzen GET und PUT eine gepufferte Ein/Ausgabe. Die Ein/Ausgabe Puffer werden von der Access Method verwaltet. System CPU Haupt Speicher System Bus Kanal Kanal Kanal 256 Kanäle pro System Control Control Control Unit Unit Unit S/360 E/A Konfiguration Bis zu 65 536 Subchannels pro Channel Subsystem. Jedes E/A Gerät ist, unabhängig von seinem physikalischen Anschluss, logisch über einen „Subchannel“ mit dem Channel Subsystem verbunden. Normalerweise 1 E/A Gerät pro Subchannel. es 0210z ww6 wgs 09-99 SADR Speicheradressregister BCR Bytezählregister (Length Count) DMA (Direct Memory Access) • Aufgaben der DMA-Steuerung: • Adressieren des Haupts.peichers durch Adreßfortschaltung • Adressieren der Geräteschnittstelle • Steuerung der Buszugriffe für Lesen oder Schreiben • Zählen der übertragenen Bytes • Rückmelden an CPU Für einen Übertragungsvorgang werden DMA-Steuerung und I/O Controller (adapter card) von der CPU (Channel Subsystem) initialisiert, z.B. Laden der Steuer- und Adressregister. Channel Program The machine instructions that direct the control unit and device are called channel command words (CCW). A series of channel commands make up a channel program. This is a mini machine-language for I/O which can • read/ write between memory and devices • do device- specific control functions • test device/ channel status and loop. Channel command words provide information such as the address of the data area and the number of bytes of data to be transferred. Some examples of channel command words are SEEK, SETSECTOR, SEARCH, READ and WRITE. Access Method Interface to I/O Drivers Wenn die Access Method alle Aufgaben abgearbeitet hat, verzweigt sie zu einer als I/O Driver bezeichneten z/OS Komponente. Der I/O Driver ist die Schnittstelle zwischen der Access Methode und IOS. Driver passes Control to IOS Driver Interface to IOS The EXCP driver fixes the I/O buffers and the channel program in central storage so that they will be available during the time that the channel subsystem is processing the I/O requests (no paging). The EXCP driver translates the addresses in the channel program from virtual to real. The channel subsystem (the hardware) uses real addresses since it must transfer data into and out of real storage locations. IOS Processing IOS is the interface between the system components (software) and the channel subsystem (hardware). IOS checks to see if the requested device (typically a DASD) is active with a previous I/O request. If the device is active, IOS holds the current request on a queue for that device. If the device is available, IOS issues a Start Subchannel (SSCH) instruction to the channel subsystem to start the I/O request. S/360 I/O Verarbeitung Channel Subsystem Processing A path consists of the channel path, a control unit, and the device. There are often multiple channel paths to a single device. The channel subsystem is responsible for selecting the best path for data transfer between the device and main storage. This capability is a powerful performance feature and a major difference between z/OS or an Unix or Windows I/O subsystems. Start Subschannel SSCH A single instruction (SSCH, Start SubCHannel) initiates I/O. Operands are : • subchannel number • ORB (Operation Request Block) address. The ORB includes the channel program address. SAP (Channel Assist Processor) takes over • copies ORB into UCW • places UCW in initiative queue in HSA • finds appropriate channel path • gets channel to execute channel program When I/O is done • status is stored in UCW. • SAP generates an I/ O interrupt. Note: QDIO (I/O for OSA- Express network) bypasses the Channel Subsystem. SSCH ( ORB, Subchannel) CCWs Channel Control Words CCWs are linked lists of instructions initially pointed to by an operation request block (ORB). The ORB is initially given to the Start Subchannel (SSCH) command along with the subchannel number for the I/O subsystem to process while the CPU continues executing normal code. CCWs come in two flavors: Format 0 (24 bit for backward compatibility) and Format 1 (31 bit). They are typically used to issue read and write (and many other instructions) and consist of a length field and an absolute address field. For each I/O typically 1 or 2 interrupts are produced, one for channel end (primary status) when the channel is idle and the second for device end (secondary status). Often both occur concurrently (CEDE interrupt, Channel End Device End). zSeries Ein/Ausgabe Anschluss Hauptspeicher 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 Channel Subsystem Components The S/390 channel subsystem contains: A special processor unit (PU) called an SAP. An SAP is a S/390 compatible Microprocessor, but executes I/O licensed internal code (LIC) only (no z/OS Kernel code and no user code). An SAP alleviates the CPU involvement during the execution of an I/O operation. It schedules an I/O operation, but is not in charge of the movement between central storage (CS) and the channel. Channels, which are special processors able to communicate with I/O control units and manage the movement of data between central storage and these control units. Being more specific, the channels can: 1. Send channel commands from the processor to a Control Unit 2. Transfer data during read and write operations 3. Receive status at the end of operations 4. Receive sense information from control units An I/O operation starts when a Start Subchannel (SSCH) machine instruction is executed by the Input Output Supervisor (IOS), an OS/390 component, which issues the instruction on behalf of an OS/390 process. It ends when an I/O interrupt is received by the CPU (forcing the execution of IOS code again). Start Subchannel (SSCH) logic The Start Subchannel (SSCH) is a privileged instruction. It is issued by the Input Output Supervisor (IOS), a z/OS component, and used to start an I/O operation. SSCH has two operands: 1. Subchannel number, which is an index to the UCW associated with the I/O device 2. Operation Request Block (ORB) address. The ORB contains information about what do to during the I/O operation; among other fields it contains the channel program address. The SSCH microcode moves the ORB contents into the respective UCW and places the UCW in an specific Hardware System Area (HSA) queue named the initiative queue. After that process completes, the next IOS instruction is executed, allowing the use of the CPU in another task. HSA is a piece of central storage not addressable by z/OS. It is allocated at power-on reset (POR) and contains microcode work areas, and the I/O configuration (UCWs are stored in HSA) used by the channel subsystem. 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/360 E/A Konfiguration 0 7 8 15 16 Bit I/O Address Channel Device Address Address max. 256 Channels und max.