w䩨PբԠ0 )i(Ԑ䩍 &01ԭ 9 9!! 9##`L`H ԍI h@$iskformatiertmit30%%$9QPUP6c "ibosoft #/-093(/07eitere)nformationenbei#/-093(/04elpppppppBPppppppppA&Important note: I would set the ATASPI manager now "Beta", but the tools still are in "Alpha" state. They work with my conf}iguration but may cause data loss (or even could damage your devices, who knows). Use it at your own risk. If you are rea}lly interested in developing one tool further on, you may get the sourcecode, just ask. ATASPI manager current V0.40 } ATTENTION !!! This will be the first version, allowing execution of SCSI commands requesting data transfer from host to tar}get (also including write commands). This may cause data-loss, if you dont know, what you are doing ! The manager will be }located from $8000 to $8800 . Until there is a clear solution, a JMP ($0002) instruction will call the manager. This i }s the init vector for RESET when booted from tape. As I guess, when using the BB you may use the harddisk, this is free at th }e moment. A JMP ($0002)+3 will reinitialize the manager. After being loaded the ATASPI manager scans the bus Ids 0..6 }LUN 0 for targets. When a target is found, some basic information is displayed: Idx Manufacturer Name of the target Cxxy }Sxy with Idx x.. number of target Id Cxxy xx..target class: 00-> harddisk, 05-> CD-ROM y.. "r" when medium is removabl}e Sxy x..ANSI SCSI revision, y.."c" when SCSI1 with CCS (common command set) support To execute an ATASPI-command, you m}ust set the DCB at $0300 as follows DDEVIC $70 for ATASPI manager DUNIT $01 ..(number of ATASPI manager, could be more t}han one f.e. SCSI, IDE) DCOMND $XX ..(command code) DSTATS $ ..before execution data direction $80 write, $40 read, after} execution error code DBUFR word ..adress of the databuffer DTIMO byte ..timeout value DBYTE word ..expected n}umber of bytes to transfer DAUX word ..adress of the SRB (SCSI request block) command codes for ATASPI - manager (as }suggested by original definition for ASPI from Adaptec) $00 host adapter inquiry $01 get device type $02 execute SCSI c}ommand $03 abort SCSI command $04 RESET SCSI device $05 set host adapter parameters $06 get disk drive information At }the moment only $02 and $04 are implemented yet. $02 could only execute commands that require no data to send to the target }at the moment. $04 support only bus RESET (I think have to stay for BB, cause there is no possibility to initiate a message }sequence by the BB without hardware modification) SRB byte TID target id byte CMDLEN command length (number of bytes fo}llow; 6, 10, 12 byte SCSI commands possible) 6-12 bytes SCSI command descritor block status codes After command execu}tion the command status and the number of bytes transferred by the manager are returned in DSTATS resp. DBYTE note that th}is is the current state to get an error with number > $80 and be informed about the reason a little bit. They may still chang}e to better fit into the common returned status code from Atari disk drives. 01 o.k. 8x by Software $82 wrong data dire}ction -> the target wants to transmit data in other direction as you defined with DSTATS value $83 target wants to send mess}age larger then 1 byte (could not handle yet) $84 unexpected busfree condition during command execution -> target had termin}ated command, maybe this command is not supported by the target $85 target requests more data to be transferred then you exp}ected, maybe blocksize is larger as you thought $8A timeout -> maybe no target connected at the ID $8E no bus-free after Re }set -> serious error $92 command not supported by ASPI manager (currently only $02 and $04) Cx remapped SCSI command stat!}us (status | %11000000) C0 GOOD -> redirectet to 01 C2 Check condition -> next command should be "request sense" C4 cond"}ition met C8 busy D0 intermediate (GOOD for command chains) E2 command terminated programs Note: These are not s#}tand-alone programs. You have to load the ATASPI manager first ! SCSI mon (monitor) current V0.12 First basic versio$}n, which will allow to execute up to 10 different commands. At this time you are not able to set up own commands, but could %}play around with the ATASPI a little bit. You should use that to test your configuration. This also gives you examples, how &}the different SCSI command blocks look like and how different targets react, if you want to write own applications. screen'}: C1 Id3 L06 D40 #00FF S01 #0082 12 00 00 00 FF 00 00 00 00 00 00 00 00: 00 00 00 00 00 00 00 00 00 00 00 descrip(}tion line 1 Cx number of command buffer (x 0..9) Idx number of target Id (x 0..6; first byte of SRB) Lxx length of SCSI co)}mmand in bytes (6, 0a, 0c; second byte of SRB) Dxx expected direction of data transfer (read..40, write..80; will be written*} to $0303 before command execution) #xxxx expected number of bytes to be transfered (will be written to $0308 before command+} execution) Sxx status of last command ($0303 after execution) #xxxx number of bytes transfered with last command ($0308 af,}ter execution) description line 2 the SCSI command descriptor block (byte 3-14 of SRB) description line 3-18 contents-} of data buffer commands 1..0 select command buffer 1..0 SHIFT 0..6 select taget Id0..Id6 ESCape leave program RETURN .}execute current SCSI command buffer M change display mod of data buffer ( 8 bytes hex/asc; 16 bytes hex; 32 bytes asc) C cl/}ear data buffer R bus reset; resets the SCSI bus < previous (logical block for read command; track for play audio) > next 0}(logical block for read command; track for play audio) predifined commands 0 request sense 1 inquiry 2 mode sense 3 1}read10 4 read capacity 5 6 read toc (audio CD only) 7 play track 1 (audio CD only) 8 PAUSE/RESUME (audio CD only, toggle2}s function with execution) 9 OPEN/LOAD (removeable media only, toggles function with execution) Note: An "request sense3}" command should be executed immediatly after the last command, when a status higher than $C0 was returned to check for the r4}eason of the error. That is why it is a good idea to set the Id of the request sense command (0) to the Id you are currently 5}playing with. This gives you fast access to request sense if an error occurs. The sense key are the lower 4 bits of byte n6}umber 2 (starting counting with zero as common in assembly language). ==================================================7}============================ Sense Key Description --------- ------------------------------------------------------------8}------- 0h NO SENSE. Indicates that there is no specific sense key information to be reported for the 9}designated logical unit. This would be the case for a successful command or a command that receive:}d CHECK CONDITION or COMMAND TERMINATED status because one of the filemark, EOM, or ILI bits is set to one. ;} 1h RECOVERED ERROR. Indicates that the last command completed successfully with some recovery action per<}formed by the target. Details may be determinable by examining the additional sense bytes and the i=}nformation field. When multiple recovered errors occur during one command, the choice of which error to report >}(first, last, most severe, etc.) is device specific. 2h NOT READY. Indicates that the logical unit a?}ddressed cannot be accessed. Operator intervention may be required to correct this condition. @} 3h MEDIUM ERROR. Indicates that the command terminated with a non- recovered error condition that was prA}obably caused by a flaw in the medium or an error in the recorded data. This sense key may also beB} returned if the target is unable to distinguish between a flaw in the medium and a specific hardware failure (sC}ense key 4h). 4h HARDWARE ERROR. Indicates that the target detected a non- recoverable hardware failD}ure (for example, controller failure, device failure, parity error, etc.) while performing the command or E} during a self test. 5h ILLEGAL REQUEST. Indicates that there was an illegal parameter in the F}command descriptor block or in the additional parameters supplied as data for some commands (FORMAT UNIT, SEARCHG} DATA, etc.). If the target detects an invalid parameter in the command descriptor block, then it H}shall terminate the command without altering the medium. If the target detects an invalid parameter in I} the additional parameters supplied as data, then the target may have already altered the medium. This sensJ}e key may also indicate that an invalid IDENTIFY message was received (5.6.7). 6h UNIT ATTENTION. InK}dicates that the removable medium may have been changed or the target has been reset. See 6.9 for more detailedL} information about the unit attention condition. 7h DATA PROTECT. Indicates that a command that reaM}ds or writes the medium was attempted on a block that is protected from this operation. The read oN}r write operation is not performed. ============================================================================== Sense O}Key Description --------- ------------------------------------------------------------------- 8h BLANK CHECK. InP}dicates that a write-once device or a sequential- access device encountered blank medium or format-defined end-ofQ}- data indication while reading or a write-once device encountered a non-blank medium while writing.R} 9h Vendor Specific. This sense key is available for reporting vendor specific conditions. Ah S} COPY ABORTED. Indicates a COPY, COMPARE, or COPY AND VERIFY command was aborted due to an error condition T}on the source device, the destination device, or both. (See 7.2.3.2 for additional information aboU}ut this sense key.) Bh ABORTED COMMAND. Indicates that the target aborted the command. The initiatorV} may be able to recover by trying the command again. Ch EQUAL. Indicates a SEARCH DATA command has satisfied an eW}qual comparison. Dh VOLUME OVERFLOW. Indicates that a buffered peripheral device has reX}ached the end-of-partition and data may remain in the buffer that has not been written to the medium. A RECOVERY} BUFFERED DATA command(s) may be issued to read the unwritten data from the buffer. Eh MZ}ISCOMPARE. Indicates that the source data did not match the data read from the medium. Fh RESERVED. [} = The fields 12($0c) and 13($0d) give additional information (sense code). Note that f.e. CDROM drives will reject \}every first command after POWER ON, bus reset or media change to inform the host, that the media may have changed. Please]} try, if the commands are working with your devices. Unfotunatly there is no saving possibility yet, so you have to write dow^}n the data, sorry. I am especially interested in getting to know, how Zip drives handle POWER ON state and OPEN/LOAD. _} Audio CD player current V 0.20 It scans for the first CD-ROM connected. Then scans the CD (if one is inserted) The n`}umbers printed are the tracks keyboard functions: P ... play/pause O ... open/load tray > ... a}play next track < .. play previus track ESC .. leave programm It is not veryb} complete yet, some basic features are still missing. But I have really no time left, to do that 8-(. FAQ Forget abouc}t the CD-Player, it is a nice toy, but gives no addional information to me. So you have to go into the deep, start the SCSI d}monitor and execute the commands. Be sure to send the command to the right target ! Have a look to the status code after e}the execution of a command. A value of 01 indicates, that everything worked fine from the look of the ATASPI manager. A cof}de of 8x indicates a software problem, where 8A is a simple timeout (maybe target not connected). A 84 indicates an "unexpectg}ed bus free", maybe the target will not support the command (f.e. play for harddisks). A code of Cx indicates a bus-probleh}m, you should send a "request sense" command ("0") to the same target directly now. If this was well performed (status 01), i}it gives the reason for the last problem. +LLBB ATASPI man V0.40 (c) 2000 by mscscanning Id# Id C SName: Rev:BB ATASPI man initializedk} at $& ؁UV6, ؁6 UV6 k0"` 0l}23$89@:   Q668 ؁UV] ؁  `L ؁6 Ł ؁Nm} ؁) r, ŁP ؁)H hc ŁLHJJJJ h) ii0HHI BhLVHDEhHI n}BLV 4 546 k045 0 89 ` Ȅ0`$: ؃9 598e223I  R,pp!0po}) Ȅ0`e223 RL@` pJ)L@$:P ҃9 p598e223I p R,pp!0p) Ȅ0`e2p}23 RL@` +9 92823 8 $ $28839` ҃)q ,pp0)qq} Ȅ0`qё2p0 )3`,pip8`38`2qѭp0 )3`,pip8`38`|`|`|r},p |`,pPhhL,pihhL`45p) ؃48e445Iȱ4q,pp 0p)`s}89`|ѩ r,pp Ȅ` 턥6qѢpѠ,pP#| ꄢ rʎpѩ89`pэqѠ`pʎp 鄈t},pp``,s`24358 9:`qё23`q`6 889 89`2848u}359`$`` L` Ȅ ```8`pٵHH`fghop}~TENTION !THv}IS WILL ERASE THE WHOLE CHIPWHEN YOU ARE 2 y وf0 A q  `jij `jhʎj ` YUf P. P  ` {>  f>x}   ` A0 q`lkj `kP { F  fF >`f6 {$ 6 y}  >0 P)66Ѣؠ `6f f ͋ P ` { *  f*L> T  L z}T PiPhhH hH P8PiH { "  h" > T " ͋ ׋P ͋ ׋ P ċ P ċ |}ll ċ ׋``& `hh` { ^  f^ >dId```}}ߩ ۩``  g"$H#H`P><.OM1؊2܊34567890!"#Ê$NJ%ˊ&ϊ)~}ӊHIBLVDEJBLV BLVK:L/ +8 i HJJJJ ͋h) ii0Hɛ}`HDEPIH B V`322Hɛ23H 勭2323Ε` } HHI BhLVp@P}ATASPI CDPLAY V0.20 (c) 2000 by mscno }CD-ROM drive foundno audio CDCD: Idlay/Pause pen prev next Û C$ K H}Z``_``Ja`J `J/`ȱ`Ƶ   y _ȱ}  P n ۶L J3 ʋ 5 + / ̊ R `l! `PQRSTUVW` 5 `hh` /` }ߩ۩שӍ / ̊`ީک֩ ҩΩp@ ( /` ڌ  }  i i  (  I8 KI / ̊ ` ` e HHH` } (  ̊L؈H ̊ ؈` (!  ̊L؈H ̊ ؈`Z׈> }m" DFW NEXTBLK-1 ASC "<" DFW PREVBLK-1 ASC "R" DFW SCR}ESET-1 ASC "M" DFW CHMODE-1 ASC "C" DFW CLBUFO-1 ASC "1" DFW CHCMD1-1 ASC "2" DFW CHCMD2-1 ASC "3" DFW CHCMD}3-1 ASC "4" DFW CHCMD4-1 ASC "5" DFW CHCMD5-1 ASC "6" DFW CHCMD6-1 ASC "7" DFW CHCMD7-1 ASC "8" DFW CHCMD8-1 } ASC "9" DFW CHCMD9-1 ASC "0" DFW CHCMD0-1 ASC "!" DFW CHID1-1 ASC !"! DFW CHID2-1 ASC "#" DFW CHID3-1 ASC "}$" DFW CHID4-1 ASC "%" DFW CHID5-1 ASC "&" DFW CHID6-1 ASC ")" DFW CHID0-1 BEFTBEND EQU * PAROUT LDA #LINEPAR}-1 STA ROWCRS NEWLINE LDA #'C AKOUT LDA CMD BCDOUT SPACEOUT LDA #'I AKOUT LDA #'d AKOUT LDA CMD ASL ASL ASL } ASL ADC #CMDTABLE:L STA BUFR LDA #CMDTABLE:H ADC #0 STA BUFR+1 LDY #0 LDA (BUFR),Y BCDOUT SPACEOUT LDA #'L AKOUT} LDY #1 LDA (BUFR),Y HEXOUT SPACEOUT LDA #'D AKOUT LDA CMD ASL ASL TAY PHA LDA CDCBTBL+1,Y HEXOUT SPACEOUT } LDA #'# AKOUT PLA TAY PHA LDA CDCBTBL+3,Y HEXOUT PLA TAY LDA CDCBTBL+2,Y HEXOUT SPACEOUT LDA #'S AKOUT L}DA DSTATS HEXOUT SPACEOUT LDA #'# AKOUT LDA DBYTHI HEXOUT LDA DBYTLO HEXOUT SPACEOUT NEWLINE RTS CMDOUT LDA }#LINECMD-1 STA ROWCRS NEWLINE LDA CMD ASL ASL ASL ASL CLC ADC #CMDTABLE+2:L STA BUFR LDA #CMDTABLE+2:H ADC #0 ST}A BUFR+1 LDA #$20 LDY #12 LINEOH LDA #$9B AKOUT LDA #$9B AKOUT RTS BUFOUT LDA #LINEBUF-1 STA ROWCRS NEWLINE LDA} #16 STA CURLINE LDA #DBUFR:L * LDA #$80 STA BUFR LDA #DBUFR:H STA BUFR+1 BUFO08 LDA PMODE LINEOUT DEC CURLINE BNE} BUFO08 RTS KCLOSE RTS LINEOUT PHA LDA BUFR HEXOUT LDA #': AKOUT SPACEOUT PLA CMP #0 BNE LINO50 LDY #8 LDA #$}20 LINEOH LDY #8 LINEOA LDA #8 BNE LINO60 LINO50 CMP #1 BNE LINO54 LDY #16 LDA #0 LINEOH LDA #16 BNE LINO60 L}INO54 CMP #2 BNE LINO58 LDY #32 LINEOA LDA #32 BNE LINO60 LINO58 LDA #0 LINO60 CLC ADC BUFR STA BUFR BCC LINO64 INC }BUFR+1 LINO64 LDA #$9B AKOUT RTS LINEOH STY ANZB STA SPACE LDY #0 LINO00 STY YTEMP LDA (BUFR),Y HEXOUT LDA SPACE }BEQ LINO02 AKOUT LINO02 LDY YTEMP INY CPY ANZB BNE LINO00 RTS LINEOA STY ANZB LDY #0 LINO34 STY YTEMP LDA (BUFR),Y } CMP #$1B BCC LINO42 CMP #$20 BCC LINO40 CMP #$7D BCC LINO42 CMP #$80 BCC LINO40 CMP #$9B BCC LINO42 CMP #$A0 BCC }LINO40 CMP #$FD BCC LINO42 LINO40 LDA #'. LINO42 AKOUT LDY YTEMP INY CPY ANZB BNE LINO34 LINO44 RTS AKIN LDX #$10 L}DA #0 STA ICBLL,X STA ICBLH,X LDA #7 STA ICCOM,X JMP CIOV KOPEN LDX #$10 LDA #KDEV:L STA ICBAL,X LDA #KDEV:H STA IC}BAH,X LDA #4 STA ICAUX1,X LDA #3 STA ICCOM,X JMP CIOV KCLOSE LDX #$10 LDA #12 STA ICCOM,X JMP CIOV KDEV ASC "K:" }DFB $9B NEWLINE LDA #$9B BNE AKOUT SPACEOUT LDA #$20 BNE AKOUT HEXOUT PHA LSR LSR LSR LSR BCDOUT PLA BCDOUT AND #}%00001111 CMP #10 BCC BCDO00 ADC #6 BCDO00 ADC #$30 AKOUT LDX BUFPOS STA LINBUF,X INC BUFPOS CMP #$9B BEQ AKO00 RTS }AKO00 LDX #0 LDA #LINBUF:L STA ICBAL,X LDA #LINBUF:H STA ICBAH,X LDA #80 STA ICBLH,X LDA #0 STA ICBLL,X LDA #9 STA }ICCOM,X JSR CIOV LDA #0 STA BUFPOS RTS LINBUF ASC " " ASC " } " BUFPOS DFB 0 OAKOUT PHA LDX #0 LDA #0 STA ICBLL,X STA ICBLH,X LDA #11 STA ICCOM,X PLA JMP CIOV CHR}OUT PHA TXA LDX #0 STA ICBAL,X TYA STA ICBAH,X LDA #0 STA ICBLH,X PLA STA ICBLL,X LDA #11 STA ICCOM,X JMP CIOV } TCOPY DFB $7D ASC "ATASPI MON V0.12 (c) 2000 by msc" DFB $9B DCBTMP DFB $70 DFB $1 DFB $2 DFB $40 DFW DBUFR DFB $1 } DFB 0 DFW 0 DFW 0 CMDTABLE EQU * CMDREQSE DFB 0 ; TID DFB 6 ; LEN DFB 3 ; DFB 0 DFB 0,0 DFB $FF DFB 0 DFB 0,0},0,0 DFB 0,0,0,0 CMDINQ DFB 0 ; TID DFB 6 ; LEN DFB $12 ; DFB 0 DFB 0,0 DFB $FF DFB 0 DFB 0,0,0,0 DFB 0,0,0,0 } CMDMODSN DFB 0 ; TID DFB 6 ; LEN DFB $1A ; DFB %00000000 DFB %00111111 DFB 0 DFB $FF DFB $00 DFB 0,0,0,0 DFB 0,0,0},0 CMDREAD DFB 0 ; TID DFB 10 ; LEN DFB $28 ; DFB %00000000 DFB 0,0,$80,0 DFB 0 DFB 0,1 DFB 0 DFB 0,0,0,0 CMDRDCAP} DFB 0 ; TID DFB 10 ; LEN DFB $25 ; DFB %00000000 DFB 0,0,0,0 DFB 0,0,0 DFB 0 DFB 0,0,0,0 CMD4 DFB 0 ; TID DFB 10 ; }LEN DFB $2A ; DFB %00000000 DFB 0,0,$80,0 DFB 0 DFB 0,1 DFB 0 DFB 0,0,0,0 CMDRDTOC DFB 0 ; TID DFB 10 ; LEN DFB $4}3 ; DFB %00000010 DFB 0,0,0,0,0 DFB 1,0 DFB 0 DFB 0,0,0,0 CMDPLTRK DFB 0 ; TID DFB 10 ; LEN DFB $48 ; DFB %00000000} DFB 0,0 DFB 1,0 DFB 0 DFB 1,0 DFB 0 DFB 0,0,0,0 CMDPAUSE DFB 0 ; TID DFB 10 ; LEN DFB $4B ; DFB %00000000 DFB 0,}0,0,0,0,0 DFB %00000000 DFB 0 DFB 0,0,0,0 CMDLOAD DFB 0 ; TID DFB 6 ; LEN DFB $1B ; DFB %00000000 DFB 0,0 DFB %0000}0010 DFB 0 DFB 0,0,0,0 DFB 0,0,0,0 CDCBTBL DFB 0 ;REQ SEN DFB $40 DFW $00FF DFB 0 ;INQ DFB $40 DFW $00FF DFB }0 ;MODE SENSE DFB $40 DFW $00FF DFB 0 ;READ DFB $40 DFW $0800 DFB 0 ;READ CAP DFB $40 DFW $0008 DFB 0 ; DFB }$80 DFW $0200 DFB 0 ;READ TOC DFB $40 DFW $00FF DFB 0 ;PLAY TRK DFB $40 DFW $0000 DFB 0 ;PAUSE/RESUME DFB $40 } DFW $0000 DFB 0 ;OPEN/LOAD DFB $40 DFW $0000 VARIAB EQU *IBfASPIPRG TXTB jBBAS040 COMB wCDPL020 COMB SCMON012COMBDSCMON15 SRC