xref: /csrg-svn/share/man/man4/man4.vax/mtio.4 (revision 47674)
1*47674Scael.\" Copyright (c) 1983, 1991 The Regents of the University of California.
238804Sbostic.\" All rights reserved.
320734Smckusick.\"
443582Strent.\" %sccs.include.redist.man%
520734Smckusick.\"
6*47674Scael.\"     @(#)mtio.4	6.5 (Berkeley) 03/27/91
738804Sbostic.\"
8*47674Scael.Dd
9*47674Scael.Dt MTIO 4 vax
10*47674Scael.Os BSD 4.2
11*47674Scael.Sh NAME
12*47674Scael.Nm mtio
13*47674Scael.Nd
14*47674Scael.Tn UNIX
15*47674Scaelmagtape interface
16*47674Scael.Sh DESCRIPTION
17*47674ScaelThe special files
18*47674Scaelnamed
19*47674Scael.Pa /dev/mt0
20*47674Scaeland
21*47674Scael.Pa /dev/rmt0
22*47674Scaelthrough
23*47674Scael.Pa /dev/mt23
24*47674Scaeland
25*47674Scael.Pa /dev/rmt23
26*47674Scaelrefer to
27*47674Scael.Tn UNIX
28*47674Scaelmagtape drives,
29*47674Scaelwhich may be on the
30*47674Scael.Tn MASSBUS
31*47674Scaelusing the
32*47674Scael.Tn TM03
33*47674Scaelformatter
34*47674Scael.Xr ht 4 ,
3520734Smckusickor
36*47674Scael.Tn TM78
37*47674Scaelformatter,
38*47674Scael.Xr mt 4 ,
39*47674Scaelor on the
40*47674Scael.Tn UNIBUS
41*47674Scaelusing either the
42*47674Scael.Tn TM11
43*47674Scaelor
44*47674Scael.Tn TS11
45*47674Scaelformatters
46*47674Scael.Xr tm 4 ,
47*47674Scael.Tn TU45
48*47674Scaelcompatible formatters,
49*47674Scael.Xr ut 4 ,
50*47674Scaelor
51*47674Scael.Xr ts 4 .
52*47674ScaelThese devices are typical tape block devices,
53*47674Scaelsee
54*47674Scael.Xr physio 4 .
55*47674Scael.Pp
56*47674ScaelThe following table of the converntional device names
57*47674Scaelis applicable to any of the transport/controller pairs.
58*47674Scael(But note that only 1600
59*47674Scael.Tn BPI
60*47674Scaelis available with the
61*47674Scael.Tn TS11 . )
62*47674Scael.Bl -column "no-rewindxxx" "or lowest densityxx" "or lowest densityxx" "or lowest densityxx" -offset indent
63*47674Scael	      800 BPI	      1600 BPI	      6500 BPI
64*47674Scael.Em	or lowest density	or second density	or third density
65*47674Scael
66*47674ScaelRewind	     mt0/rmt0	      mt8/rmt8	       mt16/rmt16
67*47674ScaelRewind	     mt1/rmt1	      mt9/rmt9	       mt17/rmt17
68*47674ScaelRewind	     mt2/rmt2	      mt10/rmt10	       mt18/rmt18
69*47674ScaelRewind	     mt3/rmt3	      mt11/rmt11	       mt19/rmt19
70*47674ScaelNo-rewind	    nmt4/nrmt4	    nmt12/nrmt12	    nmt20/nrmt20
71*47674ScaelNo-rewind	    nmt5/nrmt5	    nmt13/nrmt13	    nmt21/nrmt21
72*47674ScaelNo-rewind	    nmt6/nrmt6	    nmt14/nrmt14	    nmt22/nrmt22
73*47674ScaelNo-rewind	    nmt7/nrmt7	    nmt15/nrmt15	    nmt23/nrmt32
74*47674Scael.El
75*47674Scael.Pp
76*47674ScaelThe rewind devices automatically rewind
77*47674Scaelwhen the last requested read, write or seek has finished, or the end of the tape
78*47674Scaelhas been reached. The letter
79*47674Scael.Ql n
80*47674Scaelis usually prepended to
81*47674Scaelthe name of the no-rewind devices.
82*47674Scael.Pp
83*47674ScaelUnix tapes are written in multiples of 1024 byte block
84*47674Scaelrecords. Two end-of-file markers mark the end of a tape, and
85*47674Scaelone end-of-file marker marks the end of a tape file.
86*47674ScaelIf the tape is not to be rewound it is positioned with the
87*47674Scaelhead in between the two tape marks, where the next write
88*47674Scaelwill over write the second end-of-file marker.
89*47674Scael.Pp
90*47674ScaelAll of the magtape devices may be manipulated with the
91*47674Scael.Xr mt 1
92*47674Scaelcommand.
93*47674Scael.Pp
94*47674ScaelA number of
95*47674Scael.Xr ioctl 2
96*47674Scaeloperations are available
9720734Smckusickon raw magnetic tape.
9820734SmckusickThe following definitions are from
99*47674Scael.Aq Pa sys/mtio.h :
100*47674Scael.Bd  -literal
10120734Smckusick/*
10220734Smckusick * Structures and definitions for mag tape io control commands
10320734Smckusick */
10420734Smckusick
10520734Smckusick/* structure for MTIOCTOP - mag tape op command */
10620734Smckusickstruct	mtop	{
10720734Smckusick	short	mt_op;		/* operations defined below */
10820734Smckusick	daddr_t	mt_count;	/* how many of them */
10920734Smckusick};
11020734Smckusick
11120734Smckusick/* operations */
11220734Smckusick#define MTWEOF	0	/* write an end-of-file record */
11320734Smckusick#define MTFSF	1	/* forward space file */
11420734Smckusick#define MTBSF	2	/* backward space file */
11520734Smckusick#define MTFSR	3	/* forward space record */
11620734Smckusick#define MTBSR	4	/* backward space record */
11720734Smckusick#define MTREW	5	/* rewind */
11820734Smckusick#define MTOFFL	6	/* rewind and put the drive offline */
11920734Smckusick#define MTNOP	7	/* no operation, sets status only */
120*47674Scael#define MTCACHE 8	/* enable controller cache */
121*47674Scael#define MTNOCACHE 9	/* disable controller cache */
12220734Smckusick
12320734Smckusick/* structure for MTIOCGET - mag tape get status command */
12420734Smckusick
12520734Smckusickstruct	mtget	{
12620734Smckusick	short	mt_type;	/* type of magtape device */
12720734Smckusick/* the following two registers are grossly device dependent */
12820734Smckusick	short	mt_dsreg;	/* ``drive status'' register */
12920734Smckusick	short	mt_erreg;	/* ``error'' register */
13020734Smckusick/* end device-dependent registers */
13120734Smckusick	short	mt_resid;	/* residual count */
13220734Smckusick/* the following two are not yet implemented */
13320734Smckusick	daddr_t	mt_fileno;	/* file number of current position */
13420734Smckusick	daddr_t	mt_blkno;	/* block number of current position */
13520734Smckusick/* end not yet implemented */
13620734Smckusick};
13720734Smckusick
13820734Smckusick/*
13928262Skarels * Constants for mt_type byte.  These are the same
140*47674Scael * for controllers compatible with the types listed.
14120734Smckusick */
14228262Skarels#define	MT_ISTS		0x01		/* TS-11 */
14328262Skarels#define	MT_ISHT		0x02		/* TM03 Massbus: TE16, TU45, TU77 */
14428262Skarels#define	MT_ISTM		0x03		/* TM11/TE10 Unibus */
14528262Skarels#define	MT_ISMT		0x04		/* TM78/TU78 Massbus */
14628262Skarels#define	MT_ISUT		0x05		/* SI TU-45 emulation on Unibus */
14728262Skarels#define	MT_ISCPC	0x06		/* SUN */
14828262Skarels#define	MT_ISAR		0x07		/* SUN */
14928262Skarels#define	MT_ISTMSCP	0x08		/* DEC TMSCP protocol (TU81, TK50) */
150*47674Scael#define MT_ISCY 	0x09		/* CCI Cipher */
151*47674Scael#define MT_ISCT 	0x0a		/* HP 1/4 tape */
152*47674Scael#define MT_ISFHP	0x0b		/* HP 7980 1/2 tape */
153*47674Scael#define MT_ISEXABYTE	0x0c		/* Exabyte */
154*47674Scael#define MT_ISEXA8200	0x0c		/* Exabyte EXB-8200 */
155*47674Scael#define MT_ISEXA8500	0x0d		/* Exabyte EXB-8500 */
156*47674Scael#define MT_ISVIPER1	0x0e		/* Archive Viper-150 */
157*47674Scael#define MT_ISPYTHON	0x0f		/* Archive Python (DAT) */
158*47674Scael#define MT_ISHPDAT	0x10		/* HP 35450A DAT drive */
15920734Smckusick
16020734Smckusick/* mag tape io control commands */
161*47674Scael#define	MTIOCTOP	_IOW('m', 1, struct mtop)	/* do a mag tape op */
162*47674Scael#define	MTIOCGET	_IOR('m', 2, struct mtget)	/* get tape status */
163*47674Scael#define MTIOCIEOT	_IO('m', 3)			/* ignore EOT error */
164*47674Scael#define MTIOCEEOT	_IO('m', 4)			/* enable EOT error */
16520734Smckusick
16620734Smckusick#ifndef KERNEL
16720734Smckusick#define	DEFTAPE	"/dev/rmt12"
16820734Smckusick#endif
169*47674Scael
170*47674Scael#ifdef	KERNEL
171*47674Scael/*
172*47674Scael * minor device number
173*47674Scael */
174*47674Scael
175*47674Scael#define	T_UNIT		003		/* unit selection */
176*47674Scael#define	T_NOREWIND	004		/* no rewind on close */
177*47674Scael#define	T_DENSEL	030		/* density select */
178*47674Scael#define	T_800BPI	000		/* select  800 bpi */
179*47674Scael#define	T_1600BPI	010		/* select 1600 bpi */
180*47674Scael#define	T_6250BPI	020		/* select 6250 bpi */
181*47674Scael#define	T_BADBPI	030		/* undefined selection */
182*47674Scael#endif
183*47674Scael.Ed
184*47674Scael.Pp
185*47674Scael.Sh FILES
186*47674Scael.Bl -tag -width /dev/rmt? -compact
187*47674Scael.It Pa /dev/mt?
188*47674Scael.It Pa /dev/rmt?
189*47674Scael.El
190*47674Scael.Sh SEE ALSO
191*47674Scael.Xr mt 1 ,
192*47674Scael.Xr tar 1 ,
193*47674Scael.Xr tp 1 ,
194*47674Scael.Xr ht 4 ,
195*47674Scael.Xr tm 4 ,
196*47674Scael.Xr ts 4 ,
197*47674Scael.Xr mt 4 ,
198*47674Scael.Xr ut 4
199*47674Scael.Sh HISTORY
200*47674ScaelThe
201*47674Scael.Nm mtio
202*47674Scaelmanual appeared in
203*47674Scael.Bx 4.2 .
204*47674Scael.Sh BUGS
20520734SmckusickThe status should be returned in a device independent format.
206*47674Scael.Pp
20728262SkarelsThe special file naming should be redone in a more consistent and
20828262Skarelsunderstandable manner.
209