Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ft(7) — Interactive 3.2r4.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ftape(1)

ioctl(2)

ft(7)  —  

NAME

ft − floppy tape driver

DESCRIPTION

The floppy tape driver supports the Irwin and several QIC-40 floppy tape drives through a single character device file, /dev/ftape.  It is not designed for direct reading or writing of the device file, but must be used with the ftape(1) user interface command (or other command written for use with this driver).

The floppy tape driver and the new floppy disk driver are two independent drivers sharing a common module that manages the floppy disk controller.  The floppy disk driver is discussed separately in fd(7).

Note that when the floppy tape driver has been installed on the system, only one device, disk or tape, can be open at a time.  This means that floppy disk to floppy tape, and floppy tape to floppy disk transfers are not possible. 

The floppy tape driver supports the following drives:

Manufacturer Model Capacity
Irwin 225 20 MB
Irwin 245 40 MB
Irwin 285 80/120 MB
Alloy APT-40 40 MB
CMS Jumbo 40 MB
Wangtek FAD3500 40 MB
Mountain TD4000 40 MB

Floppy Tape Ioctl Calls

REWIND_ONLY
Rewind to the beginning of the tape.

RETENSION Retension the tape. 

ERASE Erase the tape. 

SERVO Write servo information on the tape.  The tape must be a new, unformatted tape or have been erased with a bulk tape eraser. 

VERIFY Put the tape drive into a special verify mode that finds bad and marginally bad spots on the tape.  It may be used in conjunction with bad blocking schemes to collect a list of known bad spots on the tape which may then be avoided.  This ioctl command expects an integer parameter to turn the verify mode on or off.  A value of 1 enables the verify mode and a value of 0 disables it.  Once the verify mode is enabled it will stay enabled until the verify mode is explicitly turned off or until the device is closed. 

QREAD, QWRITE, READWAIT, WRITEWAIT These ioctl commands provide the primary interface to the floppy tape driver.  Different bad blocking and error correction schemes are currently used by various floppy tape drive vendors.  The implementation of these schemes in not built into the driver, but is left to application layer programs, e.g., ftape(1). The device driver provides an underlying base upon which practically any of these schemes may be implemented.  The QREAD, QWRITE, READWAIT, and WRITEWAIT ioctl commands provide the interface by which read and write requests may be sent to the driver and by which the application program may determine when I/O operations on each of the requests has been completed.  This allows multiple requests to be queued at the driver to facilitate streaming of the tape.  The structure definitions and defines can be found in <sys/mtioctl.h>. 

Each of these ioctl commands expects a structure of the form shown below:

/* structure for QREAD and QWRITE ioctls */
typedef struct {
char *buffer;/* pointer to actual data buffer */
unsigned long badmap; /* kernel’s idea of bad sectors after read */
/* or of bad sectors before write */
unsigned long flags;
long sec_num;/* physical tape-block number */
}IOBUFFER;

Data is read or written from the indicated address as specifed by the buffer field when the operation is performed.  Floppy tapes are broken into tape blocks.  Different tape formats have different numbers and sizes of tape blocks.  The T_GETPARMS ioctl call may be used to determine the size and number of tape blocks on the cartridge tape currently installed in the tape drive.  For the QREAD and QWRITE ioctl commands the sec_num field specifies a tape block which is to be read or written.  The badmap field indicates known bad spots in the tape block for which the request is being made so that the driver can avoid them.  The flags field is not currently used. 

For the READWAIT and WRITEWAIT ioctl commands the sec_num field represents a tape block for which a read or write request has already been queued and for which the application program now wants to know the completion status.  If the operation has been completed, the ioctl call will return immediately; if the operation has not been completed, the driver will wait for completion before returning.  The badmap field provides a mechanism through which new bad spots on the tape are reported to the application program.  If tape errors are encountered during the requested operation, bits in the badmap field are set to indicate the sectors that contained errors. 

T_GETPARMS
This ioctl command returns information about the tape drive and the cartridge in use. 

/*structure for T_GETPARMS calls */
struct tape_parms {
int devtype;/* type of drive */
int sec_blk;/* sectors per tape block */
int numblocks; /* total number of blocks on a tape */
int tapetrks;/* total number of tape tracks */
int trkblks;/* total number of blocks per tape track */
int numbuffs;/* total number of buffers available */
};

The devtype field contains the drive type and capacity encoded as ­follows:

Manufacturer Model Drive Value of Value of
Capacity Bits 4-7 Bits 1-2
Irwin 225 20 MB 1 2
Irwin 245 40 MB 1 1
Irwin 285 80/120 MB 1 0
Alloy APT-40 40 MB 0 undefined
CMS Jumbo 40 MB 2 undefined
Wangtek FAD3500 40 MB 2 undefined
Mountain TD4000 40 MB 2 undefined

The sec_blk field contains the number of sectors in one tape block on the drive currently installed. 

The numblocks field contains the total number of tape blocks contained on the cartridge tape currently installed. 

The tapetrks field contains the total number of tape tracks supported by the tape drive currently installed. 

The trkblks field contains the total number of tape blocks contained in one tape track. 

The driver contains internal buffers to assist in improving the performance of the tape subsystem and allowing the tape to stream whenever possible.  The numbuffs field contains the number of internal buffers contained in the driver, and up to numbuffs QREAD or QWRITE requests may be queued in the driver at one time.  If more than numbuffs QREAD or QWRITE requests are queued without an intervening READWAIT or WRITEWAIT, the driver with return an EIO error condition and not queue the request. 

SEE ALSO

ftape(1). 
ioctl(2) in the INTERACTIVE SDS Guide and Programmer’s Reference Manual.

DIAGNOSTICS

The driver will retry failed transfers up to three times.  If the request still has not succeeded, the driver will display an error message. 

ADDED VALUE

This entry, supplied by INTERACTIVE Systems Corporation, is an extension of UNIX System V. 

\*U  —  Version 1.0

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026