SUMMARY:EXB-8505XL Drive Problem/SunOS 4.1.X

From: Lau, Victoria H (vlau@msmail2.hac.com)
Date: Fri Aug 02 1996 - 23:50:10 CDT


Thank you, EVERYONE, kindly for your speedy responses. I'm now embarrassed
to tell you about the resolution to my problem. I'd tested every
possible solution but still could not boot from my new kernel. Then I did
what Mark Anderson suggested as a last resort: backed out of all changes and
rebuilt my CURRENT bootable kernel. I was surprised BUT VERY GLAD that this
kernel did not boot either. Well, someone must have been goofing off changing
files in the kernel directories. Anyway, I restored my system from a backup
tape and finally successfully rebuilt a kernel with the EXABYTE changes.

The following sun-managers have all contributed to my effort--thank you:
  Scott Pleitner
  Niall O Broin
  Frode Stromsvag
  Jim Faust
  Mark S. Anderson
  Mark Belanger
  David N. Edwards

=============================================================================
My original question was:

We are attaching a half-high EXB-8505XL drive into a sun4m 4/600MP computer
with HyperSparc CPU, running SunOS 4.1.3.

I inserted the following lines (provided by EXABYTE) in the file
/sys/scsi/targets/st_conf.c:

  /* Exabyte 8mm w/compression (Half-High) */
  {
  "Exabyte EXB-8505 8mm Half-High", 16, "EXABYTE EXB-8505",
  ST_TYPE_EXB8500, 1024,
  (ST_VARIABLE | ST_BSF | ST_BSR | ST_LONG_ERASE | ST_KNOWS_EOD),
  5000, 5000,
  {0x14, 0x15, 0x90, 0x8c}, /* Density selection set low to high */
  {0, 0, 0, 0}
  },

I rebuilt the kernel with no errors. When I rebooted the system with
the new kernel, the boot failed with Data Exception.

Is there something else I should modify on the system besides the above
change?

=============================================================================
Responses:

Changing the one file and rebuilding the kernel should be enough. For what
it is worth, here is our entry for the same device:

/* Exabyte 8505 */
{
        "Exabyte EXB-8505 8mm Helical Scan", 16, "EXABYTE EXB-8505",
        ST_TYPE_EXB8500, 1024,
        (ST_VARIABLE | ST_BSF | ST_BSR | ST_LONG_ERASE),
        5000, 5000,
        { 0x14, 0x15, 0x8C, 0x8C },
        { 0, 0, 0, 0 }
}

It is a little bit different, and we have no problems with it (BTW: This is on
a Sparc5 - SunOS bike 4.1.4 3 sun4m).

Scott Pleitner

No, there isn't. The parameters you used are slightly from what Sun supply
as default with 4.1.4 which has support for the 8505 as standard, but they're
insignificant (the Sun version didn't have ST_KNOWS_EOD and they used 0x8C
in the last two density positions).

Has nothing else changed in your kernel configuration ? I would suggest
backing
out the st_conf.c changes and then making another kernel. You could then run
cmp
on this new kernel and your current kernel. They should be identical, no ?

If not, then you need to establish what else has changed in your
configuration.
If they are identical, and the only change was just that which was introduced
by the st_conf.c mods then I'm afraid I'm stumped.

Niall O Broin

You must also put this in stdef.h

#define ST_TYPE_EXB8505 0x30 /* Exabyte */

I've attached my st_conf.c and stdef.h which works on an IPC running 4.1.3.

Frode Stromsvag email: frode@read-well.no

#ident "@(#)st_conf.c 1.4 90/10/02 SMI"
/*
 * Copyright (c) 1989, 1990 by Sun Microsystems, Inc.
 */

#include "st.h"
#if NST > 0

#include <scsi/scsi.h>
#include <scsi/targets/stdef.h>

/*
 * Tunable parameters. See <scsi/targets/stdef.h>
 * for what the initial values are.
 */

int st_retry_count = ST_RETRY_COUNT;
int st_io_time = ST_IO_TIME;
int st_space_time = ST_SPACE_TIME;
int st_error_level = STERR_RETRYABLE;

/*
 * Drive Tables.
 *
 * The structure and option definitions can be
 * found in <scsi/targets/stdef.h>.
 *
 * Note: that blocksize should be a power of two
 * for fixed-length recording devices.
 *
 * Note: the speed codes are unused at present.
 * The driver turns around whatever is reported
 * from the drive via the mode sense.
 *
 * Note: the read retry and write retry counts
 * are there to provide a limit until warning
 * messages are printed.
 *
 *
 * Note: For drives that are not in this table....
 *
 * The first open of the device will cause a MODE SENSE command
 * to be sent. From that we can determine block size. If block
 * size is zero, than this drive is in variable-record length
 * mode. The driver uses the SCSI-2 specification density codes in
 * order to attempt to determine what kind of sequential access
 * device this is. This will allow determination of 1/4" cartridge,
 * 1/2" cartridge, some helical scan (3.81 && 8 mm cartridge) and
 * 1/2" reel tape devices. The driver will print what it finds and is
 * assuming to the console. If the device you have hooked up returns
 * the default density code (0) after power up, the drive cannot
 * determine what kind of drive it might be, so it will assume that
 * it is an unknown 1/4" cartridge tape (QIC).
 *
 * If the drive is determined in this way to be a 1/2" 9-track reel
 * type device, an attempt will be mode to put it in Variable
 * record length mode.
 *
 * Generic drives are assumed to support only the long erase option
 * and will not to be run in buffered mode.
 *
 */

struct st_drivetype st_drivetypes[] = {

/* Emulex MT-02 controller for 1/4" cartridge */
/*
 * The EMULEX MT-02 adheres to CCS level 0, and thus
 * returns nothing of interest for the Inquiry command
 * past the 'response data format' field (which will be
 * zero). The driver will recognize this and assume that
 * a drive that so responds is actually an MT-02 (there
 * is no other way to really do this, ungracious as it
 * may seem).
 *
 */
{
        "Emulex MT02 QIC-11/QIC-24",
        8, "\0\0\0\0\0\0\0\0", ST_TYPE_EMULEX, 512,
        ST_QIC,
        130, 130,
        /*
         * Note that low density is a vendor unique density code.
         * This gives us 9 Track QIC-11. Supposedly the MT02 can
         * read 4 Track QIC-11 while in this mode. If that doesn't
         * work, change one of the duplicated QIC-24 fields to 0x4.
         *
         */
        { 0x84, 0x05, 0x05, 0x05 },
        { 0, 0, 0, 0 }
},
/* Archive QIC-150 1/4" cartridge */
{
        "Archive QIC-150", 13, "ARCHIVE VIPER", ST_TYPE_ARCHIVE, 512,
        /*
         * The manual for the Archive drive claims that this drive
         * can backspace filemarks. In practice this doens't always
         * seem to be the case.
         *
         */
        (ST_QIC | ST_AUTODEN_OVERRIDE),
        400, 400,
        { 0x00, 0x00, 0x00, 0x00},
        { 0, 0, 0, 0 }
},
/* HP 1/2" reel */
{
        "HP-88780 1/2\" Reel", 13, "HP 88780", ST_TYPE_HP, 10240,
        (ST_REEL | ST_VARIABLE | ST_BSF | ST_BSR),
        400, 400,
        /*
         * Note the vendor unique density '0xC3':
         * this is compressed 6250 mode. Beware
         * that using large data sets consisting
         * of repeated data compresses *too* well
         * and one can run into the unix 2 gb file
         * offset limit this way.
         */
        { 0x01, 0x02, 0x03, 0xC3},
        { 0, 0, 0, 0 }
},
/*
 * The drives below have not been qualified, and are
 * not supported by Sun Microsystems. However, many
 * customers have stated a strong desire for them,
 * so our best guess as to their capabilities is
 * included herein.
 */
/* Exabyte 8mm 5 Gb w/compression cartridge (Half-High) */
{
        "Exabyte EXB-8505 8mm Half-High", 16, "EXABYTE EXB-8505",
        ST_TYPE_EXB8505, 1024,
        (ST_VARIABLE | ST_BSF | ST_BSR | ST_LONG_ERASE ),
        5000, 5000,
        { 0X14, 0X15, 0X90, 0X8C },
/* 1 2 3 4
        Devices are:
        1: 8200 mode uncompressed
        2: 8500 mode uncompressed
        3: 8200 mode compressed
        4: 8500 mode compressed
*/
        { 0, 0, 0, 0 },
},
/* Exabyte 8mm cartridge */
{
        "Exabyte 8mm Helical Scan", 7, "EXABYTE", ST_TYPE_EXABYTE, 1024,
        (ST_VARIABLE | ST_BSF | ST_BSR | ST_LONG_ERASE | ST_AUTODEN_OVERRIDE),
        5000, 5000,
        { 0x00, 0x00, 0x00, 0x00 },
        { 0, 0, 0, 0 }
},
/* Wangtek QIC-150 1/4" cartridge */ {
        "Wangtek QIC-150", 14, "WANGTEK 5150ES", ST_TYPE_WANGTEK, 512,
        (ST_QIC | ST_AUTODEN_OVERRIDE),
        400, 400,
        { 0x00, 0x00, 0x00, 0x00},
        { 0, 0, 0, 0 }
},
/* Kennedy 1/2" reel */
{
        "Kennedy 1/2\" Reel", 4, "KENNEDY", ST_TYPE_KENNEDY, 10240,
        (ST_REEL | ST_VARIABLE | ST_BSF | ST_BSR),
        400, 400,
        { 0x01, 0x02, 0x03, 0x03 },
        { 0, 0, 0, 0 }
},
/* CDC 1/2" cartridge */
{
        "CDC 1/2\" Cartridge", 3, "LMS", ST_TYPE_CDC, 1024,
        (ST_QIC | ST_VARIABLE | ST_BSF | ST_LONG_ERASE | ST_AUTODEN_OVERRIDE),
        300, 300,
        { 0x00, 0x00, 0x00, 0x00},
        { 0, 0, 0, 0 }
},
/* Fujitsu 1/2" cartridge */
{
        "Fujitsu 1/2\" Cartridge", 2, "\076\000", ST_TYPE_FUJI, 1024,
        (ST_QIC | ST_VARIABLE | ST_BSF | ST_BSR | ST_LONG_ERASE),
        300, 300,
        { 0x00, 0x00, 0x00, 0x00},
        { 0, 0, 0, 0 }
},
/* M4 Data Systems 9914 transport with 9700 512k i/f */
{
        "M4-Data 1/2\" Reel", 7, "M4 DATA", ST_TYPE_REEL, 10240,
        /*
         * This is in non-buffered mode because it doesn't flush the
         * buffer at end of tape writes. If you don't care about end
         * of tape conditions (e.g., you use dump(8) which cannot
         * handle end-of-tape anyhow), take out the ST_NOBUF.
         */
        (ST_REEL | ST_VARIABLE | ST_BSF | ST_BSR),
        500, 500,
        { 0x00, 0x01, 0x02, 0x03},
        { 0, 0, 0, 0 }
}
};
int st_ndrivetypes = (sizeof (st_drivetypes)/sizeof (st_drivetypes[0]));

#endif /* NST > 0 */

#ident "@(#)stdef.h 1.32 91/06/26 SMI"
/*
 * Copyright (c) 1989, 1990, 1991 by Sun Microsystems, Inc.
 */

/*
 * Defines for SCSI tape drives.
 */

/*
 * Maximum variable length record size for a single request
 */
#define ST_MAXRECSIZE_VARIABLE 65535

/*
 * If the requested record size exceeds ST_MAXRECSIZE_VARIABLE,
 * then the following define is used.
 */
#define ST_MAXRECSIZE_VARIABLE_LIMIT 65534

#define ST_MAXRECSIZE_FIXED (63<<10) /* maximum fixed record size */
#define INF 1000000000

/*
 * Supported tape device types plus default type for opening.
 * Types 10 - 13, are special (ancient too) drives - *NOT SUPPORTED*
 * Types 14 - 1f, are 1/4-inch cartridge drives.
 * Types 20 - 28, are 1/2-inch cartridge or reel drives.
 * Types 28+, are rdat (vcr) drives.
 */
#define ST_TYPE_INVALID 0x00

#define ST_TYPE_SYSGEN1 0x10 /* Sysgen with QIC-11 only */
#define ST_TYPE_SYSGEN 0x11 /* Sysgen with QIC-24 and QIC-11 */

#define ST_TYPE_DEFAULT 0x12 /* Generic 1/4" or undetermined tape */
#define ST_TYPE_EMULEX 0x14 /* Emulex MT-02 */
#define ST_TYPE_ARCHIVE 0x15 /* Archive QIC-150 */
#define ST_TYPE_WANGTEK 0x16 /* Wangtek QIC-150 */

#define ST_TYPE_CDC 0x20 /* CDC - (not tested) */
#define ST_TYPE_FUJI 0x21 /* Fujitsu - (not tested) */
#define ST_TYPE_KENNEDY 0x22 /* Kennedy */
#define ST_TYPE_HP 0x23 /* HP */
#define ST_TYPE_HIC 0x26 /* Generic 1/2" Cartridge */
#define ST_TYPE_REEL 0x27 /* Generic 1/2" Reel Tape */

#define ST_TYPE_EXABYTE 0x28 /* Exabyte */
#define ST_TYPE_EXB8500 0x29 /* Exabyte */
#define ST_TYPE_EXB8505 0x30 /* Exabyte */

/* Defines for supported drive options */
#define ST_VARIABLE 0x001 /* supports variable length I/O */
#define ST_REEL 0x004 /* 1/2-inch reel tape drive */
#define ST_BSF 0x008 /* Supports backspace file */
#define ST_BSR 0x010 /* Supports backspace record */
#define ST_LONG_ERASE 0x020 /* Long Erase option */
#define ST_AUTODEN_OVERRIDE 0x040 /* Auto-Density override flag */
#define ST_NOBUF 0x080 /* Don't use buffered mode */
#define ST_NOPARITY 0x100 /*
                                         * This device cannot generate parity,
                                         * so don't check parity while talking
                                         * to it.
                                         */

#define ST_KNOWS_EOD 0x200 /* knows when EOD has been reached */
#define ST_QIC 0x202 /* QIC tape drive knows EOD */
/*
 * old defines for the options flag - not supported anymore
 * here for historical reference only.
 */
/* was ST_NO_FSR- Sysgen only 0x020 /* No forwardspace record */
/* was ST_NODISCON- Sysgen only 0x080 /* No disconnect/reconnect support */
/* was ST_NO_QIC24- Sysgen 0x100 /* No QIC-24 (for Sysgen) */
/* was ST_NO_POSITION- ignore 0x400 /* Inhibit seeks flag */

#define NDENSITIES 4
#define NSPEEDS 4

struct st_drivetype {
        char *name; /* Name, for debug */
        char length; /* Length of vendor id */
        char vid[24]; /* Vendor id and model (product) id */
        char type; /* Drive type for driver */
        short bsize; /* Block size */
        int options; /* Drive options */
        int max_rretries; /* Max read retries */
        int max_wretries; /* Max write retries */
        u_char densities[NDENSITIES]; /* density codes, low->hi */
        u_char speeds[NSPEEDS]; /* speed codes, low->hi */
};

/*
 *
 * Parameter list for the MODE_SELECT and MODE_SENSE commands.
 * The parameter list contains a header, followed by zero or more
 * block descriptors, followed by vendor unique parameters, if any.
 *
 */

#define MSIZE (sizeof (struct seq_mode))
struct seq_mode {
        u_char reserved1; /* reserved, sense data length */
        u_char reserved2; /* reserved, medium type */
        u_char wp :1, /* write protected */
                bufm :3, /* buffered mode */
                speed :4; /* speed */
        u_char bd_len; /* block length in bytes */
        u_char density; /* density code */
        u_char high_nb; /* number of logical blocks on the medium */
        u_char mid_nb; /* that are to be formatted with the density */
        u_char low_nb; /* code and block length in block descriptor */
        u_char reserved; /* reserved */
        u_char high_bl; /* block length */
        u_char mid_bl; /* " " */
        u_char low_bl; /* " " */
};

/*
 * Private info for scsi tapes. Pointed to by the un_private pointer
 * of one of the SCSI_DEVICE chains.
 */

struct scsi_tape {
        struct scsi_device *un_sd; /* back pointer to SCSI_DEVICE */
        struct scsi_pkt *un_rqs; /* ptr to request sense command */
        struct buf *un_rbufp; /* for use in raw io */
        struct buf *un_sbufp; /* for use in special io */
        struct buf *un_quef; /* head of wait queue */
        struct buf *un_quel; /* tail of wait queue */
        struct buf *un_runq; /* head of run queue */
        struct seq_mode *un_mspl; /* ptr to mode select info */
        struct st_drivetype *un_dp; /* ptr to drive table entry */
        caddr_t un_tmpbuf; /* buf for append, autodens ops */
        daddr_t un_blkno; /* block # in file (512 byte blocks) */
        int un_fileno; /* current file number on tape */
        int un_err_fileno; /* file where error occurred */
        daddr_t un_err_blkno; /* block in file where err occurred */
        u_int un_err_resid; /* resid from last error */
        short un_fmneeded; /* filemarks to be written - HP only */
        dev_t un_dev; /* unix device */
        u_char un_attached; /* unit known && attached */
        u_char un_density_known; /* density is known */
        u_char un_curdens; /* index into density table */
        u_char un_lastop; /* last I/O was: read/write/ctl */
        u_char un_eof; /* eof states */
        u_char un_laststate; /* last state */
        u_char un_state; /* current state */
        u_char un_status; /* status from last sense */
        u_char un_retry_ct; /* retry count */
        u_char un_read_only; /* 1 == opened O_RDONLY */
        u_char un_test_append; /* check writing at end of tape */
};

/*
 * driver states..
 */

#define ST_STATE_CLOSED 0
#define ST_STATE_OPENING 1
#define ST_STATE_OPEN_PENDING_IO 2
#define ST_STATE_APPEND_TESTING 3
#define ST_STATE_OPEN 4
#define ST_STATE_RESOURCE_WAIT 5
#define ST_STATE_CLOSING 6
#define ST_STATE_SENSING 7

/*
 * operation codes
 */

#define ST_OP_NIL 0
#define ST_OP_CTL 1
#define ST_OP_READ 2
#define ST_OP_WRITE 3

/*
 * eof/eot/eom codes.
 */

#define ST_NO_EOF 0x00
#define ST_EOF_PENDING 0x01 /* filemark pending */
#define ST_EOF 0x02 /* at filemark */
#define ST_EOT_PENDING 0x03 /* logical eot pending */
#define ST_EOT 0x04 /* at logical eot */
#define ST_EOM 0x05 /* at physical eot */
#define ST_WRITE_AFTER_EOM 0x06 /* flag for allowing writes after EOM */

#define IN_EOF(un) (un->un_eof == ST_EOF_PENDING || un->un_eof == ST_EOF)

/*
 * Error levels
 */

#define STERR_ALL 0
#define STERR_UNKNOWN 1
#define STERR_INFORMATIONAL 2
#define STERR_RECOVERED 3
#define STERR_RETRYABLE 4
#define STERR_FATAL 5

/*
 * stintr codes
 */

#define COMMAND_DONE 0
#define COMMAND_DONE_ERROR 1
#define COMMAND_DONE_ERROR_RECOVERED 2
#define QUE_COMMAND 3
#define QUE_SENSE 4
#define JUST_RETURN 5

#ifndef RELEASE_41
/*
 * Compatibility with 'old' MTIOCGET structure
 */

/* structure for MTIOCGET - obsolete version */
#define STIOCGET _IOR(m, 2, struct st_mtget)
struct st_mtget {
        short mt_type; /* type of magtape device */
        short mt_dsreg; /* drive status register */
        short mt_erreg; /* error register */
        short mt_resid; /* residual count */
        daddr_t mt_fileno; /* file number of current position */
        daddr_t mt_blkno; /* block number of current position */
};
#endif /* !RELEASE_41 */

/*
 * Parameters
 */
        /*
         * 60 minutes seems a reasonable amount of time
         * to wait for tape space operations to complete.
         *
         */
#define ST_SPACE_TIME 60*60 /* 60 minutes per space operation */

        /*
         * 2 minutes seems a reasonable amount of time
         * to wait for tape i/o operations to complete.
         *
         */
#define ST_IO_TIME 2*60 /* 2 minutes per i/o */

        /*
         * 10 seconds is what we'll wait if we get a Busy Status back
         */
#define ST_BSY_TIMEOUT 10*hz /* 10 seconds Busy Waiting */

        /*
         * Number of times we'll retry a normal operation.
         *
         * XXX This includes retries due to transport failure as well as
         * XXX busy timeouts- Need to distinguish between Target and Transport
         * XXX failure.
         */

#define ST_RETRY_COUNT 20

        /*
         * Maximum number of units (determined by minor device byte)
         */

#define ST_MAXUNIT 8

#ifndef SECSIZE
#define SECSIZE 512
#endif
#ifndef SECDIV
#define SECDIV 9
#endif

this is the entry I have in my st_conf.c file. I don't know if the
few spaces and case differences matter, but this one works fine for
me.

/* Exabyte 8mm 5GB w/compression (Half-High) */
{
        "Exabyte EXB-8505 8mm Half-High", 16,
        "EXABYTE EXB-8505", ST_TYPE_EXB8500, 1024,
        (ST_VARIABLE|ST_BSF|ST_BSR|ST_LONG_ERASE|ST_KNOWS_EOD),
        5000, 5000,
        {0x14, 0x15, 0x90, 0x8C}, /* Density selection set low to high */
        {0, 0, 0, 0}
},

After I added the above to my st_conf.c file, I did the following:

prompt> cd /sys/sun4m/conf
prompt> config GENERIC
prompt> cd /sys/sun4m/GENERIC
prompt> make

Jim Faust

One test that you can do is this: re-edit the same st_conf.c so as to
comment-out the lines that you added. Then rebuild the kernel. If
this kernal also fails to boot, then the problem is not in the code
that you added.

Mark Anderson

This is a longshot but,,,,
the only difference I noticed between my entries for similar drives
is 0x8c string. All my entries use capital letters i.e. 0x8C

I don't know whether or not the entries are case-sensitive, or
merely convention.

Mark Belanger

     I have an 8505XL (in an Exabyte/Sun 210 library) connected to a 4/690
running 4.1.3. I used the mods suggested in the sun_managers FAQ, and it
seems
to be working fine. They look similar but ever so slightly different from
the ones Exabyte apparently sent you. Here are the ones I've used (below).

Dave Edwards

     I forgot to mention in my last note... If you make the change I sent
along from the
Sun Manager's FAQ, you'll get 4 tape densities instead of two like an Exabyte
8500.
For example, if your drive is /dev/rst0, here's what it would be after the
change:

/dev/rst0 = 8200 mode (2.3GB on 116m tapes)
/dev/rst8 = 8200 compressed mode (~4.5GB on 116m tapes)
/dev/rst16 = 8500 mode (~5GB on 116m tapes)
/dev/rst24 = 8500 compressed mode (~9GB on 116m tapes)

My testing showed slightly less than 2:1 compression, but they claim up to
4:1. I didn't
notice much of an increase in transfer rate (other than the usual &
significant 8500 vs.
8200 increase). That was with few, large ASCII files. Exes & images, etc.
will compress
less or not at all. It doesn't matter to us anyway since we only have one
8505 drive --
I refrain from using compression so that we can recover data on our other
8500s.

The testing we haven't done is to see what an 8500 drive will do with the
longer (~7GB)
8mm tapes. I suspect they will handle them just fine, but that's only a
guess.

- Dave Edwards



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:11:06 CDT