1.\" Copyright (c) 1986, 1991 The Regents of the University of California. 2.\" All rights reserved. 3.\" 4.\" %sccs.include.redist.roff% 5.\" 6.\" @(#)mtio.4 6.4 (Berkeley) 05/06/91 7.\" 8.Dd 9.Dt MTIO 4 10.Os 11.Sh NAME 12.Nm mtio 13.Nd 14.Tn UNIX 15magtape interface 16.Sh DESCRIPTION 17The special files named 18.Pa /dev/cy0s , 19..., 20.Pa /dev/cy15s 21are interfaces to the 22.Tn UNIX 23magtape drivers. 24For the 25Tahoe, these interfaces 26may be on the 27.Tn VERSABUS 28via a 29.Tn CIPHER 30tapemaster formatter 31.Xr cy 4 . 32The files 33.Pa cy0s , 34..., 35.Pa cy15s 36are read/written in 25 37.Tn IPS , 38The density (1600 39.Tn BPI 40or 3200 41.Tn BPI ) 42is selected by a switch on the drive. 43The following table of device names 44applies to any of the transport/controller pairs. 45.Bl -column "rewindxxx" "No-rewindxxx" "rewindxxxx" "No-rewindxxxx" -offset indent 46.Em Rewind No-rewind Rewind No-rewind 47cy0s/rcy0s ncy0s/nrcy0s cy8s/rcy8s ncy8s/nrcy8s 48cy1s/rcy1s ncy1s/nrcy1s cy9s/rcy9s ncy9s/nrcy9s 49cy2s/rcy2s ncy2s/nrcy2s cy10s/rcy10s ncy10s/nrcy10s 50cy3s/rcy3s ncy3s/nrcy3s cy11s/rcy11s ncy11s/nrcy11s 51cy4s/rcy4s ncy4s/nrcy4s cy12s/rcy12s ncy12s/nrcy12s 52cy5s/rcy5s ncy5s/nrcy5s cy13s/rcy13s ncy13s/nrcy13s 53cy6s/rcy6s ncy6s/nrcy6s cy14s/rcy14s ncy14s/nrcy14s 54cy7s/rcy7s ncy7s/nrcy7s cy15s/rcy15s ncy15s/nrcy15s 55.El 56.Pp 57The rewind devices automatically rewind 58when the last requested read, write or seek has finished, or the end of the tape 59has been reached. The letter 60.Ql n 61is usually prepended to 62the name of the no-rewind devices. 63.Pp 64For compatibility with customary 65.Tn UNIX 66tape device 67names 68.Dq Em mt* , 69the 70.Bo Pa n Bc Pa cy*s 71files are linked to appropriate 72.Bo Pa n Bc Em mt* 73files. 74.Pp 75Unix tapes are written in multiples of 1024 byte block 76records. Two end-of-file markers mark the end of a tape, and 77one end-of-file marker marks the end of a tape file. 78If the tape is not to be rewound it is positioned with the 79head in between the two tape marks, where the next write 80will over write the second end-of-file marker. 81.Pp 82All of the magtape devices may be manipulated with the 83.Xr mt 1 84command. 85.Pp 86A number of other 87.Xr ioctl 2 88operations are available 89on raw magnetic tape. 90The following definitions are from 91.Aq Pa sys/mtio.h : 92.Bd -literal 93/* 94 * Structures and definitions for mag tape io control commands 95 */ 96 97/* structure for MTIOCTOP - mag tape op command */ 98struct mtop { 99 short mt_op; /* operations defined below */ 100 daddr_t mt_count; /* how many of them */ 101}; 102 103/* operations */ 104#define MTWEOF 0 /* write an end-of-file record */ 105#define MTFSF 1 /* forward space file */ 106#define MTBSF 2 /* backward space file */ 107#define MTFSR 3 /* forward space record */ 108#define MTBSR 4 /* backward space record */ 109#define MTREW 5 /* rewind */ 110#define MTOFFL 6 /* rewind and put the drive offline */ 111#define MTNOP 7 /* no operation, sets status only */ 112#define MTCACHE 8 /* enable controller cache */ 113#define MTNOCACHE 9 /* disable controller cache */ 114 115/* structure for MTIOCGET - mag tape get status command */ 116 117struct mtget { 118 short mt_type; /* type of magtape device */ 119/* the following two registers are grossly device dependent */ 120 short mt_dsreg; /* ``drive status'' register */ 121 short mt_erreg; /* ``error'' register */ 122/* end device-dependent registers */ 123 short mt_resid; /* residual count */ 124/* the following two are not yet implemented */ 125 daddr_t mt_fileno; /* file number of current position */ 126 daddr_t mt_blkno; /* block number of current position */ 127/* end not yet implemented */ 128}; 129 130/* 131 * Constants for mt_type byte. These are the same 132 * for controllers compatible with the types listed. 133 */ 134#define MT_ISTS 0x01 /* TS-11 */ 135#define MT_ISHT 0x02 /* TM03 Massbus: TE16, TU45, TU77 */ 136#define MT_ISTM 0x03 /* TM11/TE10 Unibus */ 137#define MT_ISMT 0x04 /* TM78/TU78 Massbus */ 138#define MT_ISUT 0x05 /* SI TU-45 emulation on Unibus */ 139#define MT_ISCPC 0x06 /* SUN */ 140#define MT_ISAR 0x07 /* SUN */ 141#define MT_ISTMSCP 0x08 /* DEC TMSCP protocol (TU81, TK50) */ 142#define MT_ISCY 0x09 /* CCI Cipher */ 143#define MT_ISCT 0x0a /* HP 1/4 tape */ 144#define MT_ISFHP 0x0b /* HP 7980 1/2 tape */ 145#define MT_ISEXABYTE 0x0c /* Exabyte */ 146#define MT_ISEXA8200 0x0c /* Exabyte EXB-8200 */ 147#define MT_ISEXA8500 0x0d /* Exabyte EXB-8500 */ 148#define MT_ISVIPER1 0x0e /* Archive Viper-150 */ 149#define MT_ISPYTHON 0x0f /* Archive Python (DAT) */ 150#define MT_ISHPDAT 0x10 /* HP 35450A DAT drive */ 151 152/* mag tape io control commands */ 153#define MTIOCTOP _IOW('m', 1, struct mtop) /* do a mag tape op */ 154#define MTIOCGET _IOR('m', 2, struct mtget) /* get tape status */ 155#define MTIOCIEOT _IO('m', 3) /* ignore EOT error */ 156#define MTIOCEEOT _IO('m', 4) /* enable EOT error */ 157 158#ifndef KERNEL 159#define DEFTAPE "/dev/rmt12" 160#endif 161 162#ifdef KERNEL 163/* 164 * minor device number 165 */ 166 167#define T_UNIT 003 /* unit selection */ 168#define T_NOREWIND 004 /* no rewind on close */ 169#define T_DENSEL 030 /* density select */ 170#define T_800BPI 000 /* select 800 bpi */ 171#define T_1600BPI 010 /* select 1600 bpi */ 172#define T_6250BPI 020 /* select 6250 bpi */ 173#define T_BADBPI 030 /* undefined selection */ 174#endif 175.Ed 176.Sh FILES 177.Bl -tag -width /dev/nrcy? -compact 178.It Pa /dev/cy? , 179.It Pa /dev/rcy? 180Rewind devices. 181.It Pa /dev/ncy? , 182.It Pa /dev/nrcy? 183No-rewind devices. 184.It Pa /dev/[n]mt? , 185.It Pa /dev/[n]rmt? 186Linked device names. 187.El 188.Sh SEE ALSO 189.Xr mt 1 , 190.Xr tar 1 , 191.Xr cy 4 192