Date : Fri, 10 Nov 2006 00:42:55 +0000
From : jgh@... (Jonathan Graham Harston)
Subject: Some ADFS / WDC 1770 questions.
>Message-ID: <002601c70437$98af34c0$6402a8c0@...>
"BRAHMS" <dominic@...> wrote:
> 2) When accessing the disc using OSWORD&72 I have to add 4 to the drive
> number (when mounted on drive 0) to access the floppy drive 0 ( is this
> "rule" correct?)
Drive 4/5/6/7 are always floppy drives 0/1/2/3
If (configured HARD) AND (hard drive interface present) THEN
Drive 0/1/2/3 are hard drive 0/1/2/3
ELSE
Drive 0/1/2/3 are mapped onto 4/5/6/7
In other words, with no hard drive present, drive 0 is the first
floppy drive, as is drive 4. With a hard drive present, drive 0 is
the first hard drive.
This is oddly the opposite way around to 32-bit ADFS, where
0/1/2/3 are floppies and 4/5/6/7 are hard drives.
> 3) In the documentation it indicates that the drive in the OSWORD
> control block is ORed with the "current" drive number - what is the best
> thing to do here if I want to read / write sectors on drive 0 if drive 4
> is current - do I really have to change drives to 0 - if so how?
Yes, that is (unfortunately) correct. The drive accessed by OSWORD
&72 is the specified drive ORed with the current drive. Most
annoying.
It forces you to *MOUNT 0 before using OSWORD &72 properly, which
forces you to have a valid disk in drive 0.
I use the following code when starting programs:
ok%=TRUE:ON ERROR ok%=FALSE
IF ok% THEN fs%=FNfs:IF fs%<>8 THEN *FADFS
IF ok% THEN *MOUNT 0
IF fs%<>8 THEN OSCLI "FX143,18,"+STR$fs%
and the following code when calling OSWORD &72:
fs%=FNfs:IF fs%<>8 THEN *FADFS
set up control block
A%=&72:CALL &FFF1
IF fs%<>8 THEN OSCLI "FX143,18,"+STR$fs%
and...
DEFFNfs:LOCA A%,Y%,E%:=(USR&FFDA)AND&FF
Richard Gellman wrote:
> I've not seen this. IIRC, the setup block for OSWORD &72 is reminiscent
> of a SCSI command block. Certainly functions &08 and &0A (read bytes,
OSWORD &72 /is/ a SCSI command block. The disk address is
backwards, as in a SCSI command block. The command bytes are SCSI
command bytes, and the OSWORD &72 code is descibed as the 'SCSI
subsystem'.
The SCSI subsystem passes the OSWORD &72 command block directly to
the SCSI interface when accessing hard drives. When accessing
floppy drives or IDE drives the subsystem translates the SCSI
command into the relevant commands to send to the floppy or IDE
interface.
--
J.G.Harston - jgh@... - mdfs.net/User/JGH
NOBODY expects the MACRO ARGUMENT INQUISITION! Our chief weapon is
unexpected addressing modes... unexpected addressing modes and local
branches out of range. Our two weapons are unexpected addressing modes and
local branches out of range and quoted argument lists. Our *three* weapons
are unexpected addressing modes, local branches out of range, quoted
argument lists, and an almost fanatical devotion to the pope. *Amongst* our
weapons are such elements as unexpected addressing modes, local branches out
of range... I'll come in again.