
	wavms - UNIBUS/Q-bus ATA (IDE) HDD software for VAX/VMS
		     operating system.

*******************************************************************************
* Copyright (c) 1999 by Dmitry Pryanishnikov, Dnipropetrovsk, Ukraine.        *
*                                                                             *
* Permission is granted to any individual or institution to use, copy,        *
* or redistribute this software so long as all of the original files          *
* are included, that it is not sold for profit, and that this copyright       *
* notice is retained.                                                         *
*                                                                             *
* This project has been provided 'as is'. Any expressed or implied warranties * 
* are disclaimed. In no event shall I be liable for any direct, indirect or   *
* other damages arising out of the use of this project, etc. However I am     *
* interested in feedback from the users of this technology, and any           *
* suggestions are welcome.                                                    *
*******************************************************************************

 The software consists of the following files:
 
  patchvmb.c - program for putting ATA HDD boot driver into VMB
  wa0boo.cmd - command file example for booting VMS on VAX-11/730 from ATA HDD
  wabtdrivr.mar - ATA HDD boot driver (for VMB) source text
  wadriver.mar - ATA HDD driver for VAX/VMS

This software should work with VAX/VMS system version 4 (any minor version
number). I cannot provide support for more recent VMS versions because I
haven't them, sorry.


             Support for ATA HDD as a data (non-system) disk

  In order to support HDD(s) via ATA adapter in VAX/VMS system you should build
device driver first. To do it, just issue the following commands (place
wadriver.mar into default directory before):

$ MAC WADRIVER+SYS$LIBRARY:LIB/LIB
$ LINK/NOTRA WADRIVER,SYS$INPUT:/OPT,SYS$SYSTEM:SYS.STB/SEL
BASE=0
(press CTRL-Z here)
$

It will create WADRIVER.EXE, then you should move it to SYS$SYSTEM: and
issue commands to load driver and connect device(s). For example, to connect
ATA HDD master drive (unit 0) on first channel on VAX-11/730, one should issue

$ MCR SYSGEN
SYSGEN> CONN WAA0/ADA=3/CSR=%o771200/VEC=%o120

Then refere WA0: disk as usually. This driver (unlike RSX one) does not support
disk partitions (it isn't clear to me how to clone UCB in VMS correctly, this
may be VMS version-specific task).


                 Support for ATA HDD as a system disk

  You can use ATA HDD as a system disk. In order to do it, you have to create
a patched copy of VMB.EXE that came with your system. Patch can be installed
with the help of a special utility (see patchvmb.c). This program has been
tested with VAXC and DECC compilers, and even with GNU C compiler on FreeBSD
(i386). It is written in pure ANSI code, so it should work with any 
ANSI-compliant compiler/library. Program parses built-in WABTDRIVR assembly 
listing (yes, you can change wabtdrivr.mar, get MACRO-32 assembly listing,
carefully process it with text editor to get rid of anything except generated
code column, convert them to string array and replace it within patchvmb.c).
Then it asks file specification of original VMB.EXE, then specification for
modified copy of VMB. Then program reads original VMB looking for string
"DLDRIVER.EXE". It is known that code for DQ (IDC) boot driver is between
this string and the next string, "DQDRIVER.EXE". So program just looks then
for the latter, determines will new code fit over the old DQBTDRIVR code,
and if so just overlays DQ code with WA code and WADRIVER.EXE name - very
easy ;) This hack has been tested with VMB from VMS 4.3 and 4.7 and worked.
Then put modified VMB to VAX console media... Next steps are VAX-dependent.
We only know how to boot on 11/730 so see wa0boo.cmd file for example.
NOTE: you should be able to pass drive geometry to the boot driver
in high-order word of R3. So, format of R3 for booting from WA is following:

+-------------------------------------------------------------------------+
| Number of heads | Number of sectors |  0 for master or 1 for slave unit |
| (per cylinder)  |    (per track)    |                                   |
+-------------------------------------------------------------------------+
 31             24 23               16 15                                0

So you should create new command file for each bootable HDD. Sorry, autodetect
code won't fit within VMB.
NOTE: writing system dump is NOT supported by this boot driver, it will just
HALT in case you'll try to get dump.

dmitry@digital.dp.ua

