4 Getting and installing ftape

Contents of this section

I will eventually include an installation guide in this section. You'll have to do without it, for the moment being.

4.1 What is ftape

ftape is a driver program that controls various low-cost tape drives that connect to the floppy controller.

ftape is written by Bas Laarhoven <bas@vimec.nl>, with ``a little help from his friends'' to sort out the ECC (Error Correcting Code) stuff.

ftape supports drives that conform to the QIC-117 and QIC-80/QIC-40 standards. ftape does not support QIC-02 tape drives or drives that connect via a SCSI interface, e.g. a DAT drive. SCSI drives are accessed as /dev/[n]st[0-7] and are supported by the kernel directly. See section Supported drives and Un-supported drives for a list of supported and unsupported drives.

In the future, ftape may be able to support drices using QIC-3010 or QIC-3020 (aka QIC-WIDE). Right now, such drives might work if you use QIC-80 formatted tapes. If you have such a drive, drop Bas a line.

4.2 The newest version of ftape - and where to get it

The newest version of the ftape driver is ftape-1.14d, and can be fetched from the following sites:

    sunsite.unc.edu [152.2.22.81]: /pub/Linux/kernel/tapes/

(As of today (dec 11) the files are still in /pub/Linux/Incoming)

You should get the files: ftape-1.14d.tar.gz, and ftape-1.14d.lsm. The .tar.gz file is the ftape driver proper, while the .lsm file is a Linux Software Map (LSM) file for the LSM project. If your version of the modules utilities is older than June 27th, 1994, you should upgrade by downloading modules.tar.gz, from the same place as you found ftape. The modules file contains is a set of utilities for manipulating loadable drivers (insertion and removal).

WARNING: ftape-1.14 does not work. You must upgrade to at least ftape-1.14a.

Patching from 1.14 to 1.14a

Unfortunately, Bas got something mixed up, while he created the 1.14a patch. This shows up when you try to apply the patch: patch will come out and say:

$ patch < ftape-1.14a.patch
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- 1.32       1994/10/31 19:44:07
|+++ fdc-io.c   1994/11/01 18:10:25
--------------------------
Patching file fdc-io.c using Plan A...
Reversed (or previously applied) patch detected!  Assume -R? [y]

There are two ways of getting around this: either (A) just get a more recent ftape than 1.14a, or (B) applying the patch in two steps: First, answer no (just `n' will do) to the `-R' question.

Reversed (or previously applied) patch detected!  Assume -R? [y] n
Apply anyway? [n] y
Hunk #1 failed at 15.
Hunk #2 succeeded at 469.
Hunk #3 succeeded at 871.
Hunk #4 succeeded at 879.
1 out of 4 hunks failed--saving rejects to fdc-io.c.rej
done
$

Then, apply the failed patch this way:

$ patch fdc-io.c fdc-io.c.rej
Hmm...  Looks like a new-style context diff to me...
Patching file fdc-io.c using Plan A...
Reversed (or previously applied) patch detected!  Assume -R? [y] y
Hunk #1 succeeded at 15.
done

You can skip the second patching, if you like. The hacker's (fast) way to get it running is to edit the .diff file by exchanging the - and + in the first hunk (the RCSid lines). If you do not know what this means, stay with the first method.

Problems with kernel version 1.1.5x

During patchlevel 50 to 60, the floppy driver got changed a few times. A some point, the floppy driver forgot to release the interrupt line (IRQ6). This would result in that you could not use ftape and a floppy drive at the same time. It also resulted in the if you tried to make a ``rescue disk'' (a very sensible thing), where you would boot from floppy and then restore from your backup tape, you experience that when you used ftape, it would say unable to grab IRQ6 for ftape driver. No fun. The solution is to upgrade the kernel (v1.1.59 will work).

4.3 If you have ftape-1.13b

Due to some recent changes in the kernel's DMA and interrupt code, a patch is required to be able to compile ftape with newer kernels (Sorry, I don't know when it was changed, you'll have to check that out yourself). Either upgrade to 1.14d or apply the patch(es) below:

This patch is know as ftape-irq-dma.patch


--- fdc-io.c.orig       Tue Jul  5 15:18:09 1994
+++ fdc-io.c    Sat Aug 27 22:14:23 1994
@@ -938,20 +938,14 @@
 {
   TRACE_FUN( 8, "fdc_grab_irq_and_dma");
   int result = 0;
-  struct sigaction ftape_sig_action = {
-    ftape_interrupt, 0, SA_INTERRUPT, NULL
-  };
 
   if (fdc.hook != &do_floppy) {
-    /*  Cannot use request_irq because we want a fast interrupt
-     *  handler instead of a normal one (see kernel/irq.c).
-     */
-    result = irqaction( fdc.irq, &ftape_sig_action);
+    result = request_irq( fdc.irq, ftape_interrupt, SA_INTERRUPT, "ftape");
     if (result) {
       TRACEx1( -1, "Unable to grab IRQ%d for ftape driver", fdc.irq);
       result = -EIO;
     } else {
-      result = request_dma( fdc.dma);
+      result = request_dma( fdc.dma, "ftape");
       if (result) {
         TRACEx1( -1, "Unable to grab DMA%d for ftape driver", fdc.dma);
         free_irq( fdc.irq);

The next patch (ftape-conner.patch) is only needed if you have a Conner C250MQ drive. It makes ftape work with tapes (incorrectly) formatted with Conner's software.


This patch fixes ftape-read.c so that tapes formatted by the new Conner
Backup Basics DOS and Windows software will work for those of us who 
have the Conner C250MQ floppy tape drive.  You don't need to apply this
patch if you don't have a Conner.  Don't forget to add -DCONNER_BUG in
your Makefile.

--
Dennis Flaherty           dennisf@denix.elk.miles.com
    Oatmeal Stout: It's the Right Thing to Drink!


--- ftape-read.c.orig   Thu Jun 30 13:32:16 1994
+++ ftape-read.c        Thu Sep  8 23:18:56 1994
@@ -357,8 +357,17 @@
   if (header_segment != header_segment_1 && /* first header */
       header_segment != header_segment_2) { /* duplicate */
     TRACE( 1, "wrong segment nr");
+#ifdef CONNER_BUG
+    if (header_segment != 0 || header_segment_1 != 1 || header_segment_2 != 2) {
+      TRACE ( 1, "CONNER_BUG:");
+      TRACEi( 1, "| header_segment:   ", header_segment);
+      TRACEi( 1, "| header_segment_1: ", header_segment_1);
+      TRACEi( 1,"\\_header_segment_2: ", header_segment_2);
+    }
+#else
     TRACE_EXIT;
     return -EIO;
+#endif /* CONNER_BUG */
   }
   /*    Verify tape parameters...
    *    QIC-40/80 spec:                 tape_parameters:

4.4 If you have ftape-1.13b Following the development of theftape driver

If you want to follow the development of the ftape driver, you should consider subscribing to the TAPE channel on Linux-activists. To subscribe, you send a mail to <linux-activists-request@niksula.hut.fi>, with the first line (or as a part of the header) saying `X-Mn-Admin: join TAPE'. If you send an empty mail you are sent a HOWTO mail.

To submit a real mail to the mailing lists, send a mail to <linux-activists@niksula.hut.fi>, and remember that the first line (or a header line) should read `X-Mn-Key: TAPE'.

To get off the TAPE channel (:-(), send a mail with the line `X-Mn-Admin: leave TAPE'

4.5 Compiling and installing the ftape driver

There is included an installation guide (the file Install-guide) in the ftape distribution; please read that.

4.6 Where to get the kernel sources

You can get the kernel sources from the same place as you got the ftape sources. The sources are kept at the following sites (and many mirror-sites)

    tsx-11.mit.edu   [18.172.1.2]: /pub/linux/sources/system/
    sunsite.unc.edu [152.2.22.81]: /pub/Linux/kernel/
    ftp.funet.fi  [128.214.248.6]: /pub/OS/Linux/PEOPLE/Linus

You will find a number of subdirectories, including two named v1.0 and v1.1. These contain (you guessed it!) v1.0 and v1.1 of the kernel. I suggest that you get version 1.1.<something>.

4.7 Can I format my tapes under Linux?

No! Honestly, noone is working on it: If you want to work on it, drop Bas a line. You'll have to use MessyDOS (arghhh!) instead or buy preformatted tapes. However, some of the preformatted tapes are not checked for bad sectors!. If the ftape driver encounters a tape with no bad blocks, it will issue a warning. If ftape barfs at your preformatted tapes, try out your DOS software. If both the DOS software and ftape barfs on your tapes, a reformat will very probably cure the problem.

4.8 Which formatting programs can I use under DOS?

These are known to work:

These programs are known to be more or less buggy:

In fact, most software under DOS should work. The Conner Backup Basics v1.0 has a parameter off-by-one (someone could not read the QIC-80 specs right!), which is corrected in version 1.1. Dennis T. Flaherty (dennisf@denix.elk.miles.com) report that Conner C250MQ owners can obtain the new v1.1, by calling Conner at 1-800-4Conner (in the US) and ask for an upgrade (for a nominal fee for the floppy). The Windows versions should work fine.

Central Point Backup can be used, but it wastes precious tape space when it encounters a bad spot on the tape.

NOTE: If you are running a formatting software under DOS, which is not mentioned here, please mail the maintainer (khp@pip.dknet.dk) the relevant info, so I can update the HOWTO.

4.9 Mixing ftape and floppies

Since both the floppy driver and ftape needs the FDC (and IRQ6), they cannot run concurrently. Thus, if you have mounted a floppy and then try to access the tape drive, ftape will complain that it cannot grab IRQ6 and then die. This is especially a problem when designing a emergency disk for use with ftape. This solution is to either load the boot/root disk into a ramdisk and then unmount the floppy, or have two FDC's.

Next Chapter, Previous Chapter

Table of contents of this chapter, General table of contents

Top of the document, Beginning of this Chapter