Document revision date: 19 July 1999
[Compaq] [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]
[OpenVMS documentation]

OpenVMS I/O User's Reference Manual


Previous Contents Index

2.4.11.6 Using IO$_SETPRFPATH with Phase II Volume Shadowing

IO$_SETPRFPATH and IO$M_FORCEPATH are supported for shadow set members but not for virtual units.

2.5 I/O Status Block

Figure 2-7 shows the I/O status block (IOSB) for all disk device QIO functions except sense mode. Figure 2-8 shows the I/O status block for the sense mode function. Appendix A lists the status messages for all functions and devices. (The OpenVMS system messages documentation provides explanations and suggested user actions for these messages.)

Figure 2-7 IOSB Contents


The byte count is a 32-bit integer that gives the actual number of bytes transferred to or from the process buffer.

Figure 2-8 IOSB Contents for the Sense Mode Function


The second longword of the I/O status block for the sense mode function returns information about the cylinder, track, and sector configurations for the particular device.

2.6 Disk Driver Programming Example

A sample VAX MACRO disk driver program, DISK_DRIVER.MAR, is shown in Example 2-1. This sample program provides an example of optimizing access time to a disk file. The program creates a file using Record Management Services (RMS), stores information concerning the file, and closes the file. The program then accesses the file and reads and writes to the file using the Queue I/O ($QIO) system service.

Example 2-1 DISK_DRIVER.MAR Disk Driver Programming Example

; ******************************************************************** 
; 
 
        .TITLE  Disk Driver Programming Example 
        .IDENT  /01/ 
 
 
; 
; Define necessary symbols. 
; 
 
        $FIBDEF                 ;Define file information block Offsets 
        $IODEF                  ;Define I/O function codes 
        $RMSDEF                 ;Define RMS-32 Return Status Values 
; 
; Local storage 
; 
; Define number of records to be processed. 
; 
 
NUM_RECS=100                    ;One hundred records 
 
; 
; Allocate storage for necessary data structures. 
; 
; Allocate File Access Block. 
; 
;       A file access block is required by RMS-32 to open and close a 
;       file. 
; 
FAB_BLOCK:                              ; 
        $FAB    ALQ = 100,-             ;Initial file size is to be 
                -                       ;100 blocks 
                FAC = PUT,-             ;File Access Type is output 
                FNA = FILE_NAME,-       ;File name string address 
                FNS = FILE_SIZE,-       ;File name string size 
                FOP = CTG,-             ;File is to be contiguous 
                MRS = 512,-             ;Maximum record size is 512 
                -                       ;bytes 
                NAM = NAM_BLOCK,-       ;File name block address 
                ORG = SEQ,-             ;File organization is to be 
                -                       ;sequential 
                REM = FIX               ;Record format is fixed length 
; 
; Allocate file information block. 
; 
;       A file information block is required as an argument in the 
;       Queue I/O system service call that accesses a file. 
; 
FIB_BLOCK:                              ; 
        .BLKB   FIB$K_LENGTH            ; 
 
 
; 
; Allocate file information block descriptor. 
; 
 
FIB_DESCR:                              ; 
        .LONG   FIB$K_LENGTH            ;Length of the file 
                                        ;information block 
        .LONG   FIB_BLOCK               ;Address of the file 
                                        ;information block 
; 
; Allocate File Name Block 
; 
;       A file name block is required by RMS-32 to return information 
;       concerning a file (for example, the resultant file name string 
;       after logical name translation and defaults have been applied). 
; 
 
NAM_BLOCK:                              ; 
        $NAM                            ; 
 
; 
; Allocate Record Access Block 
; 
;       A record access block is required by RMS-32 for record 
;       operations on a file. 
; 
RAB_BLOCK: 
        $RAB    FAB = FAB_BLOCK,-       ;File access block address 
                RAC = SEQ,-             ;Record access is to be 
                -                       ;sequential 
                RBF = RECORD_BUFFER,-   ;Record buffer address 
                RSZ = 512               ;Record buffer size 
; 
; Allocate direct address buffer 
; 
 
BLOCK_BUFFER: 
        .BLKB   1024                    ;Direct access buffer is 1024 
                                        ;bytes 
 
; 
; Allocate space to store channel number returned by the $ASSIGN 
; Channel system service. 
; 
DEVICE_CHANNEL:                         ; 
        .BLKW   1                       ; 
 
; 
; Allocate device name string and descriptor. 
; 
 
 
DEVICE_DESCR:                           ; 
        .LONG   20$-10$                 ;Length of device name string 
        .LONG   10$                     ;Address of device name string 
10$:    .ASCII  /SYS$DISK/              ;Device on which created file 
                                        ;will reside 
20$:                                    ;Reference label to calculate 
                                        ;length 
; 
; Allocate file name string and define string length symbol. 
; 
 
FILE_NAME:                              ; 
        .ASCII  /SYS$DISK:MYDATAFIL.DAT/        ;File name string 
 
FILE_SIZE=.-FILE_NAME                   ;File name string length 
 
; 
; Allocate I/O status quadword storage. 
; 
 
IO_STATUS:                              ; 
        .BLKQ   1                       ; 
; 
; Allocate output record buffer. 
; 
 
RECORD_BUFFER:                          ; 
        .BLKB   512                     ;Record buffer is 512 bytes 
; 
; ******************************************************************** 
; 
;                       Start Program 
; 
; ******************************************************************** 
 
 
; 
; The purpose of the program is to create a file called MYDATAFIL.DAT 
; using RMS-32; store information concerning the file; write 100 
; records, each containing its record number in every byte; 
; close the file; and then access, read, and write the file directly, 
; using the Queue I/O system service.  If any errors are detected, the 
; program returns to its caller with the final error status in 
; register R0. 
 
        .ENTRY  DISK_EXAMPLE,^M<R2,R3,R4,R5,R6>  ;Program starting 
                                                 ;address 
 
; 
; First create the file and open it, using RMS-32. 
; 
PART_1:                                 ;First part of example 
        $CREATE FAB = FAB_BLOCK         ;Create and open file 
        BLBC    R0,20$                  ;If low bit = 0, creation 
                                        ;failure 
 
; 
; Second, connect the record access block to the created file. 
; 
 
        $CONNECT RAB = RAB_BLOCK        ;Connect the record access 
                                        ;block 
        BLBC    R0,30$                  ;If low bit = 0, creation 
                                        ;failure 
; 
; Now write 100 records, each containing its record number. 
; 
 
 
        MOVZBL  #NUM_RECS,R6            ;Set record write loop count 
 
; 
; Fill each byte of the record to be written with its record number. 
; 
 
10$:    SUBB3   R6,#NUM_RECS+1,R5       ;Calculate record number 
 
        MOVC5   #0,(R6),R5,#512,RECORD_BUFFER  ;Fill record buffer 
 
; 
; Now use RMS-32 to write the record into the newly created file. 
; 
 
 
        $PUT    RAB = RAB_BLOCK         ;Put record in file 
        BLBC    R0,30$                  ;If low bit = 0, put failure 
        SOBGTR  R6,10$                  ;Any more records to write? 
; 
; The file creation part of the example is almost complete.  All that 
; remains to be done is to store the file information returned by 
; RMS-32 and close the file. 
; 
 
        MOVW    NAM_BLOCK+NAM$W_FID,FIB_BLOCK+FIB$W_FID  ;Save file 
                                        ;identification 
        MOVW    NAM_BLOCK+NAM$W_FID+2,FIB_BLOCK+FIB$W_FID+2  ;Save 
                                        ;sequence number 
        MOVW    NAM_BLOCK+NAM$W_FID+4,FIB_BLOCK+FIB$W_FID+4  ;Save 
                                        ;relative volume 
        $CLOSE  FAB = FAB_BLOCK         ;Close file 
        BLBS    R0,PART_2               ;If low bit set, successful 
                                        ;close 
20$     RET                             ;Return with RMS error status 
; 
; Record stream connection or put record failure. 
; 
; Close file and return status. 
; 
30$:    PUSHL   R0                      ;Save error status 
        $CLOSE  FAB = FAB_BLOCK         ;Close file 
        POPL    R0                      ;Retrieve error status 
        RET                             ;Return with RMS error status 
; 
; The second part of the example illustrates accessing the previously 
; created file directly using the Queue I/O system service, randomly 
; reading and writing various parts of the file, and then deaccessing 
; the file. 
; 
; First, assign a channel to the appropriate device and access the 
; file. 
PART_2:                                 ; 
        $ASSIGN_S DEVNAM = DEVICE_DESCR,-  ;Assign a channel to file 
                CHAN = DEVICE_CHANNEL   ;device 
        BLBC    R0,20$                  ;If low bit = 0, assign 
                                        ;failure 
        MOVL    #FIB$M_NOWRITE!FIB$M_WRITE,- ;Set for read/write 
                FIB_BLOCK+FIB$L_ACCTL   ;access 
        $QIOW_S CHAN = DEVICE_CHANNEL,- ;Access file on device channel 
                FUNC = #IO$_ACCESS!IO$M_ACCESS,- ;I/O function is 
                -                       ;access file 
                IOSB = IO_STATUS,-      ;Address of I/O status 
                -                       ;quadword 
                P1 = FIB_DESCR          ;Address of information block 
                                        ;descriptor 
        BLBC    R0,10$                  ;If low bit = 0, access 
                                        ;failure 
        MOVZWL  IO_STATUS,R0            ;Get final I/O completion 
                                        ;status 
 
        BLBS    R0,30$                  ;If low bit set, successful 
                                        ;I/O function 
10$:    PUSHL   R0                      ;Save error status 
        $DASSGN_S CHAN = DEVICE_CHANNEL ;Deassign file device channel 
        POPL    R0                      ;Retrieve error status 
20$:    RET                             ;Return with I/O error status 
; 
; The file is now ready to be read and written randomly.  Since the 
; records are fixed length and exactly one block long, the record 
; number corresponds to the virtual block number of the record in the 
; file. Thus a particular record can be read or written simply by 
; specifying its record number in the file. 
; 
; The following code reads two records at a time and checks to see 
; that they contain their respective record numbers in every byte. 
; The records are then written back into the file in reverse order. 
; This results in record 1 having the old contents of record 2 and 
; record 2 having the old contents of record 1, and so forth. After 
; the example has been run, it is suggested that the file dump 
; utility be used to verify the change in data positioning. 
; 
 
 
30$     MOVZBL  #1,R6                   ;Set starting record (block) 
                                        ;number 
; 
; Read next two records into block buffer. 
; 
 
40$:    $QIO_S  CHAN = DEVICE_CHANNEL,- ;Read next two records from 
                -                       ;file channel 
                FUNC = #IO$_READVBLK,-  ;I/O function is read virtual 
                -                       ;block 
                IOSB = IO_STATUS,-      ;Address of I/O status 
                -                       ;quadword 
                P1 = BLOCK_BUFFER,-     ;Address of I/O buffer 
                P2 = #1024,-            ;Size of I/O buffer 
                P3 = R6                 ;Starting virtual block of 
                                        ;transfer 
        BSBB    50$                     ;Check I/O completion status 
; 
; Check each record to make sure it contains the correct data. 
; 
 
        SKPC    R6,#512,BLOCK_BUFFER    ;Skip over equal record 
                                        ;numbers in data 
 
        BNEQ    60$                     ;If not equal, data match 
                                        ;failure 
        ADDL3   #1,R6,R5                ;Calculate even record number 
 
        SKPC    R5,#512,BLOCK_BUFFER+512 ;Skip over equal record 
                                        ;numbers in data 
        BNEQ    60$                     ;If not equal, data match 
                                        ;failure 
; 
; Record data matches. 
; 
; Write records in reverse order in file. 
; 
 
        $QIOW_S CHAN = DEVICE_CHANNEL,- ;Write even-numbered record in 
                -                       ;odd slot 
                FUNC = #IO$_WRITEVBLK,- ;I/O function is write virtual 
                -                       ;block 
                IOSB = IO_STATUS,-      ;Address of I/O status 
                -                       ;quadword 
                P1 = BLOCK_BUFFER+512,- ;Address of even record buffer 
                P2 = #512,-             ;Length of even record buffer 
                P3 = R6                 ;Record number of odd record 
        BSBB    50$                     ;Check I/O completion status 
        ADDL3   #1,R6,R5                ;Calculate even record number 
        $QIOW_S CHAN = DEVICE_CHANNEL,- ;Write odd numbered record in 
                -                       ;even slot 
                FUNC = #IO$_WRITEVBLK,- ;I/O function is write virtual 
                -                       ;block 
                IOSB = IO_STATUS,-      ;Address of I/O status 
                -                       ;quadword 
                P1 = BLOCK_BUFFER,-     ;Address of odd record buffer 
                P2 = #512,-             ;Length of odd record buffer 
                P3 = R5                 ;Record number of even record 
        BSBB    50$                     ;Check I/O completion status 
        ACBB    #NUM_RECS-1,#2,R6,40$   ;Any more records to be read? 
 
        BRB     70$                     ; 
 
 
; 
; Check I/O completion status. 
; 
 
50$:    BLBC    R0,70$                  ;If low bit = 0, service 
                                        ;failure 
        MOVZWL  IO_STATUS,R0            ;Get final I/O completion 
                                        ;status 
        BLBC    R0,70$                  ;If low bit = 0, I/O function 
        RSB                             ;failure 
; 
; Record number mismatch in data. 
; 
 
60$:    MNEGL   #4,R0                   ;Set dummy error status value 
 
; 
; All records have been read, verified, and odd/even pairs inverted 
; 
70$:    PUSHL   R0                      ;Save final status 
        $QIOW_S CHAN = DEVICE_CHANNEL,- ;Deaccess file 
                FUNC = #IO$_DEACCESS    ;I/O function is deaccess file 
        $DASSGN_S CHAN = DEVICE_CHANNEL ;Deassign file device channel 
        POPL    R0                      ;Retrieve final status 
        RET                             ; 
 
        .END    DISK_EXAMPLE 


Chapter 3
Magnetic Tape Drivers

This chapter includes updated information for OpenVMS Version 7.2.

This chapter describes the use of magnetic tape drivers, drives, and controllers.

3.1 Magnetic Tape Controllers and Drives

The sections that follow describe magnetic tape controllers and drives. However, note that not all supported devices are described here. Refer to the Software Product Description for the OpenVMS Operating System for Alpha and VAX for the definitive list of supported devices.

3.1.1 TM03 Magnetic Tape Controller (VAX Only)

On VAX systems, the TM03 magnetic tape controller supports up to eight TE16, TU45, or TU77 tape drives. These dual-density (800 or 1600 bit/inch) drives differ in speed: the TE16, TU45, and TU77 read and write data at 45, 75, and 125 inches per second, respectively. Each drive can hold one 2400-foot, 9-track reel with a capacity of approximately 40 million characters. The TM03 controller is connected to the MASSBUS through a MASSBUS adapter.

3.1.2 TS11 Magnetic Tape Controller (VAX Only)

On VAX systems, the TS11 magnetic tape controller connects to the UNIBUS through a UNIBUS adapter and supports one TS04 tape drive. The TS11/TS04 is a single-density tape system that supports 1600-bit/inch, phase-encoded recording.

The TSU05 and the TSV05 magnetic tape drives are used with UNIBUS and Q-bus systems, respectively.

3.1.3 TM78 and TM79 Magnetic Tape Controllers (VAX Only)

On VAX systems, the TM78 and TM79 magnetic tape controllers support up to four TU78 tape drives. These high-performance, dual-density drives (1600 or 6250 bit/inch) operate at 125 inches per second (ips) using a 2400-foot reel of tape with a capacity of approximately 146 million characters when recorded in the GCR (6250 bit/inch) mode. The TM78 and TM79 controllers are connected to the MASSBUS through a MASSBUS adapter.

3.1.4 TU80 Magnetic Tape Subsystem (VAX Only)

On VAX systems, the TU80 is a single-density, dual-speed (25 or 100 ips) magnetic tape subsystem that uses streaming tape technology (see Section 3.2.7). It supports one drive per subsystem. The TU80 connects to the UNIBUS through a UNIBUS adapter and completely emulates the TS11 magnetic tape controller.

3.1.5 TA81 Magnetic Tape Subsystem

On VAX and Alpha systems, the TA81 is a high-performance, dual-density (1600 or 6250 bit/inch), dual-speed (25 or 75 ips) magnetic tape subsystem that uses streaming tape technology (see Section 3.2.7). It attaches to an HSC50 controller, and is managed with the TMSCP control protocol for tape mass storage.

3.1.6 TU81 Magnetic Tape Subsystem (VAX Only)

On VAX systems, the TU81 is a high-performance, dual-density (1600 or 6250 bit/inch), dual-speed (25 or 75 in/s) magnetic tape subsystem that uses streaming tape technology (see Section 3.2.7). It connects to the UNIBUS through a UNIBUS adapter, and is managed with the TMSCP control protocol for tape mass storage.

3.1.7 TU81-Plus Magnetic Tape Subsystem (VAX Only)

On VAX systems, the TU81-Plus is an enhanced version of the TU81 streaming tape subsystem. It is a 9-track, dual-speed, dual-density, ANSI-standard, half-inch magnetic tape subsystem. In addition, it has a 256-kilobyte (KB) cache buffer that temporarily stores commands and data moving to and from the tape unit. The buffer increases the amount of time the tape drive is able to stream, thereby increasing performance. The TU81-Plus connects to all VAXBI, UNIBUS, and Q-bus systems using the KLESI-B, KLESI-U, and KLESI-Q adapters.

3.1.8 TA90 Magnetic Tape Subsystem

On VAX and Alpha systems, the TA90 is a 5- by 4-inch, 200-MB cartridge tape, fully read- and write-compatible with the IBM 3480 format. The TA90 includes a master controller and a dual transport unit. As many as three additional dual transport slave units can be connected to a single TA90 master controller for a total of eight drives. The controller connects to the HSC 5X-DA high-speed channel card in the HSC.

TA90 tape drives can be equipped with optional stack loaders for unattended backup operations. Each TA90 master has two dual-port STI connections to the HSC. Such dual pathing allows each control unit to service two HSC controllers which significantly increases tape drive availability. The TA90 subsystem includes a 2-MB cache that allows the controller to prefetch upcoming commands and store them while completing current data transfers. This behavior helps optimize performance. The TA90 is a TMSCP device.

3.1.9 RV20 Write-Once Optical Drive (VAX Only)

On VAX systems, the RV20, a 2 GB, double-sided, write-once optical (WORM) disk drive, is accessed sequentially similar to a tape. A 100-bit error correction code (ECC) protects user data. The controller performs bad block replacement. Three RV20 slaves can be daisy-chained to the subsystem controller in the RV20 master for a total of four drives.

RV02 cartridges can be used on any DIGITAL RV20 optical subsystem.

The average access time is 212.5 ms with an average seek rate of 150 ms. The maximum data transfer rate is 262 KB per second (formatted and sustained) with a burst rate of 1.33 MB per second.

3.1.10 TK50 Cartridge Tape System (VAX Only)

On VAX systems, the TK50 is a 95-MB, 5.25-inch cartridge tape system that uses streaming tape technology (see Section 3.2.7). The TK50 records data serially on 22 tracks using serpentine recording, rather than on separate (parallel) tracks. Data written to tape is automatically read as it is written. A cyclic redundancy check (CRC) is performed and the controller is notified immediately if an error occurs on the tape.

The TQK50 is a dual-height Q-bus controller for the TK50 tape drive. The TUK50 is a UNIBUS controller for the same drive. The TZK50 is a SCSI controller for the TK50 tape. Both the TQK50 and the TUK50 are TMSCP devices.

Section 3.1.13 describes compatibility among the TK50, TK70, and TZ30 magnetic cartridge tape systems.

3.1.11 TK70 Cartridge Tape System (VAX Only)

On VAX systems, the TK70 is a 295-MB, 5.25-inch, streaming cartridge tape system. (See Section 3.2.7 for information about streaming tape technology.) The TK70 tape drive records data serially on 48 tracks using serpentine recording, rather than separate (parallel) tracks. Data written to the tape is automatically read as it is written. A CRC check is performed and the controller is notified immediately if an error occurs on the tape.

The TQK70 is a dual-height, Q-bus controller for the TK70 magnetic tape drive. The TK70 subsystem includes a 38-KB cache to optimize performance. The TBK70 is a VAXBI-bus controller for the same drive. Section 3.1.13 describes compatibility between the TK50 and TK70 magnetic cartridge tape systems.

3.1.12 TZ30 Cartridge Tape System

On VAX and Alpha systems, the TZ30 is a 95-MB, 5.25-inch, half-height cartridge streaming tape drive with an embedded SCSI controller. See Section 3.2.7 for information about streaming tape technology. The TZ30 uses TK50 cartridge tapes. It records data serially on 22 tracks using serpentine recording, rather than separate parallel tracks. Section 3.1.13 describes compatibility between the TK50, TK70, and TZ30 magnetic cartridge tape systems.

3.1.13 Read and Write Compatibility Between Cartridge Tape Systems

When you insert a cartridge tape into the TZ30, TK50, and TK70 tape drives, the hardware initializes the media to a device-specific recording density automatically.

Depending on the type of cartridge and the type of drive on which it is formatted (inserted and initialized), full read and write access to tape cartridges may not be permitted.

Formatting a Blank TK50 Cartridge Tape

A blank, unformatted TK50 cartridge can be formatted on the TK50, TK70, and TZ30 cartridge systems. For example, a TK70 tape drive has full read and write access to a TK50 cartridge formatted on a TK70 drive. Once the cartridge tape is formatted on a particular tape drive, the tape drive has full read and write access to the cartridge tape.

Formatting a Previously Initialized TK50 Cartridge Tape

If a TK50 cartridge tape is formatted on a TZ30 or TK50 cartridge tape drive, the TZ30 and TK50 drives initialize the TK50 cartridge to TK50 density. The following table summarizes the types of access available:
  TK50
Controller Read Write
TZ30 1 Yes Yes
TQK50 Yes Yes
TQK70 Yes No


1Has an internal controller.

The TK70 tape drive can read data on a TK50 cartridge formatted on a TK50 or TZ30 tape drive.

Formatting a TK50 or TK52 Cartridge Tape on a TK70 Tape Drive

If a TK50 or TK52 cartridge tape is formatted on a TK70 tape drive, the TK70 cartridge tape drive initializes the TK50 or TK52 cartridge tape to TK70 density. The following table summarizes the types of access available:
  TK50 TK52
Controller Read Write Read Write
TZ30 1 No No No No
TQK50 No No No No
TQK70 Yes Yes Yes Yes


1Has an internal controller.

The TK50 and TZ30 tape drives cannot read or write data on a TK50 cartridge tape formatted on a TK70 drive.


Previous Next Contents Index

  [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]  
  privacy and legal statement  
6136PRO_009.HTML