@V7 54 2 -5
@L3 COUK1247
80
@V9 0
@YCHAPTER 17 - MUSS USER MANUAL
@G@RCHAPTER 17 - DISC AND MAGNETIC TAPE FACILITIES@G
@V10 1 9 241
@T% 10
@BThis Chapter outlines the procedures provided in MUSS for
handling exchangeable disc and magnetic tape devices. The
facilities described are used by system software such as the file
archive manager, but are also available to users wishing to access
private volumes outside the file system.
@BThe basic system distinguishes between two types of device: fixed
and variable block transfer devices respectively. Most exchangeable
discs and some magnetic tapes are fixed block devices. These are
pre-addressed, and hence a device address can be specified with each
transfer request. Industry Compatible Magnetic Tapes, as well as
some exchangeable disc systems, are variable block devices. With
these there is no concept of 'address' on the device and accessing
is usually sequential. For convenience, fixed block devices are
referred to as 'discs', and variable block devices as 'tapes'.
@BIndividual tapes and disc cartridges (volumes) are identified to
the system by a name and a label. The name is used to identify the
volume to the operators - thus it will usually be a serial number
enabling the operator to find the required volume upon request. The
label is under the control of the user who 'owns' a particular
volume, and serves two purposes. Firstly, it provides a check that
the correct volume, and not another which has somehow acquired the
same serial number, is loaded. Secondly, it acts as a 'password',
protecting the volume against unauthorised access by other users.
Labels are written by one of the procedures described below. A
facility exists to force the system to accept an incorrectly
labelled volume. This enables non-standard volumes, and volumes
which have not yet been labelled, to be accessed. This facility is
described with the operator commands in Chapter 20.
@BIn the basic system, deadlock situations are resolved by the
operator by dismounting selected volumes. Thus, all processes using
discs or magnetic tapes should be prepared to receive the response
'device not available' to any of its requests, and to recover as
appropriate.
@S217.1 COMMAND PROCEDURES
@BThe commands associated with disc and tape management fall into two
categories, namely the acquisition and control of a disc/tape
unit and the commands for actually driving the unit, performing
transfers etc. The high level control functions are common to both
tapes and discs, and a description of these commands immediately
follows. The physical characteristics of the two types of media
require a different set of functions for performing transfers,
and so these commands are described separately for the
fixed and variable block devices.
@S317.1.1 Organisational Functions
@
@
1) @JMOUNT(II,II,[C])
@BThis procedure requests a particular tape or disc to be mounted
on an available unit, and allocated to the calling process. The
unit number is returned in PW1. The first parameter is used to
signify whether the medium is a tape or disc, and so P1 should
take the value "TAPE" or "DISC". P2 is the name of the tape/disc
to be loaded. If it is not already available on a drive,
then a message is output to the operator to mount it.
This message will be repeated periodically until either the
tape/disc becomes available or until the operator
signals CANTDO to the process.
@BThe expected value of the tape label appears in P3. If a
tape of the required name is available but P3 does not
match the label on the tape, an error is signalled to the process.@
@
@
2) @JRELEASE(I)
@BThis procedure is used to release a disc or tape unit
previously allocated by the MOUNT command. The device is
disengaged and the operator informed so that the volume
may be removed from the drive. P1 specifies the unit number
to be relinquished. If this is negative, all disc and tape
drives assigned to the current process will be released.@
@
@
3) @JWRITE.LABEL(I,II,[C])
@BThis procedure changes the name of a volume which has already
been mounted. P1 specifies the unit number, as returned from the
mount command. P2 and P3 give the new name and label to be
written to the volume.
@S317.1.2 Fixed Block Transfers
@
@
1) @JED.READ(I,I,I,I)
@BThis procedure reads data from a disc or pre-addressed fixed block
size magnetic tape to a buffer in the current process' virtual store.
P1 states the unit number of the required volume. P2 gives the
virtual address of the start of the buffer.  P3 gives the address
of the data on the disc and P4 the amount of data to be transferred.
Both these parameters are in byte units.  There may be hardware
dependent restrictions on the values of P2, P3 and P4.
@
@
2) @JED.WRITE(I,I,I,I)
@BThis procedure writes data to a disc or pre-addressed
magnetic tape from a buffer in the current process' virtual
store. The interpretation of the parameters is exactly the
same as for ED.READ.
@S317.1.3 Variable Block Transfers
@
@
1) @JMT.SKIP(I,I,I)
@BThis procedure skips over a number of blocks of data on the specified
device. P1 is the unit number and P2 the direction to be
travelled (0 = forwards, 1 = backwards).
P3 gives the number of data blocks to be skipped. At least
1 block will always be skipped, even if P3 is zero.
PW0 might be set to a fault condition if the device tries to skip over
a tape mark, or beyond the end of the tape.@
@
@
2) @JMT.READ(I,I,II,I)
@BThis procedure reads the next block of data from the
specified unit (P1). P2 gives the virtual address in bytes
to which the data is to be read and P3 states the maximum size of the transfer.
P4 gives the direction
in which the medium is to be moved (0 = forwards, 1 = backwards).
As with MT.SKIP, a fault will be signalled if a tape mark
or end of tape is encountered.
@BThe actual size of the transfer (in bytes) is returned in
PW1.@
@
@
3) @JMT.WRITE(I,I,I)
@BThis procedure writes a block of data to the specified unit
(P1). P2 gives the virtual address in bytes of the start of the
data and P3 the number of bytes to be transferred.@
@
@
4) @JMT.SKIP.TM(I,I,I)
@BThis procedure skips across data blocks on a medium until
a tape mark is encountered. P1 specifies the unit number
of the tape and P2 the direction of travel (0 = forwards, 1 = backwards).
P3 specifies the number of tape marks to be skipped.
@
@
5) @JMT.WRITE.TM(I)
@BThis procedure writes a tape mark on the specified device (P1).@
@
@
6) @JMT.REWIND(I)
@BThe procedure rewinds the specified tape so that the transfer
heads are positioned at the start of the medium.
@S217.2 UTILITIES
@BA number of facilities are provided to allow users to
read and write tapes according to certain standard
formats. The formats determine@
@
@Q 5
@T% 10
@
  i)@Iwhether labels are present on the tape@
  ii)@Iwhether MUSS housekeeping information
(as described in Chapter 16) is also
stored with the file.@
@BTwo conventions for labelling tapes are currently used.
The first is according to ANSI standard X3.27, which
defines the sequence for volume labels, file labels and tape
marks. The second is where labels are omitted, and
the only textual information on the tape is that of the actual
files. A single tape mark separating each file is the only
control information used in this case. For both formats, a
double tape mark signifies end of tape.
@BThe utilities for reading/creating tapes have a
parameter to specify the format required. This parameter may
take the following values:@
@Q 14
@
0@IFiles include MUSS housekeeping information, ANSI standard
labels are written to the tape. This is the normal form for
transmission of files between MUSS systems.@
@
1@IHousekeeping information is removed from the files. ANSI
standard labels are included.@
@
2@INo labels are written to the tape. Files include MUSS
housekeeping information.@
@
3@INo labels or housekeeping information are written to the
tape. This format is often used for transmission of
textual files between incompatible systems.@
@
@
1) @JWRITE.FILE(I,[C],I,I,[C],[C],[C],I)@
@BThis procedure writes a file P2 to the tape
on unit P1. P3 specifies the format to be used
for the file. The size of the data blocks on
the tape is given by P4. If this is negative or
zero, a default size of 1 Kbyte will be used.
@BParameters P5 and P8 are only applicable to
tapes written in ANSI format, and specify information
to be inserted into the header label which precedes
the file on the tape. P5 is the sequence number of
the file on the tape; P6 is the file generation
number; P7 is an expiry date for the file and
P8 is an accessibility key. The expiry date is
specified as five digits, the first two giving the year
and the next three the day within the year.
Suitable defaults are supplied for P5 to P8 if
specific values are not given.@
@
@
2) @JWRITE.TAPE(II,[C],I,I,I)
@BThis procedure writes a set of files to a tape.
The parameters P1 and P2 specify a
tape name and tape label respectively. P3 states
the format to be used for the individual files on
the tape. If ANSI standard format is chosen, a
suitable volume label will be written at the start
of the tape before the individual files. P4 specifies
a block size to be used for the files, with a default
as for WRITE.FILE. P5 indicates whether a number
of files already exist on the tape. Thus, if P5
is non zero, the procedure skips to the current
end of the tape before appending the new files.
@BThe procedure prompts for the names of the
files to be written. If a ? appears in a filename,
the procedure selects a set of files from within the current
directory whose names @Gcommence@G with the string immediately
preceding the ?. If a ? on its own is typed, the entire
directory will be copied to tape. A file name of @@ indicates
that the tape is complete, and appropriate
tape marks are written to the tape.
@
@
3) @JREAD.FILE(I,[C],I,[C])
@BThis procedure reads a file from the tape
mounted on unit P1. P2 gives the filename which will
be used for securing the file. P3 specifies the format of
the tape. If ANSI format is used and a null filename
is specified, a filename will be extracted from the file
header label on the tape. P4 is only applicable to
ANSI tapes, and should be a vector into which
the 80 character file header label is returned.
@
@
4) @JREAD.TAPE(II,[C],I)
@BThis procedure reads a set of files from a tape.
The tape name and label are specified in P1 and
P2 respectively. P3 states the format of the tape.
If the tape is in ANSI format, the names of the
individual files are extracted from the file header
labels preceding each file on the tape. For simple
textual tapes, the procedure prompts for the individual
file names before reading each file. The procedure returns
when a double tape mark is encountered.
@
@
5) @JFIND.FILE(I,[C])
@BThis procedure searches an ANSI format tape for
a file with name P2. P1 gives the unit number
of the tape drive.
@BAt the end of the command, the tape is in a
position where a subsequent call of READ.FILE will
copy the file from the tape. As the search is
in a forward direction along the tape starting at
the current position, a file will not be found if it has
already been passed over. If the user does not know
the relative position of the required file on the tape,
an MT.REWIND command should be issued initially to ensure
that the complete tape is searched.
@
@
6) @JCOPY.TAPE(II,[C],II,[C],I)
@BThis procedure may be called to create a copy of
a tape. P1 and P2 give the name and label of the tape
to be copied, and P3 and P4 give the name and label of
the tape to be overwritten. The parameter P5 gives the action
to be taken on errors. If non-zero, the copying process is
halted on detection of an error. When zero, errors are monitored,
but an attempt is made to continue the copying process.
@F
