SUMMARY: How to read/set Exabyte 8500 device configuration

From: Mic Kaczmarczik (mic@emx.cc.utexas.edu)
Date: Wed Oct 07 1992 - 01:07:06 CDT


SUMMARY: Setting device registers on an Exabyte 8500

My question:

>One of the people on our campus wants to be able to read and set the
>device configuration registers on an Exabyte 8500 drive connected to a
>SparcServer 670MP running SunOS 4.1.2. From her description of the
>problem, she's interested in device-specific information about the
>drive that the mtio(4) interface won't give her.
>
>The first thing that came to mind was to look for a generic SCSI
>device driver that would lets you send SCSI commands via the ioctl()
>interface. Is there such a beast? So far I haven't been able to find
>one.

The answer: SunOS 4.1.2 does have a generic (``user'') SCSI facility.
(In other words, I didn't look hard enough!) I've included the
example program sent to me by Perry Hutchinson. Also,
mks!andy@watserv1.uwaterloo.ca (Andy Toy) says:

        There is a serial port on the Exabyte 8500. You can get a cable and
        MS-DOS software from Exabyte to communicate with the drive. You can
        install new firmware, read and write registers, et cetera using it.

Many, many thanks to all who responded:

Mike Raffety <miker@sbcoc.com>
mks!andy@watserv1.uwaterloo.ca (Andy Toy)
Kathy Holle <holle@asc.slb.com>
Perry_Hutchison.Portland@xerox.com

Mic Kaczmarczik

-----------------------------------------------------------------------
From: Perry_Hutchison.Portland@xerox.com
Date: Thu, 1 Oct 1992 11:07:15 PDT
Subject: Re: How to read/set Exabyte 8500 device configuration registers?

The following correspondence from bob@cs.wwu.edu contains the program
which uses the user SCSI driver to set the CDROM sector size. It was
sent to me when I posted a few months ago regarding using a NEC
Intersect CDROM with SunOS. (I never got that to work -- I have since
gotten an Toshiba XM-3201B and have confirmed that it can be used, at
least lightly, with SunOS 4.1.1b on an SS1.)

- - - - - - - - - - - - begin included message - - - - - - - - - - - -

From: bob@cs.wwu.edu

I had posted this to the comp.sys.sun.hardware group before; It is the
answer to using a toshiba cd-rom drive to read data only, not boot nor
audio ... I currently have a toshiba drive 3201B hooked to IPC, works
fine. One caveat, there must be a disk caddy in the drive to allow
setting the sector transfer size. This code also works with toshiba
3301 drives. When you want the "unsupported vendor" stuff to go away,
search the kernel for 'hitachi' (2 places, case change, i recall) and
replace with the ( coincidentally? ) same length toshiba. The above is
only cosmetic, not required ;-)

*********** here is bit 'o code --works for me **********
>From rkling@austin.intel.com Mon Feb 3 13:11:57 1992
Return-Path: <rkling@austin.intel.com>
Received: from henson.cc.wwu.edu by arthur.cs.wwu.edu (4.1/SMI-4.11)
        id AA01178; Mon, 3 Feb 92 13:11:51 PST
Received: by henson.cc.wwu.edu
        (5.57/WWU-H1.2/UW-NDC Revision: 2.21 ) id AA01658; Mon, 3 Feb 92 13:09:47 -0800
Received: by hermes.intel.com (5.57/10.0i); Mon, 3 Feb 92 13:09:44 -0800
Received: by austin.intel.com (4.1/SMI-4.1)
        id AA01140; Mon, 3 Feb 92 13:10:56 PST
Date: Mon, 3 Feb 92 13:10:56 PST
From: rkling@austin.intel.com (Ralph Kling)
Message-Id: <9202032110.AA01140@austin.intel.com>
To: bob@henson.cc.wwu.edu
Subject: Re: CD-ROM drives
Status: R

        YES, it is possible! I have managed to connect one to a SS-2.
        However, there are a few differences between the SUN (=SONY) drive
        and the Toshiba drive. In particular, the SUN drive seems to use
        a default transfer block size of 512 bytes versus 2048 for the
        Toshiba. I wrote a little program that uses SUNs user-scsi-driver
        to correct this. You have to run that before trying to mount the
        drive! The "unrecognized vendor" message can be neglected.
        If you want to use the CD-audio capabilities you'll have to write
        your own driver (also via SUNs user-scsi-driver) since those commands
        are totally different from the SUN drive. Call Toshiba of America
        (sorry, I lost the number) and order the CD rom drive spec from them
        (will cost you $15).
        One more thing: The scsi-id for the CD rom needs to be 6.
        Good luck!!!

        Ralph

        Here is the program to set the transfer length to 512 bytes:

        -----------
        # include <sys/types.h>
        # include <sys/buf.h>
        # include <sun/dkio.h>
        # include <scsi/targets/srdef.h>
        # include <scsi/impl/uscsi.h>
        # include <strings.h>

        # include <stdio.h>

        char cdrom[] = "/dev/rsr0";

        extern char * cdrom_status();

        /* group 0 commands */

        #define TEST 0x00
        #define REZERO 0x01
        #define SENSEREQ 0x03
        #define READ 0x08
        #define SEEK 0x0b
        #define NOP 0x0d
        #define INQ 0x12
        #define MODESEL 0x15
        #define RESERVE 0x16
        #define RELEASE 0x17
        #define MODESENSE 0x1a
        #define STARTSTOP 0x1b
        #define DIAGRCV 0x1c
        #define DIAGSND 0x1d
        #define MEDIUMLOCK 0x1e

        /* group 1 commands */

        #define READCAP 0x25
        #define READEXT 0x28
        #define SEEKEXT 0x2b

        /* group 6 commands */

        #define AUDIOTRACK 0xc0
        #define AUDIOPLAY 0xc1
        #define AUDIOSTILL 0xc2
        #define AUDIOSTOP 0xc3
        #define EJECT 0xc4
        #define CLOSE 0xc5
        #define AUDIOSUB 0xc6
        #define AUDIODISK 0xc7
        #define ROMMODE 0xc8

        /***/

        #define CMDLEN(cmd) ((cmd >= 0x20) ? 10 : 6)

        /***/

        main() {
                int fd;
                int i;
                struct uscsi_cmd ucmd;
                char * s_command;
                char * s_buffer;

                if ((fd = open(cdrom, 0)) == -1) {
                        fprintf(stderr, "open: ");
                        perror(cdrom);
                        exit(1);
                }
                s_command = (char *) malloc(10);
                if (s_command == NULL) {
                        printf("malloc error (command)\n");
                        exit(-1);
                }
                bzero(s_command, 10);
                s_buffer = (char *) malloc(256);
                if (s_buffer == NULL) {
                        printf("malloc error (buffer)\n");
                        exit(-1);
                }
                bzero(s_buffer, 256);
                s_command[0] = MODESEL;
                s_command[1] = 0x10;
                s_command[4] = 12;
                s_buffer[3] = 0x08;
                s_buffer[10] = 0x02;
                ucmd.uscsi_cdb = s_command;
                ucmd.uscsi_cdblen = 6;
                ucmd.uscsi_bufaddr = s_buffer;
                ucmd.uscsi_buflen = 4096;
                ucmd.uscsi_flags = USCSI_WRITE;
                i = ioctl(fd, USCSICMD, ucmd);
                close(fd);
                exit(i);
        }
***************************************************************************
Hope that this works for you, too --
Bob Hayes < bob@cs.wwu.edu >
Western Washington University
Computer Science Dept., Bond Hall 302 Mail Stop 9062
Bellingham, Washington 98225
Obbligato Disclaimer: Once upon a time, I believed that, too.
- - - - - - - - - - - - end included message - - - - - - - - - - - -

Mic Kaczmarczik \
Unix Services Group \ Yeah, I partied with Segovia.
UT Austin Computation Center \ -- Les Paul
remark@{ccwf,emx,bongo} 1-0251 \



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