home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d5xx / d558 / btntape.lha / BTNtape / tape.doc < prev    next >
Text File  |  1991-10-28  |  36KB  |  761 lines

  1. ****    BTNtape:  an AmigaDOS handler for SCSI tape drives
  2. ****       Version 2.1  10/22/91
  3. ****       Freeware by Bob Rethemeyer   (DrBob@cup.portal.com)
  4. ****
  5. ****    (c) Copyright 1990, 1991  Robert Rethemeyer.
  6. ****      This software may be freely distributed and redistributed,
  7. ****      for non-commercial purposes, provided this notice is included.
  8. ****      All original files must be included in the distribution.
  9.  
  10. BTNtape is a "Better Than Nothing" SCSI tape device handler.  It provides
  11. flat-file access to a SCSI tape drive from application programs using
  12. simple DOS calls to Read() and Write().  It can also be used with the Amiga
  13. TAR utility for disk backups.  It requires a "SCSI-direct" compatible
  14. SCSI bus adapter.  This is version 2.1, update to version 2.0.  It fixes
  15. a number of bugs, and includes a few new features, including the ability
  16. to append files to a tape.
  17.  
  18. Some advantages of BTN over other handlers and dedicated tape backup programs:
  19.   * Includes a monitor program that keeps you informed of what's happening
  20.   * Supports many standard SCSI tape drives and Amiga SCSI bus adapters
  21.   * Supports the 3M MCD-40, a non-standard SCSI tape drive
  22.   * Supports any size of tape block, and multiple-block operations
  23.   * Supports tape files that span multiple tape volumes (sometimes)
  24.   * Double buffering improves streaming performance
  25.   * Includes an interface to send SCSI control commands to the drive
  26.   * Includes an interface to set drive-specific Mode Select parameters
  27.   * TAR tapes can be exchanged with Un*x systems
  28.   * DOS compatibility for use with any program. e.g. data logging applications
  29.  
  30. =================== ******> R E A D   T H I S <****** ======================
  31.  
  32. DISCLAIMER:
  33.  "This software is provided 'as-is', without warranty of any kind,
  34. either expressed or implied.  In no event will I, Robert Rethemeyer,
  35. be liable for direct, indirect, incidental or consequential damages or
  36. data loss resulting from the use or application of this software.  The entire
  37. risk as to the results and performance of this software is assumed by you."
  38.  
  39. I cannot guarantee that this software is compatible with any combinations
  40. of drives or adapters other than those I have specifically tested.
  41.  
  42. If you do not agree with this disclaimer,  I recommend you not use this
  43. software;  buy commercial tape software instead.
  44.  
  45. ============================================================================
  46.  
  47. Because commercial tape backup software is now available, the only reasons
  48. you might still want to use BTNtape would be:
  49.    * Compatibility with TAR for transporting tapes between Amiga and Un*x
  50.    * Compatibility with AmigaDOS for data logging or special applications
  51.    * You don't want to spend any money.
  52.  
  53. I claim only that this handler works with the Amiga TAR program ported by
  54. Jonathan Hue.  It might work with some recent backup programs that allow
  55. backup to a DOS file, but won't work with any that backup to Exec devices.
  56. If you don't want to use commercial tape software, you might find this
  57. handler to be "better than nothing".
  58.  
  59. I will try to provide support for this handler, especially for bug fixes,
  60. as my time and resources allow.  But I cannot commit to adding all the
  61. enhancements or special features requested by users.  If you have something
  62. in mind, ask, but I can't guarantee anything.
  63.  
  64. If you modify BTN, please do not publicly distribute the modified version
  65. without contacting the author.
  66.  
  67. Although the documentation refers to alleged problems with some
  68. manufacturers' software/hardware, that should not be construed as a statement
  69. about the quality of their products.  In fact, there is still a possibility
  70. that the problems may be in my handler software or the equipment I used.
  71.  
  72. ==============================================================================
  73.  
  74. DISTRIBUTION:
  75.  
  76.   The distribution should contain the following files:
  77.     btn-handler           handler binary
  78.     tapemon               monitor binary
  79.     tape.doc              you're reading it
  80.     tapemon.doc           documentation for the monitor program
  81.     changes.doc           a brief history of BTNtape
  82.     mess.doc              explanations of handler messages
  83.     usernotes.doc         information about certain hardware
  84.     mountlist             example mountlist entry
  85.     tape.rexx             an ARexx script to issue tape control commands
  86.     src                   directory
  87.       tape.c                source for main handler
  88.       tapeio.c              source for interface to SCSI-direct
  89.       pktstuff.c            source for packet handling, by Phillip Lindsay
  90.       tape.h                local include file
  91.       tplink.h              local include file for handler/monitor structure
  92.       lmkfile               SAS/Lattice make file for handler
  93.       makefile              Manx make file for handler
  94.       tapemon.c             monitor source
  95.       tapemon.lmk           SAS/Lattice make file for tapemon
  96.  
  97.  
  98. COMPATIBILITY:
  99.  
  100.   You must have a SCSI adapter and software that honors the SCSI-direct
  101.   protocol as defined in the "devices/scsidisk.h" include file.  The list
  102.   below shows the manufacturers I know about that support SCSI-direct
  103.   (but this list I'm sure is incomplete).
  104.  
  105.   This handler has been tested on the following equipment (but not in
  106.   all the combinations):
  107.  
  108.     SCSI adapters:
  109.       * Commodore A2091
  110.       * Commodore A590
  111.       * Commodore A3000 (built-in), including AmigaDOS 2.0
  112.       * GVP Series II
  113.       * HardFrame
  114.       * Nexus
  115.       * Commodore 2090A- see usernotes.doc file.
  116.       * Supra (all types) see usernotes.doc file.
  117.       * Original Trumpcard- with 2.0F software, 4.0 ROMs, Interrupt 2 jumper.
  118.       * Trumpcard Pro
  119.       * Xetec
  120.  
  121.     Tape drives:
  122.       * Commodore A3070 (Caliper CP150)
  123.       * Archive 2150S (Viper)
  124.       * Wangtek 5150ES
  125.       * Teac MT-2ST Cassette
  126.       * Emulex MT-02 SCSI/QIC-36 tape adapter
  127.       * Exabyte EXB-8200/8500 8mm Cartridge Tape Subsystem
  128.       * DEC TK50
  129.       * 3M MCD-40 direct access 40MB cartridge tape drive
  130.       * Jasmine DT40 direct access drive (Braemar, 3M derivative?)
  131.       * TallGrass direct access drive (model unknown, 3M derivative?)
  132.  
  133.   Even if your hardware is not listed here, there is a good chance it
  134.   will still work if it adheres to the standards (SCSI-direct and SCSI).
  135.   The handler treats a drive as one of two types: sequential or direct access.
  136.   The most common type is sequential.  The handler will adjust itself
  137.   for either type.  If you get it to work with some drive model I haven't
  138.   mentioned here, I would like to hear about it.
  139.  
  140.  
  141. THE MONITOR PROGRAM
  142.  
  143.      Included in with the handler is the TAPEMON program.  TAPEMON is
  144.      a program that runs under a separate CLI and prints one-liner
  145.      messages from the handler.  The messages include the current
  146.      tape operation and block number, and error and sense codes.
  147.      The handler will run with or without TAPEMON; i.e. TAPEMON is optional.
  148.      TAPEMON must be started up AFTER the handler is mounted and activated.
  149.      Read TAPEMON.DOC for more information.
  150.  
  151.  
  152. INSTALLATION:
  153.  
  154.   1.  Copy the BTN-HANDLER file to L:BTN-HANDLER.
  155.       Copy the TAPEMON program to C: or a directory appropriate for you.
  156.  
  157.   2.  Create an entry in DEVS:MOUNTLIST something like this:
  158.  
  159.        TAPE: Handler = L:btn-handler
  160.              Priority = 5         /* use 11 for Supra 1.10 */
  161.              Stacksize = 4000
  162.              Mount = 1            /* optional */
  163.              GlobVec = -1
  164.              Startup = "yourscsi.device/AA-x/BB-x/..." /* EXPLAINED BELOW */
  165.         #
  166.  
  167.       There is nothing magic about the name TAPE:   You may use some
  168.       other valid device name if you like.
  169.  
  170.   3.  Install the handler in DOS using the CLI command "MOUNT TAPE:"
  171.       *WARNING*  Do not use the ARP version of MOUNT !!
  172.       ARP's MOUNT inexplicably truncates the Startup string to 40 bytes.
  173.       You MUST use the Commodore version of MOUNT.  To tell the difference,
  174.       ARP 1.3 MOUNT is 2372 bytes long, and CBM MOUNT (1.3.2) is 5604 bytes.
  175.       No need to completely abandon ARP- you can still use the CBM MOUNT.
  176.       Just give the two MOUNT commands different names in your C: directory.
  177.  
  178.       If you get a write-protected or replace-volume requester, click cancel.
  179.  
  180.       If there is a problem during mounting, BTN will put up a requester with
  181.       one of the following brief explanatory messages:
  182.  
  183.           "Insufficient memory"      - severe memory shortage
  184.           "Can't open SCSI-direct"   - OpenDevice("yourscsi.device") failed
  185.           "Can't select tape drive"  - drive, SCSI bus, or adapter problem
  186.           "UNit is not a tape drive" - UN is wrong; probably your disk drive
  187.  
  188.       Once you click the requester, BTN will terminate. You can then remedy
  189.       the problem, use the ASSIGN command with REMOVE or DISMOUNT to get
  190.       rid of the dead device, and try again.
  191.  
  192.  
  193. THE STARTUP PARAMETER
  194.  
  195.       The mountlist Startup parameter is used by the handler to determine how
  196.       to access your drive.  FAILURE TO ENTER PROPER INFORMATION IN STARTUP
  197.       MAY RESULT IN PROBLEMS INCLUDING HANGS, VISITS FROM THE GURU,
  198.       OR DATA LOSS.  This is the messiest part of setting up.  Pay attention.
  199.  
  200.       The Startup string must be in the form:
  201.  
  202.                Startup = "devicename/keyword-number/keyword-number/..."
  203.  
  204.       It must not have any embedded blanks and must be enclosed in quotes.
  205.       The pieces must be separated by slashes.
  206.  
  207.       The first parameter must be the name of the device driver which provides
  208.       the SCSI-direct command interface. Do not include any path information.
  209.       This name is defined by the manufacturer of your SCSI adapter.
  210.       If you don't know what it is, use a utility like XOPER, TASKX, or ARTM
  211.       to look at the list of running tasks, and make a guess.
  212.       You must use the exact same upper and lower case letters (this is a DOS
  213.       restriction).  The names for the adapters I know about are:
  214.  
  215.         A3000,A2091,A590 -> scsi.device
  216.         A2090A           -> hddisk.device
  217.         Supra            -> supradirect.device (driver Series II v1.10 only)
  218.                      or  -> suprascsi.device   (Series III v3.0 and above)
  219.         GVP              -> gvpscsi.device
  220.         HardFrame        -> HardFrame.device
  221.         Nexus            -> Nexus.device  (NOT NexusTape.device!)
  222.         Trumpcard        -> IVS_SCSI.device
  223.         Trumpcard Pro    -> IVS_SCSIpro.device
  224.         ICD Advantage    -> icddisk.device
  225.         Xetec            -> harddisk.device
  226.  
  227.       The name parameter MUST be the first item in the string.  All other
  228.       parameters may be in any order, but the name must be first.
  229.  
  230.       The remaining items consist of pairs of two-letter keywords and a number
  231.       separated by a dash (minus sign).  The keywords are explained below.
  232.       You may omit any of them (except UNit), and a default value will be
  233.       assumed.  The numbers may be decimal, or hex in the "0xNN" format.
  234.  
  235.       UNIT     Keyword: UN    Default: none
  236.       -------------------------------------
  237.         The unit number of your tape drive, as it will be
  238.         addressed by your hard disk driver.  Usually you can
  239.         just specify the SCSI bus ID, example: "UN-0" for 0.
  240.         More complex setups may require the form "UN-0xBLI",
  241.         where B=board#, L=logical unit#, I=SCSI bus ID.
  242.         Be sure you have set the drive ID switches or jumpers
  243.         to a value that is unique on the SCSI bus.
  244.         (2090A owners- add 3 to the ID number.)
  245.  
  246.              (LOGICAL UNIT   Keyword: LU    DELETED!!)
  247.               -------------------------------------------
  248.               The old LU parameter has been DELETED from BTN 2.1.
  249.               You now specify the logical unit in the middle hex digit
  250.               of the UN parameter.  Most drives are hardwired
  251.               for 0, so it won't matter to most users.
  252.  
  253.       BLOCK SIZE     Keyword: BS    Default: BS-512
  254.       ---------------------------------------------
  255.         The number of bytes in a SCSI logical block for
  256.         your tape drive.  Consult your drive documentation.
  257.         If you don't know this info, try 512, the most common value.
  258.         (See the 3m.doc file for the values to use with 3M drives.)
  259.         Some drives (but not many) allow you to specify different
  260.         block sizes, within a legal range;  the handler will
  261.         command the drive to use the size you specify.
  262.         Others can use only one fixed size.  If you can vary
  263.         the block size, you must use the same size when reading
  264.         a tape as you did when writing it.
  265.  
  266.       NUMBER OF BLOCKS  Keyword: NB    Default: NB-1
  267.       ----------------------------------------------
  268.         The number of SCSI logical blocks to write
  269.         or read in each tape operation.  This is
  270.         a performance adjustment only.  Use what works
  271.         best for you.  See more below.
  272.  
  273.       BUFMEMTYPE   Keyword: BT    Default: BT-0
  274.       -----------------------------------------
  275.         The type of memory to allocate for the tape
  276.         buffers, same as BufMemType for mountlists.  Use
  277.         0 or 1 for "any", 2 or 3 for "chip", 4 or 5 for "fast".
  278.  
  279.       FILEMARKS    Keyword: FM    Default: FM-1
  280.       -----------------------------------------
  281.         Specifies number of file marks to write when
  282.         closing at the end of a write, or the number to skip
  283.         for each file when opening for read.  FM-1 recommended.
  284.         FM-0 means no file marks are written, and read references
  285.         to TAPE:num become the equivalent to TAPE:R.
  286.         Allowed range is 0-255.  Sequential drives only.
  287.  
  288.       RETENSION    Keyword: RT    Default: RT-0
  289.       -----------------------------------------
  290.         If RT-1 is specified, the handler will retension the tape
  291.         (run to the end of the tape and back) on the first access
  292.         after a new tape is inserted (indicated by Unit Attention
  293.         status).  Specify RT-0 (or omit it) if your drive already
  294.         does this automatically, or does not support the necessary
  295.         SCSI command, or if you don't want it.
  296.         *Note*  Some SCSI adapters, such as GVP and IVS, will
  297.         periodically poll the drive for readiness, which has the effect
  298.         of losing the the Unit Attention status.  A clue: the light
  299.         on the drive may blink every few seconds.   For such
  300.         adapters, the RT function will not work.  Ask the adapter
  301.         manufacturer for a software update to fix this problem,
  302.         or manually issue the retension command (see tape.rexx).
  303.  
  304.       VARIABLE BLOCK FLAG    Keyword: VB    Default: VB-0
  305.       ---------------------------------------------------
  306.         The handler normally operates sequential
  307.         drives in fixed block mode.  Specifying VB-1 will force
  308.         operation in variable block mode instead.  Use this
  309.         if your drive does not support fixed block mode or
  310.         you for some reason need variable block mode.
  311.         (warning: this function is untested, and may change in
  312.         a future version)
  313.  
  314.       RESERVED BLOCKS   Keyword: RB    Default: RB-0
  315.       ----------------------------------------------
  316.         For direct access drives only.  Specifies how
  317.         many blocks to skip at the beginning of the tape.
  318.  
  319.       OVERLAPPED I/O FLAG    Keyword: OV    Default: OV-1
  320.       ---------------------------------------------------
  321.         The handler normally (OV-1) attempts to overlap
  322.         tape drive I/O and DOS I/O to maximize throughput.
  323.         Specifying OV-0 disables overlapping and double buffering,
  324.         for systems that can't walk and chew gum at the same time.
  325.  
  326.       DEVICE FLAGS   Keyword: DF    Default: DF-0
  327.       -------------------------------------------
  328.         Equivalent to the Flags parameter in mountlists.
  329.         It is passed in the OpenDevice() call to open the SCSI-
  330.         direct driver. If you don't already know what you would use
  331.         this parameter for, then you probably don't need it.
  332.  
  333.       NO-REWIND FLAG   Keyword: NR    Default: NR-0
  334.       ---------------------------------------------
  335.         Controls rewinding behavior when referencing TAPE: .
  336.         Set this parameter according to your personal preference.
  337.         If NR-0, TAPE: is equivalent to TAPE:R  (same as v2.0).
  338.         If NR-1, TAPE: is equivalent to TAPE:NR.  See below.
  339.  
  340.       SUPRA FLAG   Keyword: SU    Default: SU-0
  341.       -----------------------------------------
  342.         Activates the circumvention for Supra Series II
  343.         v1.10 driver problem.  Specify SU-1 to activate this.
  344.         See "usernotes".  Do NOT use this with the Series III driver.
  345.  
  346.       CBM 2090A FLAG   Keyword: C9    Default: C9-0
  347.       ---------------------------------------------
  348.         Activates the circumvention for the Commodore
  349.         2090A problem.  Specify C9-1 to activate this. See "usernotes".
  350.  
  351.  
  352.       Here are some examples of valid Startup strings:
  353.  
  354.        Startup = "scsi.device/UN-7"   /* the minimum info required */
  355.        Startup = "gvpscsi.device/BS-0x400/NB-16/UN-0x102/RT-1"
  356.        Startup = "supradirect.device/un-4/bs-8192/nb-8/bt-1/su-1"
  357.  
  358.       A note about the NB parameter:  Most drives will be mechanically more
  359.       efficient writing multiple blocks.  You may want to tweak this
  360.       parameter to find out.  The handler will wait until NB blocks have been
  361.       accumulated before starting a write.   Buffered drives may also have a
  362.       limit on the number of blocks they can hold at once, so the size of NB
  363.       relative to that number may have an effect.  Consult your drive docs.
  364.       This parameter also determines how much memory is needed for
  365.       buffers.  The handler uses double buffering, so it will need
  366.       2 * BS * NB bytes when you Open() it.
  367.       For example, if BS=8192 and NB=8, then 8192*8 = 64K,
  368.       for a total of 128K.
  369.  
  370.  
  371. TAPE FILE NAMES
  372.  
  373.      BTN is compatible with AmigaDOS because you can use the name
  374.      "TAPE:" in most instances where a file or path name is required.
  375.      You CANNOT refer to files on the tape as "TAPE:filename", because
  376.      BTN does not support a file system.  But BTN does use some
  377.      characters to the right of the colon to determine access modes.
  378.  
  379.      Refer to the tape with one of the following file name forms:
  380.  
  381.      TAPE:R    Rewinds and opens the tape at the first available block.
  382.  
  383.      TAPE:NR   Opens the tape at the current position, without rewinding.
  384.      TAPE:*    Same as TAPE:NR (but doesn't work with some shells or commands)
  385.  
  386.      TAPE:     Same as TAPE:R or TAPE:NR, depending on NR startup parameter.
  387.  
  388.      TAPE:APP  Opens the tape after the end of the last-written file, to
  389.         allow you to append a file to a tape with existing files.
  390.         This mode is allowed only for writes on sequential drives.
  391.         Some drives do not support this function;  in that case, BTN
  392.         will resort to a slower method which searches for a blank spot.
  393.  
  394.      TAPE:num  Opens the tape at the position specified by the number.
  395.         For sequential drives, the number indicates the file position,
  396.         and may be used only for reading data from the tape (no writes).
  397.         The 0th file is at the beginning of the tape, file 1 follows it,
  398.         etc.  You can only read files that have been previously written.
  399.         Files are separated by one or more filemarks (automatically written
  400.         at the end of a write).  For direct access drives, the number
  401.         specifies an absolute SCSI block number on the tape.  You should
  402.         remember (write down) the first and last block number of each
  403.         file on the tape, as reported by TAPEMON.
  404.  
  405.      TAPE:RAWCMD   A special mode for issuing a raw SCSI command, not for
  406.         accessing the tape medium.  See "RAW COMMAND INTERFACE" below.
  407.  
  408.      TAPE:MODESEL  A special mode for writing mode-select data, not for
  409.         accessing the tape medium.  See "USER-SPECIFIED MODE SELECT" below.
  410.  
  411.  
  412. HOW TO ACCESS TAPE DATA
  413.  
  414.      Now that the handler is installed, how do you talk to it?
  415.      You can use TAR, or your own application program, including ARexx.
  416.      You can write data to the tape and later read it back in a manner
  417.      similar to other files, using DOS calls to Open, Read, Write, Seek,
  418.      and Close.  You may even copy single files to and from the tape using a
  419.      CLI COPY command:  "COPY filename TAPE:"  and   "COPY TAPE: filename"
  420.  
  421.      The handler makes the tape data look like a sequential AmigaDOS file.
  422.      THERE IS NO FILE SYSTEM on the tape, but you may place multiple files
  423.      on a tape by appending new files after the last-written file.
  424.      The handler does not support mixed reads and writes.  That is, you may
  425.      do only Reads or only Writes, but not both.
  426.  
  427.      BTN 2.1 now supports Seek(), with the following restrictions:
  428.         * Must be in fixed block mode (VB-0)
  429.         * Must be opened for Read()s,
  430.         * Seeks relative to end-of-file are not allowed
  431.         * Seeks relative to current-position or beginning-of-file are
  432.            allowed provided that the net position change is:
  433.                - forward from the current position
  434.                - backward to the exact beginning of the file only,
  435.                   except if opened as TAPE:NR
  436.  
  437.      Tape data is written in quantities of "NB*BS" bytes.  No information
  438.      about the exact length of the file is written.  If a tape file
  439.      ends before filling a block, the remainder of the block is filled with
  440.      zeroes.  Therefore, any program reading the tape must know when to
  441.      stop reading data, otherwise it will read extraneous zeroes past the
  442.      true end of the file.  This is especially true of the CLI "COPY" command.
  443.      TAR works because it essentially writes and interprets the tape data
  444.      as its own little file system that includes the length of each file.
  445.  
  446.      When a tape file is closed in write mode, one or more filemarks
  447.      (as determined by "FM") are written at the end of the file to
  448.      delineate the file from subsequent files. (Sequential drives only).
  449.  
  450.      If there is no tape in the drive at the time TAPE: is
  451.      opened, DOS will put up a requester asking for volume "TAPE"
  452.      "in any drive".  Insert the tape (in the tape drive, not
  453.      a floppy drive :-)  and click on retry after tape motion stops.
  454.  
  455.  
  456. A QUICK FUNCTIONALITY TEST
  457.  
  458.      Before jumping into disk backups and restores, try the following
  459.      simple test to see if your setup is basically working.
  460.      Write a large ASCII text file, such as TAPE.DOC, to the tape
  461.      and see if you can read it back intact.  This can be done with the
  462.      CLI TYPE command:
  463.  
  464.              TYPE tape.doc TO TAPE:     ; writes the file to tape
  465.      then... TYPE TAPE:                 ; reads the file back
  466.  
  467.      The second TYPE should legibly print the ASCII file on your screen.
  468.      (If using a direct access drive, there is no filemark to signify
  469.      the end of the file, so use control-C to abort the second TYPE).
  470.  
  471.  
  472. USING TAR FOR BACKUPS AND RESTORES
  473.  
  474.      For backups, I recommend the version of TAR ported by Jonathan Hue.
  475.      It is available on Fish Disk 445 or various online sources.
  476.      It is 33860 bytes long.   Each TAR archive is written to the tape
  477.      as a single file, terminated by a file mark (on sequential drives).
  478.      NOTE: the version of TAR distributed with Amiga UUCP apparently
  479.      does NOT work with BTNtape.  I don't know why.   Other similar
  480.      programs, like PAX, may also work, but I haven't tried them.
  481.  
  482.      TAR will backup all directories, files, and subdirectories in the
  483.      directory you specify, including the date, protection, and filenote
  484.      attributes.  The easiest way to do a backup is to CD to the desired
  485.      directory or partition (e.g. "cd DH0:"), then...
  486.  
  487.      To make a backup archive with TAR  :   tar -cvf tape: ""
  488.          (note the null string)
  489.      To add another at current position :   tar -cvf tape:* ""
  490.      To add another after last archive  :   tar -cvf tape:app ""
  491.      To restore files from archive      :   tar -xvf tape: *
  492.      To restore a specific file         :   tar -xvf tape: path/filename
  493.      To restore from archive at file 6  :   tar -xvf tape:6 *
  494.      To list the archive on the tape    :   tar -tvf tape:
  495.       (this also tests archive integrity)
  496.      To make an archive log             :   tar >logfile -tvf tape:
  497.      To look at raw tape data           :   type tape: opt h  ... cntl-C
  498.  
  499.      TAR can also make backups using a list of files from another file.
  500.      When you restore an individual file from an archive, provide the
  501.      exact path and file name;  these names are case sensitive.
  502.      Refer to the TAR documentation for more information.
  503.  
  504.  
  505. END-OF-TAPE HANDLING
  506.  
  507.      If the application reaches the end of the tape, the handler will put up
  508.      a requester asking you to insert the next tape and click "Continue",
  509.      or click "Abort".  The continue option allows the application program
  510.      to access a file across multiple tape volumes without interruption.
  511.      WAIT FOR TAPE MOTION TO STOP on the new tape before clicking Continue.
  512.      If you click Abort, end-of-file is returned to the application,
  513.      and any unused data in the buffers is discarded.
  514.  
  515.    *IMPORTANT NOTES*
  516.  
  517.      *  EOT handling may not work correctly on all drives.  Test it before
  518.      trusting your data to it.  Read the archive back using the -t option
  519.      of TAR.  If TAR hiccups on a file after the tape swap, it doesn't work.
  520.      You can backup partitions or directories smaller than the tape capacity
  521.      to avoid this situation.
  522.  
  523.      *  EOT handling is invoked when any of the blocks in the group of "NB"
  524.      blocks gets an EOM or Volume Overflow error.  When you click Continue,
  525.      the entire group of blocks is rewritten/reread on the new tape.
  526.      Therefore, to use the multiple-volume capability of the handler, you must
  527.      use the same blocking factor (value of NB) when reading the tape as
  528.      when it was written.
  529.  
  530.      *  EOT handling for the 3M drives will work only if the ROM version
  531.      supports the READ_CAPACITY SCSI command.  If you see no "Capacity"
  532.      message from TAPEMON, then EOT handling is unavailable.
  533.  
  534.      *  There was a bug in BTN v2.0 which miscalculated the last block
  535.      for handling EOT on 3M drives.  The bug has been fixed in v2.1,
  536.      but a side effect will be that EOT may not be detected correctly when
  537.      using v2.1 to read a tape written by v2.0.  If you have multi-volume
  538.      tapes written by v2.0 on a 3M, either rewrite your tapes using v2.1,
  539.      or keep a copy of v2.0 around.
  540.  
  541.  
  542. ERROR HANDLING
  543.  
  544.      This tape handler does not deal with tape errors.  If the
  545.      drive detects a medium error, the current operation will be aborted
  546.      by returning -1 for Read() or Write().  Some drives insulate the
  547.      user from bad blocks by automatically correcting them or remapping
  548.      to a good block, but other drives may not do this.
  549.  
  550.  
  551. HELPFUL HINTS:
  552.  
  553.      Label your tapes.  Include the file number or block number
  554.      of each file on a multi-file tape.
  555.  
  556.      Try backing up and restoring a floppy before doing the
  557.      same with your hard drive, to make sure the process works for you.
  558.      For the same reason, make a HD backup to floppies first.  Then
  559.      if the tape restore fails, you have something to fall back on.
  560.  
  561.      This is obvious, right?  Make sure you have a copy of the handler and
  562.      TAR on an easily-accessible floppy.  If the only copy you have is
  563.      on your hard drive, you might find it difficult to restore
  564.      from a tape backup after a disk wipe-out.
  565.  
  566.  
  567. RAW COMMAND INTERFACE
  568.  
  569.      This handler provides a means to send your own SCSI control commands
  570.      to the tape drive, without the need for a special program.
  571.      Some control commands you might want to send it would be REWIND,
  572.      UNLOAD, ERASE, FORMAT, LOCK, etc.  Only control commands may be sent-
  573.      there is no provision for any data transfer; don't try it.
  574.      (As you might guess, raw commands can be dangerous.)
  575.  
  576.      The raw command mode is invoked by writing data to the file name
  577.      "TAPE:RAWCMD". This magic word is how the handler knows you
  578.      want to do a raw command.
  579.  
  580.      You send a command via RAWCMD using the CLI "ECHO" command:
  581.             ECHO >TAPE:RAWCMD "hex command bytes..."
  582.  
  583.      You can put the ECHO command in a script or make a shell alias with it.
  584.      The exact value of the data bytes is determined by the byte format of
  585.      the SCSI command you want to send. (Refer to your drive documentation.)
  586.      The data must contain only hex digits and spaces, terminated by a newline.
  587.      Each byte of the raw command should be specified as a pair of hex
  588.      digits;  separate bytes by spaces.  Up to 12 bytes may be specified.
  589.      Trailing omitted bytes are assumed to be zeroes.
  590.  
  591.      Command examples:
  592.         Rewind:     "01"
  593.         Erase:      "19"  (seq. drives only)
  594.         Retension:  "1B 00 00 00 03"
  595.  
  596.      I have included in the distribution a small ARexx script named
  597.      TAPE.REXX .  It will issue some of the common control commands
  598.      for you.  Refer to the script for more information.
  599.  
  600.  
  601. USER-SPECIFIED MODE SELECT
  602.  
  603.      In recognition of the fact that it will never be able to provide
  604.      switches for all possible modes of all tape drives, BTNtape
  605.      allows you to set the modes of the drive directly.
  606.      These modes might include:  buffering, speed, auto-loading,
  607.      disconnect/reconnect, medium type, etc.
  608.  
  609.    *NOTE* Do not use this feature unless you know what you are doing.
  610.      This feature is provided for the convenience of "power users".
  611.      Most drives can get by with defaults if you do not set the modes,
  612.      so it is unlikely that not setting a mode will cause problems.
  613.  
  614.      Drive modes are set using the SCSI command MODE_SELECT (0x15).
  615.      BTNtape will send its own MODE_SELECT to the drive if necessary
  616.      to set the drive to fixed block mode and set the block length.
  617.      But you may also send this command to the drive at other times,
  618.      using any data you wish.
  619.  
  620.      The command is sent in a manner very similar to the RAWCMD
  621.      method described above, but the magic word MODESEL is
  622.      used instead.  The handler provides the SCSI command,
  623.      and you provide the data.  The data is specified in an ECHO
  624.      command as pairs of hex digits separated by spaces:
  625.             ECHO >TAPE:MODESEL "hex data bytes..."
  626.  
  627.      Since each drive has different things that are affected by MODE_SELECT,
  628.      you MUST refer to the programming documentation for your drive.
  629.      But in general, the mode select data consists of a parameter
  630.      list, a block descriptor, and vendor unique parameters.
  631.     *NOTE*  If you specify a block descriptor, it will behoove you to
  632.      specify the same block length as found in the mountlist entry
  633.      when using fixed block mode, or zero if using variable block mode.
  634.  
  635.      The handler counts the number of bytes you enter (up to 64),
  636.      and uses that for the SCSI command data length.  The drive may
  637.      be fussy about the length, so enter exactly the number of bytes
  638.      as described in your docs.
  639.  
  640.      Mode Select data example:
  641.  
  642.        --parmlist-   ----block-descriptor---   vendorparms
  643.        00 10 00 08   03 00 00 00 00 00 04 00   11 22 33 44
  644.           |     |    |                 || ||
  645.   Buff_mode  BD_Len  Density         Blk_Len
  646.  
  647.  
  648. FINE TUNING
  649.  
  650.      There are a few factors you can tweak to get good performance
  651.      on your particular system.  Good performance means the tape tends
  652.      to run continuously for long periods of time and seldom has
  653.      to stop and back up to get a running start at the next block.
  654.      (On some drives, poor performance also results in a reduction of
  655.      the amount of data you can write on the tape.)
  656.      The tape may have to stop while TAR gets more data from the
  657.      hard disk, but you can minimize it.
  658.  
  659.      The handler's NB parameter can be increased from 1 to
  660.      some larger number as your memory allows.  With more handler
  661.      blocks, a larger quantity of data is available to dump to the tape.
  662.      But beyond a certain number of blocks, there is no further advantage.
  663.  
  664.      The TAR program also has a block parameter.  It controls how much
  665.      DOS data TAR collects before sending it to the handler.  If you
  666.      use many TAR blocks, it makes no sense to also use many handler
  667.      blocks,  since the data has to go through both buffers
  668.      anyway.  You can increase the TAR blocks if your SCSI-
  669.      direct driver does not support multi-block operations.
  670.  
  671.      Other activities going on in other tasks may slow down the tape.
  672.      Shut down non-essential programs that take CPU time or make
  673.      lots of disk accesses.
  674.  
  675.      Using the TAPEMON program may slow down the handler slightly
  676.      when it prints messages, but it's not really a problem.
  677.      If you absolutely need maximum throughput, shut down TAPEMON.
  678.  
  679.  
  680. HOW IT WORKS
  681.  
  682.      Two buffers are maintained so that one buffer can be used by DOS
  683.      while the other is exchanging data with the drive.  With the
  684.      multitasking nature of the Amiga, this should help keep the tape
  685.      in motion, but it may not help much with non-DMA SCSI adapters.
  686.  
  687.      In write mode, the handler collects DOS data in one buffer while
  688.      the previously filled buffer is being written to tape.  In read mode,
  689.      the handler reads ahead on the tape to fill one buffer while
  690.      DOS gets data from the previously read buffer.  Seeks are implemented
  691.      as a special form of read which does not return any data.
  692.  
  693.      The handler does not write (or expect) anything special on
  694.      the tape for itself.  That is to say, the data written on the
  695.      tape is your raw data, nothing else.  If I were to use parts
  696.      of the tape for file system information, I would be creating an
  697.      incompatible standard.  Raw data provides a lowest common denominator
  698.      which should help compatibility with other things.  For instance,
  699.      a TAR tape created on a non-Amiga system is readable using
  700.      this handler and Amiga TAR.
  701.  
  702.  
  703. BUGS
  704.  
  705.      Avoid using the INFO command from another CLI while a tape operation
  706.      is in progress.  It may cause BTN to crash the machine.  This may
  707.      also happen with any program that causes a packet to be sent to BTN.
  708.  
  709.      The variable block mode of operation (VB-1) has not been tested,
  710.      and is not very useful in its present form.
  711.  
  712.      The handler has not been tested with AmigaDOS 1.2.
  713.  
  714.      If you use the Xoper or ARTM utilities, and display the device list,
  715.      the entry for TAPE: will show garbage, and the Amiga may crash.
  716.      I believe this to be a bug in those programs, but this will be little
  717.      consolation to you after your machine crashes.
  718.  
  719.      The handler gurus when compiled with Manx 5.0d.  This may be a Manx
  720.      problem, because it works fine with 5.0a.
  721.  
  722.  
  723. CONTACTING THE AUTHOR:
  724.  
  725.   Email:  DrBob@cup.portal.com   OR   ...!sun!portal!cup.portal.com!DrBob
  726.  
  727.   USmail: Robert Rethemeyer
  728.           979-4 Belmont Terrace
  729.           Sunnyvale, CA  94086
  730.           USA
  731.  
  732.   IMPORTANT!!  If you want to contact me about a problem, you need to
  733.   include with your mail the following information:
  734.       *  your configuration: model of Amiga, SCSI adapter, and tape drive
  735.       *  the version of BTN you are using
  736.       *  a copy of your mountlist entry for TAPE:
  737.       *  a capture of the output from TAPEMON.  Just redirect its
  738.              output to a file:     TAPEMON >filename
  739.       *  a verbal description of what happens to the drive and/or Amiga
  740.              (e.g.  tape doesn't move, smoke issues from Amiga, etc.)
  741.       *  any other info that may help me figure out what's going on.
  742.           Remember, I'm not there to see what is happening, and I
  743.           probably don't have your hardware setup available to recreate
  744.           the problem.  I have only your description to go by.
  745.  
  746.  
  747. MANY THANKS GO TO:
  748.  
  749.   Beta testers Bill Seymour, Don Phillips, Steve Goldstein, Loren Rittle,
  750.     Keith Barrett, Mike Meyer, Serenella Ciongoli, Dan Moore, Cal Delaney,
  751.     Dan Griffin, Thad Floryan. (Sorry if I forgot someone.)
  752.   Loren Rittle, Stephen Kelley, and Michael van Elst for enhancement
  753.     suggestions, code examples, and general advice.
  754.   Dennis Brueni for example code for Seek() handling.
  755.   Scott Blackledge for loaning me his machine and tape drive.
  756.   Bob Mitchell for the SCSI-direct programs I used to get started,
  757.     and the 2090A circumvention.
  758.   Phillip Lindsay for the my.handler example code.
  759.   Rene' Vega for advice and Manxification.
  760.  
  761.