annotate 3rdparty/booters/boot_scsi.asm @ 749:ec1909ff0764

Updated Makefile
author boisy
date Wed, 08 Jan 2003 05:09:53 +0000
parents 3e3f1f79ba00
children 3be7fce1a56b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
68
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
1 ********************************************************************
392
df43967d6a46 Minor source changes, added boot_burke
boisy
parents: 68
diff changeset
2 * Boot - SCSI Boot Module
68
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
3 *
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
4 * $Id$
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
5 *
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
6 * This module allows booting from a hard drive that uses RGB-DOS
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
7 * and is controlled by a TC^3 or Ken-Ton SCSI controller.
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
8 *
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
9 * It was later modified to handle hard drives with sector sizes
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
10 * larger than 256 bytes, and works on both 256 byte and larger drives,
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
11 * so it should totally replace the old SCSI boot module.
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
12 *
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
13 * Instructions followed by +++ in the comment field were added for this fix.
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
14 *
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
15 * Ed. Comments Who YY/MM/DD
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
16 * ------------------------------------------------------------------
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
17 * 1 Original Roger Krupski distribution version
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
18 * 1b Added code to allow booting from any sector BGP 96/??/??
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
19 * size hard drive
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
20 * Merged Ken-Ton and TC^3 module source BGP 02/05/01
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
21
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
22
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
23 nam Boot
392
df43967d6a46 Minor source changes, added boot_burke
boisy
parents: 68
diff changeset
24 ttl SCSI Boot Module
68
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
25
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
26 ifp1
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
27 use defsfile
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
28 endc
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
29
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
30 tylg set Systm+Objct
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
31 atrv set ReEnt+rev
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
32 rev set 2
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
33 edition set 1
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
34
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
35 * The default SCSI ID is here
406
3362a5cd8259 Added SCSI ID 5 boot modules for TC^3 (for ZIP drives)
boisy
parents: 392
diff changeset
36 scsiid set %00000001
68
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
37
406
3362a5cd8259 Added SCSI ID 5 boot modules for TC^3 (for ZIP drives)
boisy
parents: 392
diff changeset
38 * Hard Disk Interface registers for the Ken-Ton and RGB HDI
68
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
39 ifne Kenton
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
40 dataport equ $FF74
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
41 status equ dataport+1
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
42 select equ dataport+2
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
43 reset equ dataport+3
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
44 endc
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
45
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
46 ifne TC3
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
47 dataport equ $FF74
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
48 status equ dataport+1
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
49 select equ dataport+1
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
50 endc
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
51
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
52 * Status register equates
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
53 req equ $01
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
54 busy equ $02
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
55 msg equ $04
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
56 cmd equ $08
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
57 inout equ $10
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
58 ack equ $20
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
59 sel equ $40
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
60 rst equ $80
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
61
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
62 *SCSI common command set
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
63 c$rstr equ 1
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
64 c$rdet equ 3
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
65 c$rblk equ 8
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
66 c$wblk equ 10
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
67
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
68 * Optional command
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
69 c$ststop equ $1b park head
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
70
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
71 * misc
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
72 errsta equ 2
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
73 bsybit equ 8
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
74
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
75 ****************************************************
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
76 bootdrv equ 0
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
77 ****************************************************
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
78
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
79 mod eom,name,tylg,atrv,start,size
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
80
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
81 * Data equates; subroutines must keep data in stack
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
82 v$cmd rmb 1
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
83 v$addr0 rmb 1
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
84 v$addr1 rmb 2
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
85 v$blks rmb 1
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
86 v$opts rmb 1
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
87 v$error rmb 4
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
88
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
89 blockloc rmb 2 pointer to memory requested
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
90 blockimg rmb 2 duplicate of the above
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
91 bootloc rmb 3 sector pointer; not byte pointer
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
92 bootsize rmb 2 size in bytes
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
93 size equ .
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
94
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
95 name fcs /Boot/
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
96 fcb edition
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
97
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
98 start clra
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
99 ldb #size
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
100 clean pshs a
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
101 decb
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
102 bne clean
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
103 tfr s,u get pointer to data area
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
104 pshs u save pointer to data area
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
105
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
106 lda #$d0 forced interrupt; kill floppy activity
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
107 sta $FF48 command register
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
108 clrb
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
109 pause decb
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
110 bne pause
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
111 lda $FF48 clear controller
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
112 clr $FF40 make sure motors are turned off
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
113 ifgt Level-1
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
114 sta $FFD9 fast clock
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
115 endc
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
116
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
117 * Recalibrate hard drive
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
118 lbsr restore
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
119
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
120 * Request memory for LSN0
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
121 ldd #1
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
122 os9 F$SRqMem request one page of RAM
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
123 bcs error
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
124 bsr getpntr
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
125
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
126 * Get LSN0 into memory
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
127 clrb MSB sector
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
128 ldx #0 LSW sector
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
129 bsr mread
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
130 bcs error
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
131 ldd bootsize,u
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
132 beq error
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
133 pshs d
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
134
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
135 * Return memory
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
136 ldd #$100
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
137 ldu blockloc,u
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
138 os9 F$SRtMem
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
139 puls d
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
140 ifgt Level-1
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
141 os9 F$BtMem
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
142 else
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
143 os9 F$SRqMem
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
144 endc
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
145 bcs error
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
146 bsr getpntr
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
147 std blockimg,u
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
148
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
149 * Get os9boot into memory
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
150 ldd bootsize,u
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
151 leas -2,s same as a PSHS D
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
152 getboot std ,s
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
153 ldb bootloc,u MSB sector location
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
154 ldx bootloc+1,u LSW sector location
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
155 bsr mread
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
156 ldd bootloc+1,u update sector location by one to 24bit word
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
157 addd #1
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
158 std bootloc+1,u
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
159 ldb bootloc,u
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
160 adcb #0
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
161 stb bootloc,u
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
162 inc blockloc,u update memory pointer for upload
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
163 ldd ,s update size of file left to read
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
164 subd #$100 file read one sector at a time
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
165 bhi getboot
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
166
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
167 leas 4+size,s reset the stack same as PULS U,D
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
168 ldd bootsize,u
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
169 ldx blockimg,u pointer to start of os9boot in memory
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
170 andcc #^Carry clear carry
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
171 rts back to os9p1
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
172
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
173 error leas 2+size,s
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
174 ldb #E$NotRdy drive not ready
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
175 rts
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
176
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
177 getpntr tfr u,d save pointer to requested memory
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
178 ldu 2,s recover pointer to data stack
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
179 std blockloc,u
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
180 rts
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
181
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
182 mread tstb
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
183 bne read10
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
184 cmpx #0
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
185 bne read10
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
186 bsr read10
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
187 bcc readlsn0
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
188 rts
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
189
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
190 readlsn0 pshs a,x,y
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
191 ldy blockloc,u
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
192 lda DD.Bt,y os9boot pointer
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
193 ldx DD.Bt+1,y LSW of 24 bit address
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
194 sta bootloc,u
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
195 stx bootloc+1,u
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
196 ldx DD.BSZ,y os9boot size in bytes
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
197 stx bootsize,u
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
198 clrb
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
199 puls a,x,y,pc
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
200
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
201 * Generic read
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
202 read10 lda #c$rblk
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
203 bsr setup
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
204 bra command
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
205
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
206 setup pshs b
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
207 sta v$cmd,u
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
208 stb v$addr0,u
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
209 stx v$addr1,u
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
210 ldb #1
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
211 stb v$blks,u
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
212 clr v$opts,u
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
213 puls b,pc
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
214
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
215 wakeup ldx #0
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
216 wake lda status
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
217 bita #busy+sel
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
218 beq wake1
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
219 leax -1,x
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
220 bne wake
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
221 bra wake4
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
222 wake1 bsr wake3
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
223 lda #scsiid
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
224 sta dataport
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
225 bsr wake3
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
226 sta select
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
227 ldx #0
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
228 wake2 lda status
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
229 bita #busy
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
230 bne wake3
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
231 leax -1,x
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
232 bne wake2
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
233 wake4 leas 2,s
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
234 comb
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
235 ldb #E$NotRdy
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
236 wake3 rts
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
237
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
238 command bsr wakeup
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
239 leax v$cmd,u
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
240 bsr send
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
241 bsr waitrq
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
242 bita #cmd
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
243 bne getsta
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
244 ldx blockloc,u
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
245 bsr read
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
246 getsta bsr instat
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
247 bita #bsybit
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
248 bne command
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
249 bita #errsta
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
250 beq done
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
251 comb
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
252 done rts
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
253
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
254 send bsr waitrq
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
255 bita #cmd
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
256 beq done
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
257 bita #inout
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
258 bne done
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
259 lda ,x+
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
260 sta dataport
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
261 bra send
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
262
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
263 waitrq pshs b,x
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
264 wait10 lda status
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
265 bita #req
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
266 beq wait10
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
267 puls b,x,pc
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
268
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
269 * Patch to allow booting from sector sizes > 256 bytes - BGP 08/16/97
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
270 * We ignore any bytes beyond byte 256, but continue to read them from
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
271 * the dataport until the CMD bit is set.
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
272 read
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
273 * next 2 lines added
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
274 clrb +++ use B as counter
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
275 read2
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
276 bsr waitrq
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
277 bita #cmd
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
278 bne done
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
279 lda dataport
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
280 sta ,x+
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
281 * next line commented out and next 8 lines added
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
282 * bra read
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
283 incb +++
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
284 bne read2 +++
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
285 read3
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
286 bsr waitrq +++
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
287 bita #cmd +++
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
288 bne done +++
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
289 lda dataport +++
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
290 bra read3 +++
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
291
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
292 instat bsr waitrq
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
293 lda dataport
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
294 anda #%00001111
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
295 pshs a
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
296 bsr waitrq
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
297 clra
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
298 sta dataport
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
299 puls a,pc
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
300
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
301 restore lda #c$rstr
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
302 clrb
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
303 ldx #0
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
304 lbsr setup
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
305 clr v$blks,u
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
306 bra command
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
307
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
308 ifgt Level-1
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
309 * Fillers to get to $1D0
459
3e3f1f79ba00 Sources now use 'fill' pseudo-op to fill out for L2 modules
boisy
parents: 406
diff changeset
310 Pad fill $39,$1D0-3-*
68
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
311 endc
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
312
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
313 emod
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
314 eom equ *
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
315 end
8ffca4533723 Merged boot_kenton and boot_tc3 into boot_scsi
boisy
parents:
diff changeset
316