                          Everex Streaming Tape

                    XENIX Device Driver (Version 1.02)

                     Step-by-Step Installation Guide

                 (C) Copyright Everex Systems, Inc. 1987

1) Introduction

   This document contains the following sections:

   (1) Introduction
   (2) Hardware Installation
   (3) Software Installation
   (4) Install as the Pre-configured Device "mt"
   (5) Install as a New Device "et"
   (6) Change Tape Controller Settings
   (7) Move New Kernel to Root Directory
   (8) How to Use a Device Driver
   (9) Restrictions

   The following files are included in the release diskette:

   readme ---- these release notes
   getkey ---- utility program for the installation scripts

   tape ------ utility program to configure the tape driver at boot time
   tape.com -- tape driver data file

   mt.o ------ mt linkable object file
   mtmake ---- mt installation program      (csh    script)
   mterase --- mt utility to erase     tape (csh/sh script)
   mtrewind -- mt utility to rewind    tape (csh/sh script)
   mtretens -- mt utility to retension tape (csh/sh script)
   mtbackup -- mt testing program           (csh/sh script)

   et.o ------ et linkable object file
   etmake ---- et installation program      (csh    script)
   eterase --- et utility to erase     tape (csh/sh script)
   etrewind -- et utility to rewind    tape (csh/sh script)
   etretens -- et utility to retension tape (csh/sh script)
   etbackup -- et testing program           (csh/sh script)

   The release diskette is in DOS format. You can use the doscp command
   to copy files from a DOS diskette to your XENIX directory.

2) Hardware Installation:

   Everex Streaming Tape Controllers are usually shipped with the
   following configuration:

       PORT = 300H    (possible setting: 0, 2, 4, ..., 3FCH, 3FEH)
       IRQ  = 3       (possible setting: 2, 3, 4, 5, 7)
       DMA  = 1       (possible setting: 1, 3)

   You should check your system and make sure that this configuration
   does not conflict with any existing devices.

   If you cannot find an unused IRQ for the tape controller, you
   may have the tape controller share IRQ 5 or IRQ 7 with the
   parallel port driver (pa).

3) Software Installation:

   On a XENIX system, the only legal way that an application software
   can access hardware is through device drivers. Please refer to
   section (8) for more details.

   A XENIX device driver is a piece of code that has to be linked
   with the rest of the XENIX operating system codes to form the
   executable kernel. The default executable kernel file is /xenix.

   There are two ways to generate a new executable kernel which
   contains new device drivers:

   Method 1: Use preconfigured device driver entries.

   The standard release of XENIX system includes an object file linker
   (ld) and a sub-directory /usr/sys/conf which contains the linkable
   kernel object files.

   There are extra device driver entries that are preconfigured in the
   linkable kernel. You can link a new device driver code to an unused
   device driver entry.

   If you do not have the XENIX development system, you can only use
   this method.

   Section (4) provides you with a step-by-step guide to install the
   Everex tape driver as the preconfigured driver "mt".

   Method 2: Add a new device driver entry to the kernel.

   If you already have another vendor's device driver installed as the
   "mt" device, then you have to install the Everex tape driver as a
   new device named "et".

   You will need the XENIX development system in order to add a new
   device entry to the linkable kernel.

   Section (5) gives you a step-by-step guide to install the Everex
   tape driver as a new device "et".

4) Install the Tape Driver as the Preconfigured Device "mt":

   [ 1] Boot up the system in normal mode (not maintenance mode).

   [ 2] Log into the system as a super user.

   [ 3] Insert the tape software diskette in drive A and close the
        diskette drive's door.

   [ 4] Create the tape software directory by entering:

        mkdir /usr/sys/tape

   [ 5] Change your current directory to the tape software directory:

        cd /usr/sys/tape

   [ 6] Copy the installation script file and getkey program from drive A:

        doscp    a:mtmake .
        doscp -r a:getkey .

   [ 7] Make the script and getkey program executable:

        chmod +x mtmake getkey

   [ 8] Run the installation script from a C-shell:

        csh mtmake

   [ 9] The mtmake script will perform the rest of the installation
        automatically:

        STEP  1: Get tape controller settings
        STEP  2: Select installation mode: step-by-step or auto
        STEP  3: Copy files from the software  diskette  to /usr/sys/tape
        STEP  4: Copy files from /usr/sys/conf directory to /usr/sys/tape
        STEP  5: Record the controller's settings in the /etc/rc file
        STEP  6: Create tape device files /dev/mt*
        STEP  7: Link a new kernel /usr/sys/tape/xenix
        STEP  8: Reboot the system

   [10] Reboot the system using the new kernel /usr/sys/tape/xenix:

        After you enter y to STEP 8, the system will prompt you:

        ** Hit Any Key to Reboot **

        If you do not respond within approximately 23 seconds, XENIX
        will reboot by itself.

        After that, you will see the Boot prompt:

        Boot
        :

        Enter /usr/sys/tape/xenix after you see the Boot prompt:

        Boot
        : /usr/sys/tape/xenix

        You must enter the new kernel file name within 23 seconds after you
        see the Boot prompt, otherwise, XENIX will automatically boot up
        from the default kernel (/xenix).

   [11] Run the mtbackup script to test the new kernel:

        /usr/sys/tape/mtbackup

        The mtbackup script runs the "tar" program to backup the entire
        root file system to the "/dev/mt11" device.

5) Install the Tape Driver as a New Device "et":

   [ 1] Boot up the system in normal mode (not maintenance mode).

   [ 2] Log into the system as a super user.

   [ 3] Insert the tape software diskette in drive A and close the
        diskette drive's door.

   [ 4] Create the tape software directory by entering:

        mkdir /usr/sys/tape

   [ 5] Change your current directory to the tape software directory:

        cd /usr/sys/tape

   [ 6] Copy the installation script file and getkey program from drive A:

        doscp    a:etmake .
        doscp -r a:getkey .

   [ 7] Make the script and getkey program executable:

        chmod +x etmake getkey

   [ 8] Run the installation script from a C-shell:

        csh etmake

   [ 9] The etmake script will perform the rest of the installation
        automatically:

        STEP  1: Get tape controller settings
        STEP  2: Select installation mode: step-by-step or auto
        STEP  3: Copy files from the software  diskette  to /usr/sys/tape
        STEP  4: Copy files from /usr/sys/conf directory to /usr/sys/tape
        STEP  5: Record the controller's settings in the /etc/rc file
        STEP  6: Get next major device number from /usr/sys/tape/master
        STEP  7: Create tape device files /dev/et*
        STEP  8: Add et   to /usr/sys/tape/master
        STEP  9: Add et   to /usr/sys/tape/xenixconf
        STEP 10: Add et.o to /usr/sys/tape/link_xenix
        STEP 11: Add et.o to /usr/sys/tape/makefile
        STEP 12: Run "make" to make a new kernel /usr/sys/tape/xenix
        STEP 13: Reboot the system

   [10] Reboot the system using the new kernel /usr/sys/tape/xenix:

        After you enter y to STEP 13, the system will prompt you:

        ** Hit Any Key to Reboot **

        If you do not respond within approximatly 23 seconds, XENIX
        will reboot by itself.

        After that, you will see the Boot prompt:

        Boot
        :

        Enter /usr/sys/tape/xenix after you see the Boot prompt:

        Boot
        : /usr/sys/tape/xenix

        You must enter the new kernel file name within 23 seconds after you
        see the Boot prompt, otherwise, XENIX will automatically boot up
        from the default kernel (/xenix).

   [11] Run the etbackup script to test the new kernel:

        /usr/sys/tape/etbackup

        The etbackup script runs the "tar" program to backup the entire
        root file system to the "/dev/et11" device.

6) Change Tape Controller Settings

   If there is a hardware conflict between the tape controller and an
   other device, the system may hang during the execution of the backup
   scripts. You can change the tape controller settings to avoid
   hardware conficts.

   You do not have to repeat all the installation procedures every
   time you change the tape controller settings.

   You only have to modify one line in the /etc/rc file and then
   reboot the system. The line is added to your /etc/rc file by
   the installation scripts to record the tape controller settings:

   /usr/sys/tape/tape DEV -l /usr/sys/tape/tape.com -c 1 PORT IRQ DMA

   Where DEV  is /dev/mt0 or /dev/et0;
         PORT is the port address in hexadecimal;
         IRQ  is the interrupt request line;
         DMA  is the direct memory access channel.

   The old /etc/rc file is renamed to /etc/rc.old if there is no
   existing file called /etc/rc.old.

   The /etc/rc file is executed by the system every time you boot up
   in the normal mode. If you boot up in mainenance mode, the system
   will not execute the /etc/rc file.

   If you want to boot up from the default kernel (/xenix) for any reason,
   you should restore the old /etc/rc file by executing the following
   commands before you reboot the system:

         mv /etc/rc /etc/rc.new
         mv /etc/rc.old /etc/rc

7) Move New Kernel to Root Directory

   After you have tested the new kernel, you can move it to the root
   directory by executing the following commands:

         mv /xenix /xenix.old
         mv /usr/sys/tape/xenix /xenix

   Keep in mind that if the boot up kernel file is not /xenix, then you
   have to specify the full path name of the boot up kernel file when you
   use the ps command. For example,

         ps -n /usr/sys/tape/xenix [OTHER OPTIONS ...]

   This is necessary, otherwise, the ps command may result in a seek error.

8) How to Use a Device Driver

   A XENIX device driver usually has one or more device files associated
   with it. A device file is a name that corresponds to  a device driver
   running under a particular hardware configuration and/or an operation
   mode. It is used as an identification to interface with the device.

   A device file is created by using the mknod command. The two installation
   scripts, mtmake and etmake, automatically create the tape device files
   (/dev/mt* and /dev/et*). Device files are usually created under the
   /dev subdirectory.

   Each device file contains three pieces of important information:
   the device type (character or block device), the major device number,
   and the minor device number.

   The operating system uses the device type and major device number
   to select the associated device driver (tape, disk, sio, ...).

   The minor device number is used by the device driver to select
   a particular hardware configuration and/or an operation mode.

   The following paragraphs show you how to access a device driver:

   [1] A user accesses a device driver by invoking an application program
       with a device file name.

       example: tar cvbf 20 /dev/mt11 /

   [2] An application program accesses a device driver by invoking kernel
       service routines with the given device file name.

       example: open("/dev/mt11", 1)

   [3] The kernel gets the device type, the major and the minor device
       numbers from the device file.

       example: /dev/mt11 (character device, major=17, minor=11)

   From the device file, the kernel selects a device driver based on the
   major device number and the device type. The minor device number informs
   the drivers to operate with the specified configuration and mode.

9) Restrictions

   The current release has the following restrictions:

   [1] It only supports the 286 version of SCO XENIX System V.

   [2] It is a character device; no block device is supported.

   [3] The buffer size must be a multiple of 512 bytes.

