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