annotate level1/cmds/scsitest.asm @ 2879:531841047512 lwtools-port

boot_scsi.asm: Fix SCSI ID when booting from SCSI Due to a typo it would probe for SCSI ID 4 instead of default 0 (or 8 for HDBDOS/SuperDriver).
author Tormod Volden <debian.tormod@gmail.com>
date Sun, 24 Nov 2013 16:08:53 +0100
parents f026e5eecfb0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2591
boisy
parents:
diff changeset
1 s********************************************************************
boisy
parents:
diff changeset
2 * scsitest - Test a SCSI device through the SS.DCmd call
boisy
parents:
diff changeset
3 *
boisy
parents:
diff changeset
4 * $Id$
boisy
parents:
diff changeset
5 *
boisy
parents:
diff changeset
6 * Edt/Rev YYYY/MM/DD Modified by
boisy
parents:
diff changeset
7 * Comment
boisy
parents:
diff changeset
8 * ------------------------------------------------------------------
boisy
parents:
diff changeset
9 * 1 2005/12/11 Boisy G. Pitre
boisy
parents:
diff changeset
10 * Created.
boisy
parents:
diff changeset
11
boisy
parents:
diff changeset
12 NAM scsitest
boisy
parents:
diff changeset
13 TTL Test a SCSI device through the SS.DCmd call
boisy
parents:
diff changeset
14
boisy
parents:
diff changeset
15 IFP1
boisy
parents:
diff changeset
16 USE defsfile
boisy
parents:
diff changeset
17 USE scfdefs
boisy
parents:
diff changeset
18 ENDC
boisy
parents:
diff changeset
19
boisy
parents:
diff changeset
20 tylg SET Prgrm+Objct
boisy
parents:
diff changeset
21 atrv SET ReEnt+rev
boisy
parents:
diff changeset
22 rev SET $00
boisy
parents:
diff changeset
23 edition SET 1
boisy
parents:
diff changeset
24
boisy
parents:
diff changeset
25 MOD eom,name,tylg,atrv,start,size
boisy
parents:
diff changeset
26
boisy
parents:
diff changeset
27 ORG 0
boisy
parents:
diff changeset
28 code RMB 1
boisy
parents:
diff changeset
29 lsn RMB 3
boisy
parents:
diff changeset
30 left RMB 2
boisy
parents:
diff changeset
31 path RMB 1
boisy
parents:
diff changeset
32 txbuff RMB 2048 to accomodate CD-ROM sector sizes
boisy
parents:
diff changeset
33 RMB 200
boisy
parents:
diff changeset
34 size EQU .
boisy
parents:
diff changeset
35
boisy
parents:
diff changeset
36 IntroM FCC /SCSI Direct Command Test/
boisy
parents:
diff changeset
37 FCB C$CR
boisy
parents:
diff changeset
38 StartM FCC /Sending START UNIT... /
boisy
parents:
diff changeset
39 StartML EQU *-StartM
boisy
parents:
diff changeset
40 Done FCC /Done!/
boisy
parents:
diff changeset
41 FCB C$CR
boisy
parents:
diff changeset
42 StartUnit FCB $1B,$00,$00,$00,$01,$00
boisy
parents:
diff changeset
43 StopM FCC /Sending STOP UNIT.../
boisy
parents:
diff changeset
44 StopML EQU *-StopM
boisy
parents:
diff changeset
45 StopUnit FCB $1B,$00,$00,$00,$00,$00
boisy
parents:
diff changeset
46 ReadM FCC /Testing READ... /
boisy
parents:
diff changeset
47 ReadML EQU *-ReadM
boisy
parents:
diff changeset
48
boisy
parents:
diff changeset
49 name FCS /scsitest/
boisy
parents:
diff changeset
50 FCB edition
boisy
parents:
diff changeset
51
boisy
parents:
diff changeset
52 start leay txbuff,u
boisy
parents:
diff changeset
53 lda #$08
boisy
parents:
diff changeset
54 sta <code
boisy
parents:
diff changeset
55 clr <lsn
boisy
parents:
diff changeset
56 clr <lsn+1
boisy
parents:
diff changeset
57 clr <lsn+2
boisy
parents:
diff changeset
58 lda #$01
boisy
parents:
diff changeset
59 sta <left
boisy
parents:
diff changeset
60 clr <left+1
boisy
parents:
diff changeset
61 l@ lda ,x+
boisy
parents:
diff changeset
62 cmpa #C$CR
boisy
parents:
diff changeset
63 beq ok@
boisy
parents:
diff changeset
64 cmpa #C$SPAC
boisy
parents:
diff changeset
65 beq ok@
boisy
parents:
diff changeset
66 sta ,y+
boisy
parents:
diff changeset
67 bra l@
boisy
parents:
diff changeset
68 ok@ ldd #'@*256+C$CR
boisy
parents:
diff changeset
69 std ,y
boisy
parents:
diff changeset
70 leax txbuff,u
boisy
parents:
diff changeset
71
boisy
parents:
diff changeset
72 lda #READ.
boisy
parents:
diff changeset
73 os9 I$Open
boisy
parents:
diff changeset
74 lbcs exit
boisy
parents:
diff changeset
75 sta path,u
boisy
parents:
diff changeset
76
boisy
parents:
diff changeset
77 leax IntroM,pcr
boisy
parents:
diff changeset
78 lda #1
boisy
parents:
diff changeset
79 ldy #100
boisy
parents:
diff changeset
80 os9 I$WritLn
boisy
parents:
diff changeset
81
boisy
parents:
diff changeset
82 bsr DoStartUnit
boisy
parents:
diff changeset
83 bcs exit
boisy
parents:
diff changeset
84
boisy
parents:
diff changeset
85 bsr DoReadSector
boisy
parents:
diff changeset
86 bcs exit
boisy
parents:
diff changeset
87
boisy
parents:
diff changeset
88 bsr DoStopUnit
boisy
parents:
diff changeset
89 bcs exit
boisy
parents:
diff changeset
90
boisy
parents:
diff changeset
91 bsr DoStartUnit
boisy
parents:
diff changeset
92 bcs exit
boisy
parents:
diff changeset
93
boisy
parents:
diff changeset
94 exitok clrb
boisy
parents:
diff changeset
95 exit os9 F$Exit
boisy
parents:
diff changeset
96
boisy
parents:
diff changeset
97 * Do START UNIT
boisy
parents:
diff changeset
98 DoStartUnit leax StartM,pcr
boisy
parents:
diff changeset
99 ldy #StartML
boisy
parents:
diff changeset
100 lda #1
boisy
parents:
diff changeset
101 os9 I$Write
boisy
parents:
diff changeset
102
boisy
parents:
diff changeset
103 leay StartUnit,pcr
boisy
parents:
diff changeset
104 lda path,u
boisy
parents:
diff changeset
105 ldb #SS.DCmd
boisy
parents:
diff changeset
106 os9 I$SetStt
boisy
parents:
diff changeset
107 bcs exit@
boisy
parents:
diff changeset
108 leax Done,pcr
boisy
parents:
diff changeset
109 ldy #100
boisy
parents:
diff changeset
110 lda #1
boisy
parents:
diff changeset
111 os9 I$WritLn
boisy
parents:
diff changeset
112 exit@ rts
boisy
parents:
diff changeset
113
boisy
parents:
diff changeset
114 * Do READ of sector
boisy
parents:
diff changeset
115 DoReadSector leax ReadM,pcr
boisy
parents:
diff changeset
116 lda #1
boisy
parents:
diff changeset
117 ldy #READML
boisy
parents:
diff changeset
118 os9 I$Write
boisy
parents:
diff changeset
119
boisy
parents:
diff changeset
120 ldd <lsn+1
boisy
parents:
diff changeset
121 addd #1
boisy
parents:
diff changeset
122 std <lsn+1
boisy
parents:
diff changeset
123 bcc w
boisy
parents:
diff changeset
124 inc <lsn
boisy
parents:
diff changeset
125 w lda <lsn
boisy
parents:
diff changeset
126
boisy
parents:
diff changeset
127 leay code,u
boisy
parents:
diff changeset
128 leax txbuff,u
boisy
parents:
diff changeset
129 lda <path
boisy
parents:
diff changeset
130 ldb #SS.DCmd
boisy
parents:
diff changeset
131 os9 I$SetStt
boisy
parents:
diff changeset
132 bcs exit@
boisy
parents:
diff changeset
133 leax Done,pcr
boisy
parents:
diff changeset
134 ldy #100
boisy
parents:
diff changeset
135 lda #1
boisy
parents:
diff changeset
136 os9 I$WritLn
boisy
parents:
diff changeset
137 exit@ rts
boisy
parents:
diff changeset
138
boisy
parents:
diff changeset
139 * Do STOP UNIT
boisy
parents:
diff changeset
140 DoStopUnit leax StopM,pcr
boisy
parents:
diff changeset
141 ldy #StopML
boisy
parents:
diff changeset
142 lda #1
boisy
parents:
diff changeset
143 os9 I$Write
boisy
parents:
diff changeset
144
boisy
parents:
diff changeset
145 leay StopUnit,pcr
boisy
parents:
diff changeset
146 lda path,u
boisy
parents:
diff changeset
147 ldb #SS.DCmd
boisy
parents:
diff changeset
148 os9 I$SetStt
boisy
parents:
diff changeset
149 bcs exit@
boisy
parents:
diff changeset
150 leax Done,pcr
boisy
parents:
diff changeset
151 ldy #100
boisy
parents:
diff changeset
152 lda #1
boisy
parents:
diff changeset
153 os9 I$WritLn
boisy
parents:
diff changeset
154 exit@ rts
boisy
parents:
diff changeset
155
boisy
parents:
diff changeset
156 EMOD
boisy
parents:
diff changeset
157 eom EQU *
boisy
parents:
diff changeset
158 END