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 ldy V.PORT,u
|
|
95 WritLoop lda ,x+
|
|
96 stb ,y
|
|
97 sta 3,y
|
|
98 incb
|
|
99 bne WritLoop
|
|
100 bra RestSlot
|
|
101
|
|
102 * Read
|
|
103 *
|
|
104 * Entry:
|
|
105 * B = MSB of the disk's LSN
|
|
106 * X = LSB of the disk's LSN
|
|
107 * Y = address of path descriptor
|
|
108 * U = address of device memory area
|
|
109 *
|
|
110 * Exit:
|
|
111 * CC = carry set on error
|
|
112 * B = error code
|
|
113 *
|
|
114 Read cmpx #$0000
|
|
115 beq ReadLSN0
|
|
116
|
|
117 ReadSect pshs cc
|
|
118 bsr SlctSlot
|
|
119 ldy V.PORT,u
|
|
120 ReadLoop stb ,y
|
|
121 lda 3,y
|
|
122 sta ,x+
|
|
123 incb
|
|
124 bne ReadLoop
|
|
125
|
|
126 * Restore the original MPI slot value we saved off
|
|
127 RestSlot lda >ORGSlot,u
|
|
128 sta >MPI.Slct
|
|
129 puls cc
|
|
130 clrb
|
|
131 rts
|
|
132
|
|
133 * Read LSN0 into our path descriptor
|
|
134 ReadLSN0 pshs y
|
|
135 bsr ReadSect
|
|
136 puls y
|
|
137 ldx PD.BUF,y
|
|
138 lda <PD.DRV,y
|
|
139 leay DRVBEG,u
|
|
140 ldb #DRVMEM
|
|
141 mul
|
|
142 leay d,y
|
|
143 ldb #DD.SIZ-1
|
|
144 LSN0Loop lda b,x
|
|
145 sta b,y
|
|
146 decb
|
|
147 bne LSN0Loop
|
|
148 rts
|
|
149
|
|
150
|
|
151 * This routine selects the MPI slot
|
|
152 * Exit: X = address of path descriptor buffer
|
|
153 SlctSlot orcc #IntMasks mask interrupts
|
|
154 lda >MPI.Slct get current selected slot
|
|
155 sta >ORGSlot,u save off
|
|
156 lda PD.DRV,y get drive no.
|
|
157 ldb #$11
|
|
158 mul multiply drive no. times $11
|
|
159 stb >MPI.Slct set new MPI slot no.
|
|
160 tfr x,d
|
|
161 sta >$FF42 write LSN hi byte to PAK
|
|
162 stb >$FF41 write LSN lo byte to PAK
|
|
163 ldx PD.BUF,y load X with address of path buffer
|
|
164 clrb
|
|
165 rts
|
|
166
|
|
167 * GetStat
|
|
168 *
|
|
169 * Entry:
|
|
170 * A = function code
|
|
171 * Y = address of path descriptor
|
|
172 * U = address of device memory area
|
|
173 *
|
|
174 * Exit:
|
|
175 * CC = carry set on error
|
|
176 * B = error code
|
|
177 *
|
|
178 GetStat comb
|
|
179 ldb #E$UnkSvc
|
|
180 rts
|
|
181
|
|
182 SetStat
|
|
183 * Term
|
|
184 *
|
|
185 * Entry:
|
|
186 * U = address of device memory area
|
|
187 *
|
|
188 * Exit:
|
|
189 * CC = carry set on error
|
|
190 * B = error code
|
|
191 *
|
|
192 Term clrb
|
|
193 rts
|
|
194
|
|
195 emod
|
|
196 eom equ *
|
|
197 end
|