<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Tue, 05 Jun 2007 17:12:47 +0100
From   : jgh@... (Jonathan Graham Harston)
Subject: PC/Beeb serial cable woe

Jules Richardson wrote:
> rather than the FDC - far as I know the Winchester access code is
undocumented
> though (and normally hidden behind ADFS - which is no good for transferring
> raw sectors) so it's probably non-trivial to do.
 
It is documented, Master Reference Manual Part One page J11-12
to start with.
 
A%=&72
XY=>control block
X%?0=0, returned result
X%!1=adddress
X%?5=command, &08=read, &0A=write
X%?6=sector number b16-b21, b5-b7=drive number
X%?7=sector number b8-b15
X%?8=sector number b0=b7
X%?9=sector count
X%?10=0
X%!11=byte count
 
Results can include:
  &00 Ok
  &04 Not ready
  &25 ?
  &40 Write protected
  &48 CRC error
  &50 Sector not found
  &60 Bad command
  &61 Bad sector address
  &63 Volume error
  &65 Bad drive
  &6F Abort
 
NOTE! The sector number is passed big-endian! That is not a typo!
 
The following function will do the call for you. It requires
X%=>15-byte control block, Y%=X%DIV256.
 
DEFFNscsi(cmd%,addr%,num%,sect%,drv%):LOCAL fs%
fs%=FNfs:IF fs%<>8:*FX143,18,8
X%?0=0:X%!1=addr%:X%?5=cmd%:X%?6=drv%*32+((sect%AND&1F0000)DIV65536)
X%?7=((sect%AND&FF00)DIV256):X%?8=sect%:X%!9=num%DIV256:X%!11=num%
A%=114:CALL&FFF1:A%=?X%:IF fs%<>8:OSCLI"FX143,18,"+STR$ fs%
=A%
DEFFNfs:LOCAL A%,E%,Y%:=(USR&FFDA)AND&FF
 
-- 
J.G.Harston - jgh@...                - mdfs.net/User/JGH
BBC IDE Hard Drive Interface - http://mdfs.net/Info/Comp/BBC/IDE
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>