Google
 

Trailing-Edge - PDP-10 Archives - BB-H348C-RM_1982 - swskit-v21/certification/nft-switch.mem
There are no other files named nft-switch.mem in the archive.


     Hi Dave.  I feel that two  major  areas  remain  to  be
documented  for  NFT/FAL.   First  is  general  file  format
concepts, and TOPS-20  specific  file  format  descriptions.
Second,  is  a  list of notes concerning the transformations
which take  place  when  files  move  between  heterogeneous
systems  (with  examples).   This memo covers only the first
topic.  I have more work to do before the  second  topic  is
ready.   Tony  C.   and  I have agreed that if I deliver the
notes for the second  topic  too  late,  they  will  not  be
included in the manual.



     The DECnet-20 SPD only specifies ASCII sequential  file
transfer.   However,  the  code exists to transfer all files
between  TOPS-20  systems,  and  some  non-ascii  files   to
non-TOPS-20  Digital systems.  This document describes those
unsupported features.

     The TOPS-20 File System

     The understanding of image mode file transfer  requires
an  understanding  of  the  file systems of the two machines
involved in the transfer.

     The TOPS-20 file system stores data  in  units  of  512
36-bit  words,  called pages.  Descriptive information about
the file is stored in a special  "header"  page  called  the
File  Descriptor Block (FDB).  Record formats and attributes
are not stored in the FDB!  Only the programs  which  access
the  file  know  whether  the  record  format  is undefined,
stream,  fixed,  variable,  VFC,  or  etc.   Only  accessing
programs  know  whether the items in a record are characters
(sixbit, ASCII, ebcdic, etc.) or fixed or floating numbers.

     The following information is however, kept in the  FDB:
BYTE SIZE and LENGTH IN BYTES.  This lack of knowledge about
the  file's  format  makes  heterogeneous   non-ASCII   file
transfer very complex.  When you read the NFT chapter of the
DECnet-20 manual you may notice that there are file switches
for  TOPS-20  files such as /VAR and /MACY11.  Most of these
formats are not native to TOPS-20, nor are they produced  or
read  by any TOPS-20 utility.  Following is a description of
each of these file formats.  These descriptions should allow
you  to  design  your  data transfer techniques to take full
advantage of the file transfer capabilities of DECnet.
                    TOPS-20 FILE FORMATS



     1.  NO FILE FORMAT SWITCHES ON EITHER FILE.

              If the file transfer is  TOPS-20  to  TOPS-20,
         the FDB and the entire file are copied in page size
         records.  All  FDB  information  is  retained,  and
                                                      Page 2


         files  with  holes  retain  the holes.  This is the
         most efficient homogeneous  file  transfer  format;
         the files are read and written with PMAPs.

              If the file transfer is not 20 to 20  and  the
         file's  byte size is 7 or 36 the data mode defaults
         to /ASCII, otherwise it defaults to /IMAGE.

     2.  

              TOPS-20 STREAM ASCII FILE FORMAT (/ASCII)

              Stream ascii files contain a continuous stream
         of  7  bit  ascii  characters.  Logical records are
         delimited by any of the following characters:  ESC,
         Z,  DC1,  DC2, DC3, DC4, DLE, FF, VT, LF.  The line
         numbers in  line  numbered  files  are  ignored  by
         NFT/FAL.   Nulls  are  stripped  by  NFT/FAL.  Both
         /ASCII/FIX:n and /ASCII/VARIABLE:n are processed as
         /ASCII except that records longer than n characters
         are split into two records.

     3.  

              TOPS-20 IMAGE FILE FORMAT (/IMAGE)

              Image  format  files  are  considered  to   be
         streams  of  bytes.   The bytes are all of the same
         size, from 1 to 36 bits.  There is  no  concept  of
         records or record lengths.

     4.  

              TOPS-20 MACY11 File Format (/MACY11)

              The MACY11 file format is the format of object
         files  produced  by  the  MACY11  and  DNMAC  cross
         assemblers.  An object file produced by MACY11  can
         be  copied  to an RSX11M or VMS system, task built,
         and run successfully.

              A MACY11 file is a 36-bit byte file containing
         variable  length  records  of the following format.
         Four bytes are stored in each 36-bit word:

         [<2 ZERO BITS><BYTE 2><BYTE  1><2  ZERO  BITS><BYTE
         4><BYTE 3>].
         
         Each record looks like this:
         Byte 0 <1>     sync byte
         Byte 1 <0>     null follows sync
         Byte 2 <cnt>   low order of (length of "Data" in bytes)+4=[n]
         Byte 3 <cnt>   high order of (length of "Data in bytes)+4=[n]
         Byte 4 <data>
         Byte n         (last byte of "Data")
                                                      Page 3


         Byte n+1       Checksum byte (Two's complement add with carry ignored)
                        Checksum includes all bytes in record including header
         
         6 Nulls followed by next record (The nulls are ignored)

     5.  

              TOPS-20 Variable  Length  Record  File  Format
         (/VARIABLE:n or /IMAGE/VARIABLE:n)

              A TOPS-20 variable length  file  suitable  for
         transfer  to  or  from  a  VMS  or RSX11M type file
         system consists of a sequence  of  variable  length
         8-bit  byte  records.   The first two bytes of each
         record contain the byte count of the  data  in  the
         remainder of the record (Low order byte first, high
         order byte second).  Four bytes are stored in  each
         36-bit word as follows:

         [<BYTE 1><BYTE 2><BYTE 3><BYTE 4><4 ZERO BITS>]

     6.  

              TOPS-20 MACY11  Variable  Length  Record  File
         Format (/MACY11/VAR:n)

              A TOPS-20 MACY11 variable length file consists
         of a sequence of variable length 8-bit byte records
         where each record starts on a  word  or  half  word
         boundary  and  the  first  two bytes of each record
         contain the count of the data in the  remainder  of
         the  record.   The  count  is stored low order byte
         first, high order  byte  second.   Four  bytes  are
         stored in each 36-bit word as follows:

         [<2 ZERO BITS><BYTE 2><BYTE  1><2  ZERO  BITS><BYTE
         4><BYTE 3>]

     7.  

              TOPS-20 MACY11 Fixed Length Record File Format
         (/MACY11/FIX:n)

              A TOPS-20  MACY11  fixed  length  record  file
         consists  of  a  sequence  of 8-bit bytes stored in
         36-bit words where the length  of  each  record  is
         arbitrary (remember that TOPS-20 does not store the
         record length anywhere!).  This is  the  format  of
         task  files  (.TSK)  produced  by  TKB20 (the fixed
         record size must be 512).  A task file produced  by
         TKB20  can be copied by NFT to an RSX11M system and
         run provided that PIP is used on the RSX11M  system
         to make the copied task file contiguous.
                                                      Page 4


              If the last record is only a record  fragment,
         then  different target systems may act differently.
         Refer to the discussion  for  each  target  system.
         Four  bytes  are  stored  in  each  36-bit  word as
         follows:

         [<2 ZERO BITS><BYTE 2><BYTE  1><2  ZERO  BITS><BYTE
         4><BYTE 3>]

     8.  

              TOPS-20  Fixed  Length  Record   File   Format
         (/FIX:n or /IMAGE/FIX:n)

              A  TOPS-20  fixed  length  file  suitable  for
         transfer  to  or  from  a  VMS  or RSX11M type file
         system consists  of  a  sequence  of  8-bit  bytes.
         Since TOPS-20 does not store the record size in the
         FDB, it can be considered to be any length.  If the
         last   record  is  only  a  record  fragment,  then
         different  target  systems  may  act   differently.
         Please refer to the section for each target system.
         Four bytes  are  stored  in  each  36-bit  word  as
         follows:

         [<BYTE 0><BYTE 1><BYTE 2><BYTE 3><4 ZERO BITS>]
                                                      Page 5


     This section provides examples  for  file  copies.   It
also  provides  the  defaults used for omitted record format
switches.

     TOPS-20 to and from TOPS-20 nodes.   Use  no  switches.
All files will be copied as they are.

COPY local-file-spec node::remote-file-spec

COPY node::remote-file-spec local-file-spec


     ASCII stream files on  TOPS-20  to  non-TOPS-20  nodes.
Use  no  switches.   The  file  format  defaults to the most
commonly used ascii file format for each remote node.  ASCII
stream  mode  is  used  for  RT, RSTS, TOPS-10, and TOPS-20.
ASCII in variable length records is used for RSX11S, RSX11M,
RSX11M+, IAS, and VMS.

COPY local-file-spec node::remote-file-spec


     ASCII files on non-TOPS-20 nodes to TOPS-20 node.   Use
no  switches.   If  NFT can convert the remote ascii file to
stream ascii on TOPS-20 it will, if not the copy will fail.

COPY node::remote-file-spec local-file-spec


     Binary files  between  TOPS-20  nodes  and  non-TOPS-20
nodes.  The user must understand what the format of the data
and the records are both at  the  source  node  and  at  the
destination node.  Some examples:

     1.  Object files produced by a  cross  assembler  on  a
         TOPS-20  node  (such  as  MACY11  or  DNMAC) can be
         copied to or from a VMS or RSX11M node as  follows:
         Refer to the description of the MACY11 switch for a
         description of the internal file formats.

         COPY                                PROG.OBJ/MACY11
         VAX::PROG.OBJ/IMAGE/VARIABLE:512


     2.  Task files produced by a cross system task  builder
         (such  as  TKB20) can be copied to or from a VMS or
         RSX11M node as follows:  Refer to  the  description
         of  the FIX and IMAGE switches for a description of
         the internal file formats.

         COPY                         PROG.TSK/FIX:512/IMAGE
         RSX11M::PROG.TSK/IMAGE/FIX:512
                                                      Page 6


     3.  Binary data can be stored  in  a  disk  file  on  a
         TOPS-20  node  in  a number of formats which can be
         sent to other systems.  In this example  a  fortran
         program  on  a  TOPS-20  node created a binary data
         file in which each word contains 4  left  justified
         eight  bit bytes.  The programmer wants to consider
         each group of 60 bytes to be a  record.   Refer  to
         the  description  of the switches for a description
         of the available internal file formats.

         COPY                          DATA.DAT/IMAGE/FIX:60
         VMS::DATA.DAT/IMAGE/FIX:60



     When a file is copied from a remote node to  the  local
TOPS-20   node,   the   remote   node  sends  the  following
information  about  the  file.   ASCII  or  IMAGE.    FIXED,
VARIABLE,  UNDEFINED,  or  SEQUENCED  (Variable  with  Fixed
Control,  VFC).   RECORD  LENGTH.   CRLF,  FORTRAN  CARRIAGE
CONTROL, PRINT FILE, MACY11 FORMAT, NO CARRIAGE CONTROL.  If
you specify switches NFT will try  to  use  the  format  you
specify.   If  you  leave out switches (or in those cases in
which there are no switches such as  VFC  files  or  fortran
carriage  control)  NFT  will  choose a default mode.  Files
with certain  combinations  of  the  above  file  attributes
cannot be converted by NFT.  

     If you leave out switches when copying file from remote
non-TOPS-20  node  to  local TOPS-20 node (or in those cases
for which there are no  switches),  the  following  defaults
apply.  

REMOTE FILE ATTRIBUTES  DEFAULT MODE ON 20      NOTES
------ ---- ----------  ------- ---- -- --      -----
STREAM ASCII            ASCII
UNDEFINED ASCII         ASCII
UNDEFINED IMAGE         IMAGE
UNDEFINED IMAGE MACY11  MACY11 IMAGE
FIXED IMAGE MACY11      MACY11 FIXED
VARIABLE IMAGE MACY11   MACY11 VARIABLE
STREAM IMAGE MACY11     MACY11
FIXED ASCII             ASCII
FIXED ASCII CRLF        ASCII
VARIABLE ASCII          ASCII           NORMAL VMS AND RSX ASCII
VARIABLE ASCII CRLF     ASCII
FIXED IMAGE             FIXED IMAGE     VMS AND RSX TASK FILES
VARIABLE IMAGE          VARIABLE IMAGE  VMS AND RSX OBJECT FILES
FIXED IMAGE CRLF        ASCII
VARIABLE IMAGE CRLF     ASCII
IMAGE VFC PRINT FILE    ASCII           VMS BATCH LOG FILES
IMAGE VFC CRLF          ASCII           SOS LINE NUMBERED FILES
ASCII VFC PRINT FILE    ASCII           VMS BATCH LOG FILES
ASCII VFC CRLF          ASCII           SOS LINE NUMBERED FILES
IMAGE STREAM            ASCII           ASCII STREAM FROM RSTS
                                                      Page 7


ASCII FIXED FORT CC     ASCII
IMAGE FIXED FORT CC     ASCII
IMAGE VAR FORT CC       ASCII
ASCII VAR FORT CC       ASCII

Files with fortran carriage control leave the fortran carriage control
byte as the first byte of each data record. A carriage return line feed
is appended to the end of every record.


     As  a  recap:   files  are  formatted  differently   on
different systems.  NFT/FAL does the following:

     1.  Copy any kind of file from 20 to 20, if no switches
         are used.

     2.  Copy ascii files from 20 to other systems using the
         most  common  ascii  file  format on that system if
         switches are omitted.

     3.  copy ascii files from  other  systems  to  20s,  if
         possible, if switches are omitted.

     4.  If switches are specified, the appropriate  formats
         will be used.

     5.  There are some files which cannot be copied between
         systems.   There  are some format conversions which
         cannot be done.  Using NFT on the 20  gives  you  a
         great deal of format conversion capabilitiy.  Using
         the NFT equivalent on another system to copy  files
         to  and  from  a  20  does  not  provide  the  same
         capabilities.  For example, no binary files of  any
         sort can be copied from a vms or RSX systems to the
         20 if you use the NFT equivalent from  the  VMS  or
         RSX nodes.