OSWORD &72 - SCSI/Double Density Disk Access ============================================ OSWORD &72 passes a SCSI-style control block to the floppy or hard disk controller to access double density floppies or hard drives. On extry: XY?0 =0, holds result on exit XY!1 =address XY?5 =command XY?6 =drive number in b5-b7, sector b16-b20 in b0-b4 XY?7 =sector middle byte, XY?8 =sector low byte, XY?9 =number of sectors, XY?10=n/u, XY!11=data length if XY+9=0. This is a standard SCSI command block. The drive number in XY?6 is ORed with the current drive. If ADFS is not selected when the call is made, ADFS is selected. Consequently, any code that calls OSWORD &72 must remember the current filing system and restore it afterwards. Commands ======== &00=Test drive ready &01=Seek track 0 &03=Request status &08=Read data &0A=Write data &0B=Seek track &1B=Stop/Start drive; stop if XY?9=0, start if XY?9=1 Results ======= &00=Ok &02=Drive door open &03=Media error, eg disk dirty &05=Bad SCSI command &04=Not ready &40=Write protected &48=CRC error &50=Sector not found &60=Bad command &61=Bad address &63=Volume error &65=Bad drive &6F=Abort The result byte can be preloaded with a value to return if no OSWORD &72 routine exists. For instance, preloading the result with &00 makes all such failed calls appear to succeed, preloading with &50 makes all calls appear to return 'Sector not found'. Coding ====== The following routine can be used to perform an OSWORD &72 call. It requires X%=>15-byte control block, Y%=X%DIV256. DEFFNscsi(cmd%,addr%,num%,sect%,drv%):LOCALfs% fs%=FNfs:IFfs%<>8:*FADFS 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%:X%!11=0 A%=&72:CALL&FFF1:A%=?X%:IFfs%<>8:OSCLI"FX143,18,"+STR$ fs% =A% DEFFNfs:LOCALA%,E%,Y%:=(USR&FFDA)AND&FF Direct Cumana Electron DFS disk access ====================================== The Cumana Double Densisty Electron DFS implments the following OSWORD &72 call: On extry: XY?0=control byte: b0: side select 0,1 b1: drive 1 select b2: drive 2 select b3: 0=double density, 1=single density XY?1=command XY?2=track XY?3=sector XY?4=data XY!5=address XY?9=0, holds result on exit Commands ======== &04=Seek track zero &14=Seek track &50=Step in one track &70=Step out one track &80=Read sector &A0=Write sector b0-b1=step rate 6ms/12ms/20ms/30ms Results ======= XY?2=new track XY?3=new sector XY?9=result &00=Ok