	This is a quick hack to let users make use of acb-40XX boards.
These are bridge boards by Adaptec that allow use of RLL/MFM disks on
a SCSI bus. These brige boards are commonly found in 3Com network servers
of the late 1980's.

The acb-4070 is a SCSI <---> RLL bridge board which uses 2,7 RLL (at
26 sectors per track). The acb-4000A is a SCSI <--->MFM bridge board
that uses 18 (not 17!!!) sectors per track.

	The main problem with using these devices with Linux is that
they do not support the SCSI "INQUIRY" command. Linux uses this command
to poll what devices are on the SCSI bus at boot time. Any device that
can't respond to the inquiry command is ignored. Hence the acb-40XX
boards will not get detected at boot.  (Also note, that some intelligent
host firmware will not pass commands to devices that don't respond
to the SCSI host BIOS at boot -- instead they just automatically
return a selection-timeout for any SCSI commands directed to that
SCSI ID. If you have this feature, you will need to disable it.)

	We can easily get around this by "faking" the return values
from an inquiry command, so that Linux believes that a valid SCSI disk
is available. If the MFM/RLL drive is already low-level formatted with
the acb-40XX, then this is all that is required. After faking the INQUIRY
command, the disk/adaptor combo can be used with Linux without any 
additional modifications.

	The patch "patch1" does just that. It checks to see if the 
SCSI ID is that of the acb-40XX, and if so, it fakes an INQUIRY
command. By default, the SCSI ID of the acb-40XX is set to zero. You can
change this by editing "scsi.c" after applying the patch.

	The patch "patch2" disables the device and bus reset commands
that Linux will attempt to do when the acb-40XX holds the bus for
a long time diring the "FORMAT" command. Note that the acb-40XX holds the 
SCSI bus for the entire duration of the format command (more than 15 minutes 
for a big drive!) and Linux will not like this. Linux will try and reset the
device, and then the SCSI bus, which will kill the format.  We have to disable 
this in the kernel for the format to work. For normal operation, this
patch should not be needed. Only for formatting, will it be required.
Also note that the patch disables the abort/reset calls, but leaves the
printk() error messages in there. So you will see the error message about
aborting, but the abort will actually never have happened.

Installing:
===========

Do the following:

$ cd /usr/src
$ su
# rm -rf linux/
# tar -xvvpzf /home/my_name/linux-1.X.XX.tar.gz
# patch -p0 < /home/my_name/patch1
# patch -p0 < /home/my_name/patch2
# cd linux
# make config;make dep;make zlilo

This will generate and install a kernel that will look for the acb-40XX
card at the SCSI ID specified (default=0). If your SCSI ID is !=0 then
edit drivers/block/scsi.c to reflect the ID you have jumpered the acb-40XX
for. (after applying the patch)

Reboot with the newly made kernel, and look for the following at boot:

--------------
scsi0 : <Your host adaptor here>
scsi : 1 hosts.
  Vendor: ADAPTEC   Model: ACB-40XX          Rev: 1.00
  Type:   Direct-Access                      ANSI SCSI revision: 01
Detected scsi disk sda at scsi0, id 0, lun 0
scsi : detected 1 SCSI disk total.
--------------

You will also probably get a warning about /dev/sda (or /dev/sd?) having
a bad partition table -- this is because you haven't created one yet.

Now that you have a file descriptor (i.e. "/dev/sda") for the device,
you can send the fomat ioctl() to the drive via. the included format
program.

You will have to compile the "format" program, but before doing so,
you must enter your drive geometry parameters into the file "geometry.h".
If you fail to do so, the compiler will quit and tell you to edit the
file "geometry.h". After putting in your drive parameters (and removing
the #error line) you can type "make" to build your own custom "format"
program.

Now (as root) type "format /dev/sda" (or /dev/sd?) and go get a coffee.
This may take a while for big old MFM/RLL disks (>15 min). BE EXTRA
CAREFUL if you have other SCSI devices in the system. You do NOT
want to be sending the ioctl() to them by accident. The kernel will
think that there is an ACB-40XX at the ID value that is set in scsi.c
regardless of what is really there, be it another SCSI disk, CD-ROM,
floptical or whatnot.

Once the format is completed, run "fdisk /dev/sda" -- it will complain
about invalid data 0x6C in the partition table (0x6C is the data pattern
that the low level format writes all over the disk.) Before defining
partitions, go into the expert menu, and set the cyls, heads, and
sectors to the values used in "geometry.h". The value for sectors will
be 26 for the acb-4070 and 18 for the acb-4000. Return to the main fdisk
menu, and define your partitions. Write the partition table and you
are done. (BTW, the acb-40XX cards can handle > 1024 cyls without hassle.)

My results -- I get about 570kB/s off an old 1166 cyl, 7 head full height
drive with an acb-4070 and only about 8% CPU usage with a decent host
adaptor.

Two Drives:
===========

The acb-40XX boards are capable of supporting two MFM/RLL drives just
like any other standard MFM/RLL controller. The second drive will be
at lun 1 of the same SCSI ID. I only have one old drive, so I haven't
experimented with 2. You would probably have to fake an INQUIRY for
that lun as well. You should be able to use the same format code I have
written with 2 small changes. At lines 80, and 146, the lun is specified
as 0x00. (upper 3 bits). To specify lun=1, you will have to change both
of these to 0x20. (i.e. 00100000) -- Let me know if it works. Of course
you will have to re-edit "geometry.h" to reflect the settings of your
second drive and re-compile.

Other Tips:
===========

The acb-40XX boards do not support SCSI parity. If you are using the
Seagate driver, you will have to comment out the #define PARITY in the driver.

Jumpers A-B, C-D, E-F are the LSB --> MSB of the SCSI ID. All 3 off -> ID=0.

Jumper G-H sets the internal DMA-xfer rate -- off=fast (default)

Jumper I-J (if on) allows the acb-40xx to accept (and ignore) the extra
commands used by Xebec and wd units. (default=off)

Jumper K-L is not used.

Jumper M-N is for support of dain-bramaged drives that drop SEEK_COMPLETE
when switching heads (default=off)

Jumper O-P is for self diagnostics. With NO DRIVE *AND* NO SCSI BUS
connected, the red LED should start blinking on power up. If it stays on 
for about 6 seconds, and then blinks, then your acb is toasted.
Default position is off, obviously.

Write precomp jumpers -- acb-4000 only

	R-PU sets WPC off for both drives

	R-S sets WPC to start at the same cyl as the RWC set during format.

	R-T sets WPC on for all tracks of both drives.



Good luck,
Paul.
