Date : Fri, 16 Jan 2004 16:25:13 +0000
From : Jules Richardson <julesrichardsonuk@...>
Subject: Re: ADFS Winchester support
On Fri, 2004-01-16 at 12:46, Mark Usher wrote:
> Looking at the ADFS a little further, my very limited assembler
> capabilities lead me to believe that ADFS (1.50), is hard coded to
> access Device 0, and uses LUN 0 & 1 to differentiate between the two
> drives on an adaptec acb 4000/4070. This buggers things up somewhat when
> you want to have two SCSI devices directly on a host controller, unless
> you have the rare ability to set LUN on the drive.
Changing LUN on a SCSI drive is not an issue surely? The problem is that
the ADFS software always addresses *device* 0; the code is there to
change LUNs (or in theory stick with LUN 0 if addressing a SCSI disk -
although you'll probably find that the LUN can be anything when
addressing a single-LUN device, and it'll just ignore the LUN bits in
the command completely)
I'm used to programming SCSI devices under Unix, which hides the raw
device ID structure a little, so here's a little guesswork and
hand-waving. A SCSI command must presumably be wrapped in a header which
contains the target device number for that command (and likely the
device ID of the host adapter which sent the command). In fact not even
that - there'll presumably be 3 bits of data specifiying the target and
3 bits specifying the initiator. you just need to find out where those 3
bits speficying the target are set to 0 by ADFS, and change them to the
ID of the device that you want to access - the LUN for that device will
be a few bits in the byte following the command ID if I remember right.
> I think also that parity has to be disabled for the host adapter - which
> on many later drives is impossible to set.
I'm surprised it matters. Presumably parity info is returned as part of
the standard response from a target, along with a flag that says whther
parity is in use or not. The ADFS software will still read the "parity"
info and just ignore it. Ditto for commands sent from the host; the
parity flag will just be turned off. Of course, if all of this dates
before the common command set then maybe parity support only came in
then.
> I've just been tinkering the last few days, and I have attached a Maxtor
> 1.2GB SCSI-1 drive and am able to send commands and receive the
> answering data. Just time to sort out a program that will format many
> drives easily. I've already got the workings of something I did a while
> ago...
Well your more-modern disk will support a standard format device /
format track command so given you've got this far that shouldn't be too
difficult :)
> Still no success attaching two host adapters at the same time :-(
As said earlier, it's likely that when you send a command from the host
adapter, the device ID of the initiator is sent to the target device.
Even if the BBC can address two different adapters, the software sending
commands to the target device probably just hard-codes the SCSI device
ID of the host adapter, so having two adapters sending stuff with the
same ID might really confuse things.
Of course you shouldn't need two adapters anyway - if the Acorn adapter
is full SCSI rather than SASI, then it should be electrically compatible
with any SCSI device; it's only software that's dictating what device
IDs or LUNs things sit at. Seven devices and x number of LUNs should be
plenty (I can't remember how many LUNs can be addressed under one
device... 16 I *think*)
cheers
Jules