| 1 |
MTX -- SCSI Tape Attached Medium Changer Control Program |
| 2 |
|
| 3 |
Copyright 1997 by Leonard N. Zubkoff <[email protected]> |
| 4 |
|
| 5 |
VMS port, April 1998, by TECSys Development, Inc. |
| 6 |
|
| 7 |
SECTION I - Disclaimer |
| 8 |
|
| 9 |
These programs / ports are distributed in the hopes that they |
| 10 |
will be useful, but WITHOUT ANY WARRANTY; without even the |
| 11 |
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 12 |
|
| 13 |
While a significant amount of testing has been performed, and while |
| 14 |
TDI believes that this utility is safe, ONLY YOU can make that |
| 15 |
determination with respect to your environment. There are NO |
| 16 |
GUARANTEES WHATSOEVER that use of this program will not CRASH |
| 17 |
YOUR SYSTEM or worse. TDI disclaims any responsibility for any |
| 18 |
losses or damages from the use of this program. |
| 19 |
|
| 20 |
SECTION II - MTX program |
| 21 |
|
| 22 |
***CAUTIONS*** |
| 23 |
* Attempting to check the status of the drive with 1 tape manually |
| 24 |
inserted in the drive, and no magazine results in an unexpected |
| 25 |
SCSI status message. During porting of this program on a VS4000/90a, |
| 26 |
it is believed that the handling of this status message caused |
| 27 |
some sort of scsi state problem wherein subsequent accesses to |
| 28 |
the changer from normal MKDRIVER activity resulted in SCSI bus |
| 29 |
phase errors and an ultimate system failure. Power cycles of both |
| 30 |
the drive and the host were required to rectify the problem. |
| 31 |
|
| 32 |
Instructions: |
| 33 |
Read instructions (particularly section III below on the LDRSET utility). |
| 34 |
Compile (DEC C) and link image, copy to an appropriate install location |
| 35 |
Define a foreign symbol to access the program |
| 36 |
Use UNIX syntax to operate program per documentation (MTX.DOC) |
| 37 |
|
| 38 |
A descrip.mms file is provided if you have MMS or MMK installed. |
| 39 |
You can build everything from scratch by doing a MMK/FROM_SOURCE. This |
| 40 |
includes the LDRSET utility described below. You should be in the mtx |
| 41 |
root directory before you do this, NOT [.vms]. |
| 42 |
|
| 43 |
If you do not have or use MMS or MMK, I can highly recommend MMK as |
| 44 |
a great tool. It is available from www.madgoat.com. If you still do |
| 45 |
not have mmk or mms, a build.com is provided. Again, you should be in |
| 46 |
the mtx root directory before you do this, NOT [.vms]. |
| 47 |
|
| 48 |
Note: If you are on an alpha, the mms[k]-built exe files will be called |
| 49 |
.alpha_exe, not .exe. Adjust following instructions accordingly. |
| 50 |
|
| 51 |
Example: |
| 52 |
$ MMS/DESCRIP=[.VMS] !Or MMK, or @[.VMS]BUILD |
| 53 |
$ copy mtx.exe DISK$USERDISK:[USERS.FRED.UTILS]MTX |
| 54 |
$ MTX:==$DISK$USERDISK:[USERS.FRED.UTILS]MTX.EXE |
| 55 |
$ MTX -f MKA500 status |
| 56 |
--or-- |
| 57 |
$ DEFINE TAPE MKA500 |
| 58 |
$ MTX status |
| 59 |
|
| 60 |
Notes: |
| 61 |
* This code does NOT compile under VAX C... the only issue is VAX C's |
| 62 |
incorrect assertion that a 'boolean' is not an acceptable "expression" |
| 63 |
on either side of a || operator. If you are on VAX C - upgrade. If you |
| 64 |
really must... then use a ((int)...) around the left-hand-side |
| 65 |
of the lines where the compiler complains.... like so: |
| 66 |
if (((int)StorageElementFull[FirstStorageElementNumber]) || |
| 67 |
|
| 68 |
* The following symbols result from 'status' or element movement commands: |
| 69 |
MTX_DTE (Data Transfer Element) |
| 70 |
FULL:n (Full, with element 'n'... if n=0, then unknown ele) |
| 71 |
EMPTY |
| 72 |
MTX_MSZ (Magazine SiZe) |
| 73 |
n (Number of magazine slots) |
| 74 |
MTX_STE01 thru MTX_STExx (STorage Element, Max is MTX_MSZ) |
| 75 |
FULL |
| 76 |
EMPTY |
| 77 |
These will allow a DCL program to process the results |
| 78 |
of the status command |
| 79 |
|
| 80 |
* PHY_IO and DIAGNOSE are required to run the program as it stands |
| 81 |
today. Yes, the GKdriver dox say PHY_IO or LOG_IO.... MKdriver |
| 82 |
thinks otherwise. It wins. |
| 83 |
|
| 84 |
* The program IS equipped to handle being installed with DIAGNOSE |
| 85 |
and PHY_IO. A certain level of checking is done to see that the |
| 86 |
right type of device is being targeted for the autoloader manipulation |
| 87 |
SCSI commands. [see next item] |
| 88 |
|
| 89 |
* There is an indicator bit in DEVCHAR2 that indicates the presence of |
| 90 |
a loader on a tape. Unfortunately, it appears that the "knowledge" of |
| 91 |
whether a loader is present or not is hard-coded into mkdriver. This |
| 92 |
means that if you don't have the magic DEC rom's in your Archive |
| 93 |
loader, then the LDR bit is not set. This makes the LDR bit effectively |
| 94 |
useless unless you want to write a kernel dinker program you could |
| 95 |
run from startup to "fix" the DEVCHAR2 longword. (Incidentally, |
| 96 |
if you ship the autoloader commands at a TZ30 (a non-loader drive), |
| 97 |
the tz30 blows it off w/o any adverse side-effects - I would hope |
| 98 |
that other drives are as tolerant.) |
| 99 |
|
| 100 |
Because of this misfeature, the code to check the LDR flag in DEVCHAR2 |
| 101 |
is commented out. |
| 102 |
|
| 103 |
*See section below on LDRSET utility if you want to use this |
| 104 |
feature anyway (recommended). |
| 105 |
|
| 106 |
* This program has been tested under: |
| 107 |
VAX C V2.2, VAX/VMS 6.1, VS 4000/90A **with code modifications |
| 108 |
DEC C V5.2, VAX/VMS 6.1, VS 4000/90A |
| 109 |
DEC C V5.3, AXP/VMS 6.2, DEC3000-300X |
| 110 |
|
| 111 |
|
| 112 |
SECTION III - LDRSET Utility |
| 113 |
|
| 114 |
Description: |
| 115 |
This is a small KERNEL MODE utility program to go set or reset |
| 116 |
the DEV$M_LDR flag in UCB$L_DEVCHAR2 for a specified device. While |
| 117 |
a certain amount of checking is performed, and while the author |
| 118 |
believes that this utility is safe, ONLY YOU can make that |
| 119 |
determination with respect to your environment. There are NO |
| 120 |
GUARANTEES WHATSOEVER that use of this program will not CRASH |
| 121 |
YOUR SYSTEM or worse. TDI disclaims any responsibility for any |
| 122 |
losses or damages from the use of this program. |
| 123 |
|
| 124 |
With all that said... this utility can be used [example: system |
| 125 |
startup] to set the LDR flag for the autoloader tape device. |
| 126 |
With the loader flag properly set, you can re-enable the LDR |
| 127 |
check section in MTX and be fairly well certain that the MTX |
| 128 |
utility will not be used against a drive that is not a SCSI |
| 129 |
MAGTAPE with a LOADER attached. |
| 130 |
|
| 131 |
Instructions: |
| 132 |
Compile (DEC C ***ONLY***) the LDRSET C program |
| 133 |
|
| 134 |
Alpha: |
| 135 |
MACRO/MIGRATE the LDRUTIL.MAR program |
| 136 |
LINK LDRSET,LDRUTIL/SYSEXE to generate the image |
| 137 |
|
| 138 |
Vax |
| 139 |
MACRO the LDRUTIL.MAR program |
| 140 |
LINK LDRSET,LDRUTIL to generate the image |
| 141 |
|
| 142 |
[NOTE!!! ---> DO NOT USE RESULTING IMAGE IF THERE ARE ANY COMPILE OR LINK |
| 143 |
ERRORS!!!] |
| 144 |
|
| 145 |
Copy to an appropriate install location. |
| 146 |
|
| 147 |
Edit provided CLD file to reflect the installed location |
| 148 |
|
| 149 |
Use the following syntax: |
| 150 |
$ SET COMMAND LDRSET |
| 151 |
$ LDRSET MKA500: /SET !Sets the loader present flag on MKA500 |
| 152 |
$ LDRSET MKA500: /RESET !Clears the loader present flag on MKA500 |
| 153 |
|
| 154 |
Alpha example: |
| 155 |
$ CC/DECC/DEBUG/NOOPT LDRSET |
| 156 |
$ MACRO/MIGRATE LDRUTIL |
| 157 |
$ LINK LDRSET,LDRUTIL/SYSEXE |
| 158 |
|
| 159 |
Vax example: |
| 160 |
$ CC/DECC/DEBUG/NOOPT LDRSET |
| 161 |
$ MACRO LDRUTIL |
| 162 |
$ LINK LDRSET,LDRUTIL |
| 163 |
|
| 164 |
Common: |
| 165 |
$ copy LDRSET.EXE DISK$USERDISK:[USERS.FRED.UTILS]LDRSET.EXE |
| 166 |
$ copy LDRSET.CLD DISK$USERDISK:[USERS.FRED.UTILS]LDRSET.CLD |
| 167 |
$ EDIT DISK$USERDISK:[USERS.FRED.UTILS]LDRSET.CLD |
| 168 |
...change image sys$disk:[]ldrset line to : |
| 169 |
image DISK$USERDISK:[USERS.FRED.UTILS]LDRSET.EXE |
| 170 |
$ LDRSET MKA500 /SET |
| 171 |
|
| 172 |
* This program has been tested under: |
| 173 |
DEC C V5.2, VAX/VMS 6.1, VS 4000/90A |
| 174 |
DEC C V5.6, AXP/VMS 7.1, AS 1000A |
| 175 |
|