	Disk Save and Compress (DSC)  Tape Formats
 
	1-April-81
 
 
 
I. INTRODUCTION
 
	This note describes what I have learned of the format of DSC produced
magnetic tapes.  The information presented here is to be considered preliminary
and subject to revision.  The Stand-Alone DSC V2 was used to create test
tapes for this project.
 
				Bill Burton
				Texas Research Institute of Mental Sciences
				1300 Moursund
				Houston, Texas  77030
				(713) 797-1976 ext 501

II. DSC TAPE STRUCTURE
 
	Basically, DSC tapes are ANSI standard version 1 labeled magtapes.
Standard version 1 has been superceeded by version 3 (ANSI X3.27-1978).
Some of the label records are non-conforming or undefined in the version 3
standard.
 
	The DSC tape volume consists of ANSI labeled volume and header
labels surrounding DSC formatted data records.
 
Record Number  Length  Contents
 
	1	80.	VOL1 label record
			volume identifier derived from the output file name
			given in the DSC command line for the first output
			file.
			a. Truncated to 4 characters if necessary
			b. Padded to 4 characters using the character X
			c. Sequence number, 2 characters
				01 for first reel of a set
				02 for second, etc.
			d. Other information is documented in ANSI Standard
			   Manual or RSX-11 I/O Operations Manual.
 
	2	512.	Dummy bootstrap block which produces the message
			"This volume does not contain a hardware bootable
			system".
 
	3	80.	HDR1 label record
			a. File name specified in DSC command line
			b. Volume identifier from VOL1 record
 
	4	80.	HDR2 label record
			a. An undefined record code (U) is non-standard
			b. Logical record length 2064 bytes
			c. Physical record length maximum 2064 bytes
			d. The character M in byte 37, non-standard
			e. Buffer offset 00 in bytes 51-52.
 
	5	Tapemark
 
	6	1040.	First DSC formatted record, contains
			a. 8 word (16 bytes) DSC header with code=40
			b. 512. bytes of DSC Bookkeeping information
				(documented in section IV)
			c. 512. byte Files-11 file header for the file
				(1,1) [0,0]INDEXF.SYS;1
 
	7. 	1040.	DSC Data record
			should contain initialization data for disk
			structure, 2 virtual blocks worth.
 
	8.	2064.	DSC Data record
			More initialization information for virtual
			block 377,177777.
 

records 9 and up lengths 528., 1040., 1552., or 2064.
			Contain DSC data records with DSC codes 1, 2, or 4
			The details of these records are in section III.
			DSC copies files to the output tape in file-number
			order.  For each input file on the disk there is
				1 type 2 record (of unknown function)
				1 type 4 Files-11 Header record
				as many type 1 data records as needed to
				   hold all virtual blocks allocated to the
				   input file.
 
 
 
At the end of data from a disk volume, there will be
 
Record number	Length	Contents
 
	N	tapemark
 
	N+1	80.	EOF1 record
			Identical to HDR1 except bytes 55-60 now contain
				the number of physical tape records between
				HDR2 and EOF1.
 
	N+2	80.	EOF2 record
			Identical to HDR2 record
 
	N+3	tapemark
 
	N+4	tapemark, if this is the end of the tape volume OR
		80.	HDR1 for the next output tape file 
				created using DSC /AP switch.
 
If the tape is filled, (ie reaches the End-of-Tape foil marker)
the EOF1 and EOF2 records will be replaced by EOV1 and EOV2 records.
The following reel in the set will start with a VOL1 label with
the output volume name incremented by 1.  The structure of all subsequent
reels is the same as described above for the first reel, except that data
records start immediately.  There will be no DSC initialization records
(6, 7, and 8. above) on subsequent reels.  It is possible for data from a
disk file to be split across two reels, and the data for a file can be
separated from its DSC header records or Files-11 header record when changing
reels.

III. DSC DATA RECORD FORMAT
 
	Within the labeled file, DSC writes its own format records.
These records contain:
	a. An 8. word header
	b. 1, 2, 3, or 4-512. byte logical data blocks.
 
DSC header Format
 
word 1	Length of the data portion of the record, excluding ALL DSC specific
	information.
 
word 2	DSC record-type code indicating the type of data in the data portion
	of the record.
	code = 1   Disk data record(s), images of input disk blocks
	       2   Prefix information.  I have not fully decoded the
			data in these records.  May have some filename
			and extent information.
	       4   Files-11 file header (records of code 4 only have
			one 512. byte data block).
	      40   Special DSC initialization record.
		        a. 512. bytes of initialization information
			   see section IV.
			b. 512. byte Files-11 header for INDEXF.SYS
 
words 3-4 For type 1 records, these words contain the Virtual Block Number
	(VBN) of the of the first logical block in the DSC data record.
	The low order part of the VBN is in word 3, the high-order
		part is in the low byte of word 4.
	I have not fully understood the use of these words for the
		second data record for the INDEXF.SYS file.
 
word 5	The file number this record applies to
 
word 6	The file sequence number this record applies to.
 
words 7-8 Always seem to be zero.
 

IV. DSC INITIALIZATION RECORD
 
	This record contains the usual 8-word DSC header with a code
of octal-40 in word 2.  The data portion of the record contains 512.
bytes of DSC control information plus the 512. byte Files-11 file header
for (1,1) [0,0]INDEXF.SYS;1
 
The DSC control information is formatted within the record as follows:
 
	Bytes		Contents
 
     1.- 12.	DSC Output name from the command line, ASCII padded with
			spaces
    13.- 24.	Input device name (e.g. DK1), ASCII, padded with spaces
    25.- 36.	? null
    37.- 48.	Input volume name, ASCII, padded with nulls
    49.- 52.	? null
    53.- 54.	? 1
    55.- 58.	Number of blocks on the input device, binary
    59.- 62.	Number of blocks in use on the device, binary
			(not including bad blocks)
    63.- 66.	Number of files in use on the device, binary
    67.- 68.	? 
    69.- 70.	? null
    71.- 72	? Number of blocks allocated to index file
    73.- 74	? 
    75.- 76.	? 
    77.- 78.	? 
    79.- 80.	?
    81.- 82.	?
    83.- 84	?
    85.-510.	? null
   511.-512.	checksum
 
Items marked with ? are items I have not identified.

V. DSC CODE 2 RECORDS
 
	One of these records preceeds each files-11 file on the DSC tape
 
	DSC header word 1 = 512
		   word 2 =   2
		   word 5 =   file number of the files-11 file
		   word 6 =   file sequence of the files-11 file.
 
	DSC data block, 512. bytes
		   words 1-3  the string BACKUP
		   word    5  The number of bytes in the name string
		   words 6..  The file name string, in the form
				DDU:[126,342]filename.ext;ver
			      the UIC 126,342 seems to be constant,regardless
			      of what the source or directory uic was.
 
		   word 46.   Number of blocks allocated to the file
		   word 52.   (same as word 46.)
		   word 67.   Owning UIC group number
		   word 68.   Owning UIC member number.
 
	There is some more information, but I have not determined what
it is, it was not necessary for restoring files.

VI. DSC FILES-11 HEADER RECORD
 
	One of these records immediately follows the DSC code 2 record
and contains:
 
	DSC header word 2 = 4  code for files-11 header record
		   word 5 = files-11 file number for this file
		   word 6 = files-11 file sequence number for this file.
 
	The data portion of the record contains the 512. byte files-11
header block for the file.  It is an exact image of the header as it was
on the disk, including the map area.

