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

3.2 Driver Features

The magnetic tape drivers provide the following features:

The following sections describe master and slave controllers, and data check and error recovery capabilities in greater detail.

3.2.1 Dual-Path HSC Tape Drives

A dual-path HSC tape drive is a drive that connects to two HSCs, both of which have the same nonzero tape allocation class. The operating system recognizes the dual-pathed capability of such a tape drive under the following circumstances: (1) the operating system has access to both HSCs and (2) select buttons for both ports are depressed on the tape drive.

If one port fails, the operating system switches access to the operational port automatically, provided that the allocation class information has been defined correctly.

3.2.2 Dynamic Failover and Mount Verification

Dynamic failover occurs on dual-pathed tape drives if mount verification is unable to recover on the current path and an alternate path is available. The failover occurs automatically and transparently and then mount verification proceeds.

A device enters mount verification when an I/O request fails because the device has become inoperative. This might occur in the following instances:

When the device comes back on line, either through automatic failover or operator intervention, the operating system validates the volume, restores the tape to the position when the I/O failure occurred, and retries the failed request.

3.2.3 Tape Caching

The RV20, TA90, TK70, and TU81-Plus contain write-back volatile caches. The host enables write-back volatile caches explicitly, either on a per-unit basis or on a per-command basis. To enable caching on a per-unit basis, enter the DCL MOUNT command specifying the qualifier /CACHE=TAPE_DATA.

The Backup utility enables caching on a per-command basis. The user can implement caching on a per-command basis at the QIO level by using the IO$M_NOWAIT function modifiers on commands where it is legal (see Table 3-4). In the unlikely event that cached data is lost, the system returns a fatal error and the device accepts no further I/O requests. Use the IO$M_FLUSH function code to ensure that all write-back-cached data is written out to the specified tape unit. The IO$_PACKACK, IO$_UNLOAD, IO$_REWINDOFF, and IO$_AVAILABLE function codes also flush the cache.

3.2.4 Master Adapters and Slave Formatters

The operating system supports the use of many master adapters of the same type on a system. For example, more than one MASSBUS adapter (MBA) can be used on the same system. A master adapter is a device controller capable of performing and synchronizing data transfers between memory and one or more slave formatters.

The operating system also supports the use of multiple slave formatters per master adapter on a system. For example, more than one TM03 or TM78 magnetic tape formatter per MBA can be used on a system. A slave formatter accepts data and commands from a master adapter and directs the operation of one or more slave drives. The TM03 and the TM78 are slave formatters. The TE16, TU45, TU77, and TU78 magnetic tape drives are slave drives.

3.2.5 Data Check

After successful completion of an I/O operation, a data check is made to compare the data in memory with that on the tape. After a write or read (forward) operation, the tape drive spaces backward and then performs a write-check data operation. After a read operation in the reverse direction, the tape drive spaces forward and then performs a write-check data reverse operation. With the exception of TS04 and TU80 drives, magnetic tape drivers support data checks at the following three levels:

Data check is distinguished from a BACKUP/VERIFY operation, which writes an entire save set, rewinds, and then compares the tape to the original tape.

See Section 3.1.10 for information on TK50 data check.

Note

Read and write operations with data check can result in very slow performance on streaming tape drives.

3.2.6 Error Recovery

Error recovery is aimed at performing all possible operations that enable an I/O operation to complete successfully. Magnetic tape error recovery operations fall into the following two categories:

The error recovery algorithm uses a combination of these types of error recovery operations to complete an I/O operation.

Power failure recovery consists of repositioning the reel to the position held at the start of the I/O operation in progress at the time of the power failure, and then reexecuting this operation. This repositioning might or might not require operator intervention to reload the drives. When such operator intervention is required, "device not ready" messages are sent to the operator console to solicit reloading of mounted drives. Power failure recovery is not supported on VAXstation 2000 and MicroVAX 2000 systems.

Device timeout is treated as a fatal error, with a loss of tape position. A tape on which a timeout has occurred must be dismounted and rewound before the drive position can be established.

If a nonfatal controller/drive error occurs, the driver (or the controller, depending on the type of drive) attempts to reexecute the I/O operation up to 16 times before returning a fatal error. The driver repositions the tape before each retry.

The inhibit retry function modifier (IO$M_INHRETRY) inhibits all normal (nonspecial conditions) error recovery. If an error occurs, and the request includes that modifier, the operation is terminated immediately and the driver returns a failure status. IO$M_INHRETRY has no effect on power failure and timeout recovery.

The driver can write up to 16 extended interrecord gaps during the error recovery for a write operation. For the TE16, TU45, and TU77 magnetic tape drives, writing these gaps can be suppressed by specifying the inhibit extended interrecord gap function modifier (IO$M_INHEXTGAP). This modifier is ignored for the other magnetic tape drives.

3.2.7 Streaming Tape Systems

Streaming tape systems, such as the TK50, TK70, TU80, TU81, TU81-Plus, TA81, and TZ30, use the supply and takeup reel mechanisms to control tape speed and tension directly, which eliminates the need for more complex and costly tension and drive components. Streaming tapes have a very simple tape path, much like an audio reel-to-reel recorder.

Note

Read and write operations with data check can result in very slow performance on streaming tape drives.

Because the motors driving the reels are low-powered and because there is no tape buffering, streaming tape drives are not capable of starting and stopping in the interrecord gaps like conventional tape drives. When a streaming tape does have to stop, the following events occur:

  1. The tape slowly coasts forward to a stop.
  2. It backs up over a section previously processed.
  3. It halts to await the next command.
  4. It accelerates so that, when the original interrecord gap is encountered, the tape is moving at full speed.

These steps, allowing the tape to reposition, require approximately one-half second to complete on TU8x tapes and about 3 seconds on TK50 tapes. If the operating system is not capable of writing to, or reading from, a streaming tape drive at a rate that will keep the drive in constant motion (streaming) the drive repositions itself when it runs out of commands to execute. That produces a situation known as thrashing, in which the relatively long reposition times exceed the time spent processing data and the result is lower-than-expected data throughput.

Thrashing is entirely dependent on how fast the system can process data relative to the tape drive speed while streaming. Consequently, the greatest efficiency is obtained when you provide sufficient buffering to ensure continuous tape motion. Some streaming tape drives such as the TU80, TU81, TU81-Plus, and TA81 are dual-speed devices that automatically adjust the tape speed to maximize data throughput and minimize thrashing.

The TK50 writes up to seven filler records to keep the tape in motion. These records are ignored when the data is read.

3.3 Magnetic Tape Driver Device Information

You can obtain information on all magnetic tape device characteristics by using the Get Device/Volume Information ($GETDVI) system service. (See the OpenVMS System Services Reference Manual.)

$GETDVI returns magnetic tape characteristics when you specify the item codes DVI$_DEVCHAR, DVI$_DEVCHAR2, DVI$_DEVDEPEND, and DVI$_DEVDEPEND2. Tables 3-1, 3-2, and 3-3 list these characteristics. The $DEVDEF macro defines the device-independent characteristics, the $MTDEF macro defines the device-dependent characteristics, and the $MT2DEF macro defines the extended device characteristics. The extended device characteristics apply only to the TU81-Plus tape drive.

Table 3-1 Magnetic Tape Device-Independent Characteristics
Characteristic1 Meaning
Dynamic Bits (Conditionally Set)
DEV$M_AVL Device is on line and available.
DEV$M_FOR Volume is foreign.
DEV$M_MNT Volume is mounted.
DEV$M_RCK Perform data check on all read operations.
DEV$M_WCK Perform data check on all write operations.
Static Bits (Always Set)
DEV$M_FOD Device is file-oriented.
DEV$M_IDV Device is capable of input.
DEV$M_ODV Device is capable of output.
DEV$M_SQD Device is capable of sequential access.
DEV$M_WBC 2 Device is capable of write-back caching.


1Defined by the $DEVDEF macro.
2This bit is located in DVI$_DEVCHAR2.

Table 3-2 Device-Dependent Information for Tape Devices
Characteristic1 Meaning
MT$M_LOST If set, the current tape position is unknown.
MT$M_HWL If set, the selected drive is hardware write-locked.
MT$M_EOT If set, an end-of-tape (EOT) condition was encountered by the last operation to move the tape in the forward direction.
MT$M_EOF If set, a tape mark was encountered by the last operation to move the tape.
MT$M_BOT If set, a beginning-of-tape (BOT) marker was encountered by the last operation to move the tape in the reverse direction.
MT$M_PARITY If set, all data transfers are performed with even parity. If clear (normal case), all data transfers are performed with odd parity. Only non-return-to-zero-inverted recording at 800 bits/inch can have even parity.
MT$V_DENSITY
MT$S_DENSITY
Specifies the density at which all data transfer operations are performed. Possible density values are as follows:
MT$K_GCR_6250 Group-coded recording, 6250 bits/inch
MT$K_PE_1600 Phase-encoded recording, 1600 bits/inch
MT$K_NRZI_800 Non-return-to-zero-inverted recording, 800 bits/inch
MT$K_BLK_833 Cartridge block mode recording 2
MT$V_FORMAT
MT$S_FORMAT
Specifies the format in which all data transfers are performed. A possible format value is as follows:
MT$K_NORMAL11 Normal PDP-11 format. Data bytes are recorded sequentially on tape with each byte occupying exactly one frame.
MT$_FASTSKIP_USED If set, the most recent IO$_SKIPFILE function was performed using the optimized SCSI space-by-file-marks algorithm. (See Section 3.4.4 for more information about the IO$M_ALLOWFAST modifier to the IO$_SKIPFILE function.)


1Defined by the $MTDEF macro.
2Only for the TK50 and TZ30 tape drives.

Table 3-3 Extended Device Characteristics for Tape Devices
Characteristic1 Meaning
MT2$V_WBC_ENABLE If set, write-back caching is enabled for this unit.
MT2$V_RDC_DISABLE If set, read caching is disabled for this unit.


1Defined by the $MT2DEF macro. Only for the TU81-Plus. Initial device status will show both of these bits cleared; write-back caching will be disabled, read caching will be enabled.

DVI$_DEVTYPE and DVI$_DEVCLASS return the device type and class names, which are defined by the $DCDEF macro. DVI$_DEVBUFSIZ returns the buffer size. The buffer size is the default to be used for tape transfers (normally 2048 bytes). The device class for magnetic tapes is $DCTAPE, and the device type is determined by the magnetic tape model. For example, the device type for the TA78 is DT$_TA78; for the TA81 it is DT$_TA81.

3.4 Magnetic Tape Function Codes

The magnetic tape driver can perform logical, virtual, and physical I/O functions. Foreign-mounted devices do not require privileges to perform logical and virtual I/O requests.

Logical and physical I/O functions to magnetic tape devices allow sequential access to volume storage and require only that the requesting process have direct access to the device. The results of logical and physical I/O operations are unpredictable if an ACP is present.

Virtual I/O functions require intervention by an ACP and must be executed in a prescribed order. The normal order is to create and access a file, write information to that file, and deaccess the file. Subsequently, when you access the file, you read the information and then deaccess the file. You can write over the file when the information it contains is no longer useful and the file has expired.

Any number of bytes (from a minimum of 14 to a maximum of 65,535) can be read from or written into a single block by a single request. The number of bytes itself has no effect on the applicable quotas (direct I/O, buffered I/O, and AST). Reading or writing any number of bytes subtracts the same amount from a quota.

The volume to which a logical or virtual function is directed must be mounted for the function actually to be executed. If it is not, either a "device not mounted" or "invalid volume" status is returned in the I/O status block.

Table 3-4 lists the logical, virtual, and physical magnetic tape I/O functions and their function codes. These functions are described in more detail in the following paragraphs. Chapter 1 describes the QIO level interface to the magnetic tape device ACP. Chapter 10 describes features to improve performance for larger file transfers.

Table 3-4 Magnetic Tape I/O Functions
Function Code Arguments Type1 Function Modifiers Function
IO$_ACCESS P1,[P2],[P3],[P4],[P5] V IO$M_CREATE
IO$M_ACCESS
Search a tape for a specified file and access the file if found and IO$M_ACCESS is set. If the file is not found and IO$M_CREATE is set, create a file at end-of-tape (EOT) marker.
IO$_ACPCONTROL P1,[P2],[P3],[P4], [P5] V IO$M_DMOUNT Perform miscellaneous control functions. 2
IO$_AVAILABLE   P   Clear volume valid bit.
IO$_CREATE P1,[P2][,[P3],[P4],[P5] V IO$M_CREATE
IO$M_ACCESS
Create a file.
IO$_DEACCESS P1,[P2],[P3],[P4],[P5] V   Deaccess a file and, if the file has been written, write out trailer records.
IO$_DSE 3   P IO$M_NOWAIT Erase a prescribed section of the tape.
IO$_FLUSH   L   Flush the controller cache to tape.
IO$_MODIFY P1,[P2],[P3],[P4],[P5] V   Write user labels.
IO$_PACKACK   P   Initialize volume valid bit.
IO$_READLBLK 10 P1,P2 L IO$M_DATACHECK 4
IO$M_INHRETRY
IO$M_REVERSE 5
Read logical block.
IO$_READPBLK 10 P1,P2 P IO$M_DATACHECK 4
IO$M_INHRETRY
IO$M_REVERSE 5
Read physical block.
IO$_READVBLK 10 P1,P2 V IO$M_DATACHECK 4
IO$M_INHRETRY
IO$M_REVERSE 5
Read virtual block.
IO$_REWIND   L IO$M_INHRETRY
IO$M_NOWAIT
IO$M_RETENSION
Reposition tape to the beginning-of-tape (BOT) marker.
IO$_REWINDOFF   L IO$M_INHRETRY
IO$M_NOWAIT
IO$M_RETENSION
Rewind and unload the tape on the selected drive.
IO$_SENSECHAR [P1],[P2] 6 P IO$M_INHRETRY Sense the tape characteristics and return them in the I/O status block.
IO$_SENSEMODE [P1],[P2] 6 L IO$M_INHRETRY Sense the tape characteristics and return them in the I/O status block.
IO$_SETCHAR P1,[P2] 6 P   Set tape characteristics for subsequent operations.
IO$_SETMODE P1,[P2] 6 L   Set tape characteristics for subsequent operations.
IO$_SKIPFILE P1 L IO$M_INHRETRY
IO$M_NOWAIT 7
IO$M_ALLOWFAST
Skip past a specified number of tape marks in either a forward or reverse direction.
IO$_SKIPRECORD P1 L IO$M_INHRETRY
IO$M_NOWAIT 7
Skip past a specified number of blocks in either a forward or reverse direction.
IO$_UNLOAD   L IO$M_INHRETRY
IO$M_NOWAIT
Rewind and unload the tape on the selected drive.
IO$_WRITELBLK 10 P1,P2 L IO$M_ERASE 8
IO$M_DATACHECK 4
IO$M_INHRETRY
IO$M_INHEXTGAP 9
IO$M_NOWAIT 7
Write logical block.
IO$_WRITEOF 10   L IO$M_INHRETRY
IO$M_INHEXTGAP 9
IO$M_NOWAIT 7
Write an extended interrecord gap followed by a tape mark.
IO$_WRITEPBLK 10 P1,P2 P IO$M_ERASE 8
IO$M_DATACHECK 4
IO$M_INHRETRY
IO$M_INHEXTGAP 9
IO$M_NOWAIT 7
Write physical block.
IO$_WRITEVBLK 10 P1,P2 V IO$M_DATACHECK 4
IO$M_INHRETRY
IO$M_INHEXTGAP 9
IO$M_NOWAIT 7
Write virtual block.
         


1V = virtual; L = logical; P = physical.
2See Section 1.6.8 for more information.
3Only for TMSCP drives, and TZK50, and TZ30 tape devices.
4Not for TS04 and TU80 tape devices.
5Not for TUK50 and TQK50 tape devices.
6The P1 and P2 arguments for IO$_SENSEMODE and IO$_SENSECHAR and the P2 argument for IO$_SETMODE and IO$_SETCHAR are for TMSCP drives only.
7Only for RV20, TA90, TK70, and TU81-Plus drives.
8Takes no arguments; valid only for TMSCP drives, and TZK50 and TZ30 tape devices.
9Only for TE16, TU45, and TU77 tape drives.
10On OpenVMS Alpha, P1 supports a 64-bit address.

The function-dependent arguments for IO$_CREATE, IO$_ACCESS, IO$_DEACCESS, IO$_MODIFY, IO$_ACPCONTROL are as follows:


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_010.HTML