1*61591Sbostic.\" Copyright (c) 1986, 1991, 1993 2*61591Sbostic.\" The Regents of the University of California. All rights reserved. 330153Smckusick.\" 449211Scael.\" %sccs.include.redist.roff% 530153Smckusick.\" 6*61591Sbostic.\" @(#)mtio.4 8.1 (Berkeley) 06/05/93 738805Sbostic.\" 849211Scael.Dd 949211Scael.Dt MTIO 4 1049211Scael.Os 1149211Scael.Sh NAME 1249211Scael.Nm mtio 1349211Scael.Nd 1449211Scael.Tn UNIX 1549211Scaelmagtape interface 1649211Scael.Sh DESCRIPTION 1749211ScaelThe special files named 1849211Scael.Pa /dev/cy0s , 1949211Scael..., 2049211Scael.Pa /dev/cy15s 2149211Scaelare interfaces to the 2249211Scael.Tn UNIX 2349211Scaelmagtape drivers. 2449211ScaelFor the 2549211ScaelTahoe, these interfaces 2649211Scaelmay be on the 2749211Scael.Tn VERSABUS 2849211Scaelvia a 2949211Scael.Tn CIPHER 3049211Scaeltapemaster formatter 3149211Scael.Xr cy 4 . 3230153SmckusickThe files 3349211Scael.Pa cy0s , 3449211Scael..., 3549211Scael.Pa cy15s 3649211Scaelare read/written in 25 3749211Scael.Tn IPS , 3849211ScaelThe density (1600 3949211Scael.Tn BPI 4049211Scaelor 3200 4149211Scael.Tn BPI ) 4249211Scaelis selected by a switch on the drive. 4349211ScaelThe following table of device names 4449211Scaelapplies to any of the transport/controller pairs. 4549211Scael.Bl -column "rewindxxx" "No-rewindxxx" "rewindxxxx" "No-rewindxxxx" -offset indent 4649211Scael.Em Rewind No-rewind Rewind No-rewind 4749211Scaelcy0s/rcy0s ncy0s/nrcy0s cy8s/rcy8s ncy8s/nrcy8s 4849211Scaelcy1s/rcy1s ncy1s/nrcy1s cy9s/rcy9s ncy9s/nrcy9s 4949211Scaelcy2s/rcy2s ncy2s/nrcy2s cy10s/rcy10s ncy10s/nrcy10s 5049211Scaelcy3s/rcy3s ncy3s/nrcy3s cy11s/rcy11s ncy11s/nrcy11s 5149211Scaelcy4s/rcy4s ncy4s/nrcy4s cy12s/rcy12s ncy12s/nrcy12s 5249211Scaelcy5s/rcy5s ncy5s/nrcy5s cy13s/rcy13s ncy13s/nrcy13s 5349211Scaelcy6s/rcy6s ncy6s/nrcy6s cy14s/rcy14s ncy14s/nrcy14s 5449211Scaelcy7s/rcy7s ncy7s/nrcy7s cy15s/rcy15s ncy15s/nrcy15s 5549211Scael.El 5649211Scael.Pp 5749211ScaelThe rewind devices automatically rewind 5849211Scaelwhen the last requested read, write or seek has finished, or the end of the tape 5949211Scaelhas been reached. The letter 6049211Scael.Ql n 6149211Scaelis usually prepended to 6249211Scaelthe name of the no-rewind devices. 6349211Scael.Pp 6449211ScaelFor compatibility with customary 6549211Scael.Tn UNIX 6649211Scaeltape device 6749211Scaelnames 6849211Scael.Dq Em mt* , 6949211Scaelthe 7049211Scael.Bo Pa n Bc Pa cy*s 7130153Smckusickfiles are linked to appropriate 7249211Scael.Bo Pa n Bc Em mt* 7330153Smckusickfiles. 7449211Scael.Pp 7549211ScaelUnix tapes are written in multiples of 1024 byte block 7649211Scaelrecords. Two end-of-file markers mark the end of a tape, and 7749211Scaelone end-of-file marker marks the end of a tape file. 7849211ScaelIf the tape is not to be rewound it is positioned with the 7949211Scaelhead in between the two tape marks, where the next write 8049211Scaelwill over write the second end-of-file marker. 8149211Scael.Pp 8249211ScaelAll of the magtape devices may be manipulated with the 8349211Scael.Xr mt 1 8449211Scaelcommand. 8549211Scael.Pp 8649211ScaelA number of other 8749211Scael.Xr ioctl 2 8849211Scaeloperations are available 8930153Smckusickon raw magnetic tape. 9049211ScaelThe following definitions are from 9149211Scael.Aq Pa sys/mtio.h : 9249211Scael.Bd -literal 9330153Smckusick/* 9430153Smckusick * Structures and definitions for mag tape io control commands 9530153Smckusick */ 9630153Smckusick 9730153Smckusick/* structure for MTIOCTOP - mag tape op command */ 9849211Scaelstruct mtop { 9930153Smckusick short mt_op; /* operations defined below */ 10030153Smckusick daddr_t mt_count; /* how many of them */ 10130153Smckusick}; 10230153Smckusick 10330153Smckusick/* operations */ 10449211Scael#define MTWEOF 0 /* write an end-of-file record */ 10549211Scael#define MTFSF 1 /* forward space file */ 10649211Scael#define MTBSF 2 /* backward space file */ 10749211Scael#define MTFSR 3 /* forward space record */ 10849211Scael#define MTBSR 4 /* backward space record */ 10949211Scael#define MTREW 5 /* rewind */ 11049211Scael#define MTOFFL 6 /* rewind and put the drive offline */ 11149211Scael#define MTNOP 7 /* no operation, sets status only */ 11249211Scael#define MTCACHE 8 /* enable controller cache */ 11349211Scael#define MTNOCACHE 9 /* disable controller cache */ 11430153Smckusick 11530153Smckusick/* structure for MTIOCGET - mag tape get status command */ 11630153Smckusick 11749211Scaelstruct mtget { 11849211Scael short mt_type; /* type of magtape device */ 11930153Smckusick/* the following two registers are grossly device dependent */ 12049211Scael short mt_dsreg; /* ``drive status'' register */ 12149211Scael short mt_erreg; /* ``error'' register */ 12230153Smckusick/* end device-dependent registers */ 12349211Scael short mt_resid; /* residual count */ 12430153Smckusick/* the following two are not yet implemented */ 12549211Scael daddr_t mt_fileno; /* file number of current position */ 12649211Scael daddr_t mt_blkno; /* block number of current position */ 12730153Smckusick/* end not yet implemented */ 12830153Smckusick}; 12930153Smckusick 13030153Smckusick/* 13149211Scael * Constants for mt_type byte. These are the same 13249211Scael * for controllers compatible with the types listed. 13330153Smckusick */ 13449211Scael#define MT_ISTS 0x01 /* TS-11 */ 13549211Scael#define MT_ISHT 0x02 /* TM03 Massbus: TE16, TU45, TU77 */ 13649211Scael#define MT_ISTM 0x03 /* TM11/TE10 Unibus */ 13749211Scael#define MT_ISMT 0x04 /* TM78/TU78 Massbus */ 13849211Scael#define MT_ISUT 0x05 /* SI TU-45 emulation on Unibus */ 13949211Scael#define MT_ISCPC 0x06 /* SUN */ 14049211Scael#define MT_ISAR 0x07 /* SUN */ 14149211Scael#define MT_ISTMSCP 0x08 /* DEC TMSCP protocol (TU81, TK50) */ 14249211Scael#define MT_ISCY 0x09 /* CCI Cipher */ 14349211Scael#define MT_ISCT 0x0a /* HP 1/4 tape */ 14449211Scael#define MT_ISFHP 0x0b /* HP 7980 1/2 tape */ 14549211Scael#define MT_ISEXABYTE 0x0c /* Exabyte */ 14649211Scael#define MT_ISEXA8200 0x0c /* Exabyte EXB-8200 */ 14749211Scael#define MT_ISEXA8500 0x0d /* Exabyte EXB-8500 */ 14849211Scael#define MT_ISVIPER1 0x0e /* Archive Viper-150 */ 14949211Scael#define MT_ISPYTHON 0x0f /* Archive Python (DAT) */ 15049211Scael#define MT_ISHPDAT 0x10 /* HP 35450A DAT drive */ 15149211Scael 15249211Scael/* mag tape io control commands */ 15349211Scael#define MTIOCTOP _IOW('m', 1, struct mtop) /* do a mag tape op */ 15449211Scael#define MTIOCGET _IOR('m', 2, struct mtget) /* get tape status */ 15549211Scael#define MTIOCIEOT _IO('m', 3) /* ignore EOT error */ 15649211Scael#define MTIOCEEOT _IO('m', 4) /* enable EOT error */ 15749211Scael 15849211Scael#ifndef KERNEL 15949211Scael#define DEFTAPE "/dev/rmt12" 16049211Scael#endif 16149211Scael 16249211Scael#ifdef KERNEL 16349211Scael/* 16449211Scael * minor device number 16549211Scael */ 16649211Scael 16749211Scael#define T_UNIT 003 /* unit selection */ 16849211Scael#define T_NOREWIND 004 /* no rewind on close */ 16949211Scael#define T_DENSEL 030 /* density select */ 17049211Scael#define T_800BPI 000 /* select 800 bpi */ 17149211Scael#define T_1600BPI 010 /* select 1600 bpi */ 17249211Scael#define T_6250BPI 020 /* select 6250 bpi */ 17349211Scael#define T_BADBPI 030 /* undefined selection */ 17449211Scael#endif 17549211Scael.Ed 17649211Scael.Sh FILES 17749211Scael.Bl -tag -width /dev/nrcy? -compact 17849211Scael.It Pa /dev/cy? , 17949211Scael.It Pa /dev/rcy? 18049211ScaelRewind devices. 18149211Scael.It Pa /dev/ncy? , 18249211Scael.It Pa /dev/nrcy? 18349211ScaelNo-rewind devices. 18449211Scael.It Pa /dev/[n]mt? , 18549211Scael.It Pa /dev/[n]rmt? 18649211ScaelLinked device names. 18749211Scael.El 18849211Scael.Sh SEE ALSO 18949211Scael.Xr mt 1 , 19049211Scael.Xr tar 1 , 19149211Scael.Xr cy 4 192