Mercurial > hg > Members > kono > nitros9-code
annotate 3rdparty/drivers/disto/rampak.asm @ 1963:4b599621c682
Moved to using new boot_common/hardware dependent boot system
author | afra |
---|---|
date | Wed, 04 Jan 2006 14:20:25 +0000 |
parents | 71cac8cb5027 |
children | f91dc5c378f6 |
rev | line source |
---|---|
352 | 1 ******************************************************************** |
2 * RamPak - Disto RAM Pak device driver | |
3 * | |
4 * $Id$ | |
5 * | |
6 * Ed. Comments Who YY/MM/DD | |
7 * ------------------------------------------------------------------ | |
8 * 2 Original Disto version by Brian Lantz BL | |
9 * 3 Removed copyright info, removed useless BGP 98/10/20 | |
10 * register saves, optimized, changed port | |
11 * address in descriptor to hold port address | |
12 * of RAM pak instead of MPI. | |
13 | |
14 nam RamPak | |
15 ttl Disto RAM Pak device driver | |
16 | |
17 * Disassembled 98/04/20 09:57:05 by Disasm v1.5 (C) 1988 by RML | |
18 | |
19 ifp1 | |
20 use defsfile | |
21 use rbfdefs | |
22 endc | |
23 | |
24 tylg set Drivr+Objct | |
25 atrv set ReEnt+rev | |
26 rev set $01 | |
27 edition set 3 | |
28 | |
29 mod eom,name,tylg,atrv,start,size | |
30 | |
31 * RBF Data Area | |
32 rmb 129 | |
33 | |
34 * Free for driver use | |
35 ORGSlot rmb 1 | |
36 | |
37 size equ . | |
1181 | 38 |
39 fcb DIR.+SHARE.+PEXEC.+PREAD.+PWRIT.+EXEC.+UPDAT. | |
352 | 40 |
41 name fcs /RamPak/ | |
42 fcb edition | |
43 * fcc /(C) 1985 BRIAN A. LANTZ/ | |
44 * fcb $0D | |
45 * fcc /LICENSED TO DISTO/ | |
46 | |
47 start lbra Init | |
48 lbra Read | |
49 lbra Write | |
50 lbra GetStat | |
51 lbra SetStat | |
52 lbra Term | |
53 | |
54 * Init | |
55 * | |
56 * Entry: | |
57 * Y = address of device descriptor | |
58 * U = address of device memory area | |
59 * | |
60 * Exit: | |
61 * CC = carry set on error | |
62 * B = error code | |
63 * | |
64 Init ldd #($FF*256)+3 | |
65 stb V.NDRV,u | |
66 leax DRVBEG,u | |
67 * For each B, compute total sectors... | |
68 Init010 sta V.TRAK,x | |
69 pshs b,a | |
70 lda IT.CYL+1,y | |
71 ldb IT.SCT+1,y | |
72 mul | |
73 std DD.TOT+1,x | |
74 puls b,a | |
75 leax DRVMEM,x | |
76 decb | |
77 bne Init010 | |
78 rts | |
79 | |
80 * Write | |
81 * | |
82 * Entry: | |
83 * B = MSB of the disk's LSN | |
84 * X = LSB of the disk's LSN | |
85 * Y = address of path descriptor | |
86 * U = address of device memory area | |
87 * | |
88 * Exit: | |
89 * CC = carry set on error | |
90 * B = error code | |
91 * | |
92 Write pshs cc | |
93 bsr SlctSlot | |
94 WritLoop lda ,x+ | |
95 stb ,y | |
96 sta 3,y | |
97 incb | |
98 bne WritLoop | |
99 bra RestSlot | |
100 | |
101 * Read | |
102 * | |
103 * Entry: | |
104 * B = MSB of the disk's LSN | |
105 * X = LSB of the disk's LSN | |
106 * Y = address of path descriptor | |
107 * U = address of device memory area | |
108 * | |
109 * Exit: | |
110 * CC = carry set on error | |
111 * B = error code | |
112 * | |
113 Read cmpx #$0000 | |
114 beq ReadLSN0 | |
115 | |
116 ReadSect pshs cc | |
117 bsr SlctSlot | |
118 ReadLoop stb ,y | |
119 lda 3,y | |
120 sta ,x+ | |
121 incb | |
122 bne ReadLoop | |
123 | |
124 * Restore the original MPI slot value we saved off | |
125 RestSlot lda >ORGSlot,u | |
126 sta >MPI.Slct | |
127 puls cc | |
128 clrb | |
129 rts | |
130 | |
131 * Read LSN0 into our path descriptor | |
132 ReadLSN0 pshs y | |
133 bsr ReadSect | |
134 puls y | |
135 ldx PD.BUF,y | |
136 lda <PD.DRV,y | |
137 leay DRVBEG,u | |
138 ldb #DRVMEM | |
139 mul | |
140 leay d,y | |
141 ldb #DD.SIZ-1 | |
142 LSN0Loop lda b,x | |
143 sta b,y | |
144 decb | |
145 bne LSN0Loop | |
146 rts | |
147 | |
148 | |
149 * This routine selects the MPI slot | |
150 * Exit: X = address of path descriptor buffer | |
151 SlctSlot orcc #IntMasks mask interrupts | |
152 lda >MPI.Slct get current selected slot | |
153 sta >ORGSlot,u save off | |
154 lda PD.DRV,y get drive no. | |
155 ldb #$11 | |
156 mul multiply drive no. times $11 | |
157 stb >MPI.Slct set new MPI slot no. | |
158 tfr x,d | |
159 ldx PD.BUF,y load X with address of path buffer | |
1900
71cac8cb5027
Driver now properly accesses hardware registers via Y instead of embedding
boisy
parents:
1181
diff
changeset
|
160 ldy V.PORT,u get HW addr |
71cac8cb5027
Driver now properly accesses hardware registers via Y instead of embedding
boisy
parents:
1181
diff
changeset
|
161 sta 2,y write LSN hi byte to PAK |
71cac8cb5027
Driver now properly accesses hardware registers via Y instead of embedding
boisy
parents:
1181
diff
changeset
|
162 stb 1,y write LSN lo byte to PAK |
352 | 163 clrb |
164 rts | |
165 | |
166 * GetStat | |
167 * | |
168 * Entry: | |
169 * A = function code | |
170 * Y = address of path descriptor | |
171 * U = address of device memory area | |
172 * | |
173 * Exit: | |
174 * CC = carry set on error | |
175 * B = error code | |
176 * | |
177 GetStat comb | |
178 ldb #E$UnkSvc | |
179 rts | |
180 | |
181 SetStat | |
182 * Term | |
183 * | |
184 * Entry: | |
185 * U = address of device memory area | |
186 * | |
187 * Exit: | |
188 * CC = carry set on error | |
189 * B = error code | |
190 * | |
191 Term clrb | |
192 rts | |
193 | |
194 emod | |
195 eom equ * | |
196 end |