Emulation of Multics Standard Tapes |
-proposal- |
| Introduction: The development of mainframe emulators on PCs encouraged the development of formats for emulating tape devices on disk, CD-Rom, etc. One of the first formats was AWS, introduced with the XT-370, which emulated IBM 3420 9-track tape devices. AWS allows for recording of tapemarks, segmenting of large blocks, and forward and backward reading. A recent extension to the AWS standard adds support for individual block compression and larger data sements (up to 64K). [NOTE: At this time there are competing proposals for indicating compressed blocks. This proposal uses the most widely used.]
Multics Standard Tapes: [This standard uses the term "block", rather than "record" to describe the data on the tape since each block is the result of a single physical write operation. The term "segment" is used to describe the basic unit of I/O also known as a "chunk".]The Multics Standard Tape format, a "checksummed, labeled, headered, trailered, fixed-length-record tape format with periodic tape marks" is a standard defining all "native" tapes used on Multics systems. Key features are a fixed-length block including a header and trailer on each block, and tape marks every 128 blocks to facilitate repositioning and recovery. The standard defines the size of a block as a modulo 1024-word (36864-bit) data space, plus sixteen words (576 bits) of control information. An earlier standard specified a 256-word data space. All blocks on a tape are the same length. Physically, two words are written as 9 eight-bit bytes ("frames") on tape. A block with a 1024-word data space has a length of 4680 bytes. The MST format description provides detail on the contents of an MST.
MST Emulation:
The length fields are stored in little-endian (Intel) format. The first segment header on the "tape" has prvblkl=0. A tapemark (EOF segment) has curblkl=0, and the second of two EOF segments in a row has both curblkl and prvblkl=0. An emulated MST is always terminated by two EOF segments.
Capacity:
MST Format: The organization of data on an MST is:
Label block
TAPEMARK
Data block 0
...
Data Block 127
TAPEMARK
Data Block 128
...
TAPEMARK
EOR block
TAPEMARK
TAPEMARK
The data recorded on the tape is written in binary mode. It should be
interpreted as two 36-bit words per nine eight-bit bytes. The data itself
may be binary (machine instructions, etc.) or ASCII, recorded as four ASCII
characters per word, each character right-adjusted in 9 bits.
Label blocks are differentiated from data blocks by bits in the block header. Information contained in header and trailer blocks indicates the sequence number of this file on a reel, and/or of this reel in a multi-volume set.
The following are definitions of bootable and non-bootable MST label blocks for 32-bit
systems. All character(n) fields have been changed to bit(n*9).
To convert character fields to ASCII the bit field must
be unpacked by extracting the last eight of every nine bits.
All fixed binary(n) fields have been changed to
bit(n+1); if the data may be signed special handling is required.
|
References:
|
Procedure to compute checksum:
See Multics Programmer's Reference Manual
(AG91-04),
p.F-10 for checksum computation.
This procedure is a PL/I transliteration of the ALM code provided there.
/*-------------------------------------------------------*/
/* Validate Checksum of Multics Standard Tape Block */
/* on 32-bit system. */
/* Called with: addresses of MST header and trailer */
/* Returns: '0'b if checksum error; '1'b if no error. */
/*-------------------------------------------------------*/
checksum: proc(pHdr,pTrlr) returns( bit(1) );
dcl (pHdr,pTrlr) ptr;
dcl 1 block_bin aligned based,
5 block_wrd (0:1039)bit(36) unaligned;
dcl i fixed bin(31);
dcl checksum bit(36);
dcl this_word bit(36);
dcl carry bit(1);
checksum, carry = '0'b;
do i=0 to 5, 7;
this_word = pHdr->block_wrd(i);
call awca(checksum,this_word,carry);
call alr( checksum );
end; /* do i */
do i=0 to 7;
this_word = pTrlr->block_wrd(i);
call awca(checksum,this_word,carry);
call alr( checksum );
end; /* do i */
this_word='0'b;
call awca(checksum,this_word,carry);
call awca(checksum,this_word,carry);
this_word = pHdr->block_wrd(6); /* Get checksum word */
if this_word ¬= checksum then do;
return( '0'b ); /* Error return */
end;
return( '1'b); /* Normal return */
awca: proc(sum,n,carry);
dcl sum bit(36);
dcl n bit(36);
dcl carry bit(1);
dcl b (9)bit(4) based;
dcl i fixed bin(31);
dcl tmp fixed bin(31);
dcl bits (0:15)bit(4) static init(
'0000'b, '0001'b, '0010'b, '0011'b, '0100'b, '0101'b, '0110'b, '0111'b,
'1000'b, '1001'b, '1010'b, '1011'b, '1100'b, '1101'b, '1110'b, '1111'b
);
do i=9 to 1 by -1;
tmp = addr(sum)->b(i) + addr(n)->b(i) + carry;
carry = '0'b;
if tmp>15 then do;
tmp=tmp-16;
carry='1'b;
end;
addr(sum)->b(i) = bits(tmp);
end; /* do i */
end awca;
alr: proc(word);
dcl word bit(36);
word = substr(word,2,35) || substr(word,1,1);
end alr;
end checksum;
E-Mail comments on this proposal to:
Peter Flass <Peter_Flass@Yahoo.com>
Revised 2 Feb, 2005
Change references to HET format to "Compresed AWS", add checksum procedure.