Mercurial > hg > Members > kono > nitros9-code
annotate level1/modules/scdwn.asm @ 2356:b7aaa0b1b339
took out wildcard support for now
author | boisy |
---|---|
date | Mon, 18 Jan 2010 20:48:47 +0000 |
parents | 16b98c4a836d |
children | bfb8eefc19e1 |
rev | line source |
---|---|
2324 | 1 ******************************************************************** |
2 * scdwn - CoCo DriveWire Network Driver | |
3 * | |
4 * $Id$ | |
5 * | |
6 * Edt/Rev YYYY/MM/DD Modified by | |
7 * Comment | |
8 * ------------------------------------------------------------------ | |
9 * 1 2009/11/30 Aaron Wolfe | |
10 * Started | |
11 * | |
12 * 2009/12/28 Boisy G. Pitre | |
13 * Modified so that F$STime is called if we get an error on calling | |
14 * F$VIRQ (which means the clock module has not be initialized) | |
15 * | |
16 * 2009/12/31 Boisy G. Pitre | |
17 * Fixed crash in Init where F$Link failure would not clean up stack | |
18 * | |
19 * 2010/01/03 Boisy G. Pitre | |
20 * Moved IRQ stuff into DW3 subroutine module | |
21 | |
22 nam scdwn | |
23 ttl CoCo DriveWire Network Driver | |
24 | |
25 ifp1 | |
26 use defsfile | |
27 use dwdefs.d | |
28 endc | |
29 | |
30 | |
31 tylg set Drivr+Objct | |
32 atrv set ReEnt+Rev | |
33 rev set $00 | |
34 edition set 1 | |
35 | |
36 * Note: driver memory defined in dwdefs.d | |
37 mod eom,name,tylg,atrv,start,SCFDrvMemSz | |
38 | |
39 * module info | |
2343 | 40 fcb UPDAT.+SHARE. ;driver access modes |
2324 | 41 name fcs /scdwn/ ;driver name |
42 fcb edition ;driver edition | |
43 | |
44 * dispatch calls | |
45 start equ * | |
46 lbra Init | |
47 lbra Read | |
48 lbra Write | |
49 lbra GetStat | |
50 lbra SetStat | |
51 | |
52 *********************************************************************** | |
53 * Term | |
54 * | |
55 * shut down the driver. | |
56 * should close only the correct port, tell server to close the port, | |
57 * and remove irq handler when no ports are left | |
58 * | |
59 * Entry: | |
60 * U = address of device memory area | |
61 * | |
62 * Exit: | |
63 * CC = carry set on error | |
64 * B = error code | |
65 Term equ * | |
66 lda <V.PORT+1,u ;get our port # | |
67 pshs a ;port # on stack | |
68 * clear statics table entry | |
69 IFGT Level-1 | |
70 ldx <D.DWStat | |
71 ELSE | |
72 ldx >D.DWStat | |
73 ENDC | |
74 beq tell | |
75 ; cheat: we know DW.StatTbl is at offset $00 from D.DWStat, do not bother with leax | |
76 ; leax DW.StatTbl,x | |
77 clr a,x ;clear out | |
78 | |
79 ; tell server | |
80 tell | |
81 lda #OP_SERTERM ; load command | |
82 pshs a ; command store on stack | |
83 leax ,s ; point X to stack | |
84 ldy #2 ; 2 bytes to send | |
85 | |
86 pshs u | |
87 | |
88 IFGT Level-1 | |
89 ldu <D.DWSubAddr | |
90 ELSE | |
91 ldu >D.DWSubAddr | |
92 ENDC | |
93 beq nosub | |
94 jsr 6,u ; call DWrite | |
95 | |
96 nosub | |
97 puls u | |
98 leas 2,s ; clean 3 DWsub args from stack | |
99 clrb | |
100 rts | |
101 | |
102 *********************************************************************** | |
103 * Init | |
104 * | |
105 * Entry: | |
106 * Y = address of device descriptor | |
107 * U = address of device memory area | |
108 * | |
109 * Exit: | |
110 * CC = carry set on error | |
111 * B = error code | |
112 * | |
113 | |
114 Init equ * | |
115 | |
116 ; link to subroutine module | |
117 ; has the link already been done? | |
118 IFGT Level-1 | |
119 ldx <D.DWSubAddr | |
120 ELSE | |
121 ldx >D.DWSubAddr | |
122 ENDC | |
123 bne already ; if so, do not bother | |
124 | |
125 pshs u ; preserve u since os9 link is coming up | |
126 | |
127 IFGT Level-1 | |
128 ldx <D.Proc | |
129 pshs x | |
130 ldx <D.SysPrc | |
131 stx <D.Proc | |
132 ENDC | |
133 clra | |
134 | |
135 leax dw3name,pcr | |
136 os9 F$Link | |
137 IFGT Level-1 | |
138 puls x | |
139 stx <D.Proc | |
140 ENDC | |
141 bcs InitEx2 | |
142 IFGT Level-1 | |
143 sty <D.DWSubAddr | |
144 ELSE | |
145 sty >D.DWSubAddr | |
146 ENDC | |
147 jsr ,y ; call DW init routine | |
148 | |
149 puls u ; restore u | |
150 | |
151 already | |
152 ; tell DW we have a new port opening (port mode already on stack) | |
153 ldb <V.PORT+1,u ; get our port # | |
154 lda #OP_SERINIT ; command | |
155 pshs d ; command + port # on stack | |
156 leax ,s ; point X to stack | |
2339
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
157 ldy #2 ; # of bytes to send |
2324 | 158 |
159 pshs u | |
160 IFGT Level-1 | |
161 ldu <D.DWSubAddr | |
162 ELSE | |
163 ldu >D.DWSubAddr | |
164 ENDC | |
165 jsr 6,u ; call DWrite | |
166 puls u | |
167 | |
168 ; set up local buffer | |
169 ldb #RxBufDSz ; default Rx buffer size | |
170 leax RxBuff,u ; default Rx buffer address | |
171 stb RxBufSiz,u ; save Rx buffer size | |
172 stx RxBufPtr,u ; save Rx buffer address | |
173 stx RxBufGet,u ; set initial Rx buffer input address | |
174 stx RxBufPut,u ; set initial Rx buffer output address | |
175 abx ; add buffer size to buffer start.. | |
176 stx RxBufEnd,u ; save Rx buffer end address | |
177 | |
178 tfr u,d ; (A = high page of statics) | |
179 puls b | |
180 puls b ; (B = port number) | |
181 IFGT Level-1 | |
182 ldx <D.DWStat | |
183 ELSE | |
184 ldx >D.DWStat | |
185 ENDC | |
186 ; cheat: we know DW.StatTbl is at offset $00 from D.DWStat, do not bother with leax | |
187 ; leax DW.StatTbl,x | |
188 sta b,x | |
189 InitEx equ * | |
2339
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
190 rts |
2324 | 191 InitEx2 |
192 puls u | |
2339
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
193 rts |
2324 | 194 |
195 ; drivewire info | |
196 dw3name fcs /dw3/ | |
197 | |
198 | |
199 ***************************************************************************** | |
200 * Write | |
201 * | |
202 * Entry: | |
203 * A = character to write | |
204 * Y = address of path descriptor | |
205 * U = address of device memory area | |
206 * | |
207 * Exit: | |
208 * CC = carry set on error | |
209 * B = error code | |
210 * | |
211 Write equ * | |
212 pshs a ; character to send on stack | |
213 ldb <V.PORT+1,u ; port number into B | |
214 lda #OP_SERWRITE ; put command into A | |
215 pshs d | |
216 leax ,s | |
217 ldy #$0003 ; 3 bytes to send.. ugh. need WRITEM (data mode) | |
218 IFGT Level-1 | |
219 ldu <D.DWSubAddr | |
220 ELSE | |
221 ldu >D.DWSubAddr | |
222 ENDC | |
223 jsr 6,u | |
224 WriteOK clrb | |
225 WriteExit puls a,x,pc ; clean stack, return | |
226 | |
227 | |
2333 | 228 NotReady comb |
229 ldb #E$NotRdy | |
230 rts | |
231 | |
2324 | 232 ************************************************************************************* |
233 * Read | |
234 * | |
235 * Entry: | |
236 * Y = address of path descriptor | |
237 * U = address of device memory area | |
238 * | |
239 * Exit: | |
240 * A = character read | |
241 * CC = carry set on error | |
242 * B = error code | |
243 * | |
2333 | 244 Read equ * |
245 * Check to see if there is a signal-on-data-ready set for this path. | |
246 * If so, we return a Not Ready error. | |
2337 | 247 lda <SSigID,u data ready signal trap set up? |
2333 | 248 bne NotReady yes, exit with not ready error |
2324 | 249 pshs cc,dp ; save IRQ/Carry status, system DP |
250 | |
2333 | 251 ReadChr orcc #IntMasks ; mask interrupts |
2324 | 252 |
253 lda RxDatLen,u ; get our Rx buffer count | |
254 beq ReadSlp ; no data, go sleep while waiting for new Rx data... | |
255 | |
256 ; we have data waiting | |
257 deca ; one less byte in buffer | |
258 sta RxDatLen,u ; save new Rx data count | |
259 | |
260 ldx RxBufGet,u ; current Rx buffer pickup position | |
261 lda ,x+ ; get Rx character, set up next pickup position | |
262 | |
263 cmpx RxBufEnd,u ; end of Rx buffer? | |
264 blo ReadChr1 ; no, keep pickup pointer | |
265 ldx RxBufPtr,u ; get Rx buffer start address | |
266 ReadChr1 stx RxBufGet,u ; set new Rx data pickup pointer | |
267 | |
268 ; return to caller | |
269 puls cc,dp,pc ; recover IRQ/Carry status, system DP, return with character in A | |
270 | |
271 ReadSlp equ * | |
272 | |
273 IFEQ Level-1 | |
274 ReadSlp2 lda <V.BUSY,u | |
275 sta <V.WAKE,u ; store process id in this port's entry in the waiter table | |
276 lbsr Sleep0 ; sleep level 1 style | |
277 ELSE | |
278 ReadSlp2 lda >D.Proc ; process descriptor address MSB | |
279 sta <V.WAKE,u ; save MSB in V.WAKE | |
280 clrb | |
281 tfr d,x ; process descriptor address | |
282 IFNE H6309 | |
283 oim #Suspend,P$State,x ; suspend | |
284 ELSE | |
285 ldb P$State,x | |
286 orb #Suspend | |
287 stb P$State,x ; suspend | |
288 ENDC | |
289 bsr Sleep1 ; sleep level 2 style | |
290 ENDC | |
291 | |
292 ; we have been awakened.. | |
293 | |
294 ; check for signals | |
295 ldx >D.Proc ; process descriptor address | |
296 ldb P$Signal,x ; pending signal for this process? | |
297 beq ChkState ; no, go check process state... | |
298 cmpb #S$Peer ; (S$Peer or lower) | |
299 bls ErrExit ; yes, go do it... | |
300 | |
301 ChkState equ * | |
302 ; have we been condemned to die? | |
303 IFNE H6309 | |
304 tim #Condem,P$State,x | |
305 ELSE | |
306 ldb P$State,x | |
307 bitb #Condem | |
308 ENDC | |
309 bne PrAbtErr ; yes, go do it... | |
310 | |
311 ; check that our waiter byte was cleared by ISR instance | |
312 tst <V.WAKE,u ; our waiter byte | |
313 beq ReadChr ; 0 = its our turn, go get a character | |
314 bra ReadSlp ; false alarm, go back to sleep | |
315 | |
316 PrAbtErr ldb #E$PrcAbt ; set error code | |
317 | |
318 ErrExit equ * | |
319 IFNE H6309 | |
320 oim #Carry,,s ; set carry | |
321 ELSE | |
322 lda ,s | |
323 ora #Carry | |
324 sta ,s | |
325 ENDC | |
326 puls cc,dp,pc ; restore CC, system DP, return | |
327 | |
328 IFEQ Level-1 | |
329 Sleep0 ldx #$0 ; sleep till ISR wakes us | |
330 bra TimedSlp | |
331 ENDC | |
332 | |
333 Sleep1 ldx #$1 ; just sleep till end of slice, we are suspended (level 2) | |
334 TimedSlp andcc #^Intmasks ; enable IRQs | |
335 os9 F$Sleep | |
336 clr <V.WAKE,u | |
337 rts ; return | |
338 | |
339 | |
340 ********************************************************************** | |
341 * GetStat - heavily borrowed from sc6551 | |
342 * | |
343 * Entry: | |
344 * A = function code | |
345 * Y = address of path descriptor | |
346 * U = address of device memory area | |
347 * | |
348 * Exit: | |
349 * CC = carry set on error | |
350 * B = error code | |
351 * | |
352 GetStat | |
353 clrb ; default to no error... | |
354 pshs cc,dp ; save IRQ/Carry status,system DP | |
355 | |
356 ldx PD.RGS,y ; caller's register stack pointer | |
357 cmpa #SS.EOF | |
358 beq GSExitOK ; SCF devices never return EOF | |
359 | |
360 cmpa #SS.Ready | |
361 bne Advertise ; next check | |
362 | |
363 ; SS.Ready | |
364 lda RxDatLen,u ; get Rx data length | |
365 beq NRdyErr ; none, go report error | |
366 sta R$B,x ; set Rx data available in caller's [B] | |
367 GSExitOK puls cc,dp,pc ; restore Carry status, system DP, return | |
368 | |
369 NRdyErr ldb #E$NotRdy | |
370 bra ErrExit ; return error code | |
371 | |
372 UnSvcErr ldb #E$UnkSvc | |
373 bra ErrExit ; return error code | |
374 | |
375 ; We advertise all of our SERGETSTAT calls (except SS.Ready) to the server | |
376 Advertise | |
377 ldb #OP_SERGETSTAT | |
378 bsr SendStat | |
379 | |
380 ; Note: Here we could somehow obtain the size of the terminal window from the server | |
381 GetScSiz cmpa #SS.ScSiz | |
382 bne GetComSt ; next check | |
383 ldu PD.DEV,y | |
384 ldu V$DESC,u ; device descriptor | |
385 clra | |
386 ldb IT.COL,u ; return screen size | |
387 std R$X,x | |
388 ldb IT.ROW,u | |
389 std R$Y,x | |
390 puls cc,dp,pc ; restore Carry status, system DP, return | |
391 | |
392 GetComSt cmpa #SS.ComSt | |
393 bne UnSvcErr ; no, we have no more answers, report error | |
394 ldd #$0000 ; not used, return $0000 | |
395 std R$Y,x | |
396 sta R$B,x | |
397 puls cc,dp,pc ; restore Carry status, system DP, return | |
398 | |
399 * Advertise Stat Code to server | |
400 * A = Function Code | |
401 * B = OP_SERGETSTAT or OP_SERSETSTAT | |
402 SendStat | |
403 ; advertise our GetStt code to the server | |
404 pshs a,y,x,u | |
405 leas -3,s | |
406 leax ,s | |
407 stb ,x | |
408 sta 2,x | |
409 ldb V.PORT+1,u | |
410 stb 1,x | |
411 ldy #$0003 | |
412 IFGT LEVEL-1 | |
413 ldu <D.DWSubAddr | |
414 ELSE | |
415 ldu >D.DWSubAddr | |
416 ENDC | |
417 jsr 6,u | |
418 leas 3,s | |
419 puls a,y,x,u,pc | |
420 | |
421 ************************************************************************* | |
422 * SetStat | |
423 * | |
424 * Entry: | |
425 * A = function code | |
426 * Y = address of path descriptor | |
427 * U = address of device memory area | |
428 * | |
429 * Exit: | |
430 * CC = carry set on error | |
431 * B = error code | |
432 * | |
433 SetStat | |
434 ldb #OP_SERSETSTAT | |
435 bsr SendStat | |
2338 | 436 cmpa #SS.Open |
437 beq open | |
2340 | 438 cmpa #SS.Close |
439 beq ex | |
2324 | 440 cmpa #SS.ComSt |
2333 | 441 beq comst |
442 cmpa #SS.SSig | |
2337 | 443 beq ssig |
444 cmpa #SS.Relea | |
2339
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
445 lbne donebad |
2337 | 446 relea lda PD.CPR,y get curr proc # |
447 cmpa <SSigID,u same? | |
448 bne ex | |
449 clr <SSigID,u clear process id | |
450 ex rts | |
2333 | 451 ssig pshs cc |
452 orcc #IntMasks | |
453 lda PD.CPR,y ; get curr proc # | |
454 ldx PD.RGS,y | |
455 ldb R$X+1,x ; get user signal code | |
456 tst RxDatLen,u ; get Rx data length | |
457 beq ssigsetup ; branch if no data in buffer | |
458 * if here, we have data so send signal immediately | |
459 os9 F$Send | |
460 puls cc,pc | |
2337 | 461 ssigsetup std <SSigID,u ; save process ID & signal |
2333 | 462 puls cc,pc |
463 | |
464 comst leax PD.OPT,y | |
2324 | 465 ldy #OPTCNT |
466 IFGT LEVEL-1 | |
467 ldu <D.DWSubAddr | |
468 ELSE | |
469 ldu >D.DWSubAddr | |
470 ENDC | |
471 jsr 6,u | |
472 clrb | |
473 rts | |
474 | |
2339
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
475 * SS.Open processor |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
476 * Entry: X=Register stack pointer |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
477 * Y=Path descriptor pointer |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
478 * U=Static memory pointer |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
479 open pshs u,y |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
480 tst <V.PORT+1,u check if this is $FF00 (wildcard) |
2356 | 481 bra openex |
482 * bne openex | |
2338 | 483 * wildcard /N device... search for free device |
2339
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
484 IFGT Level-1 |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
485 ldx <D.DWStat |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
486 ELSE |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
487 ldx >D.DWStat |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
488 ENDC |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
489 ; cheat: we know DW.StatTbl is at offset $00 from D.DWStat, do not bother with leax |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
490 ; leax DW.StatTbl,x |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
491 clrb |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
492 next tst ,x+ |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
493 beq found |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
494 incb |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
495 cmpb #DW.StatCnt-1 |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
496 blt next |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
497 comb |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
498 ldb #E$MNF failed to find device |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
499 openex puls y,u,pc |
2338 | 500 |
2339
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
501 * we have found a free device (B holds #), build name, link it, then |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
502 * put into device table |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
503 found |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
504 * build name |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
505 leas -4,s |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
506 leax ,s |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
507 lda #'N |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
508 sta ,x+ |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
509 * take byte in B and turn into ASCII string at X |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
510 lda #'0 |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
511 cmpb #9 |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
512 bls lo1 |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
513 lo10 subb #10 |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
514 bcs hi10 |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
515 inca |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
516 bra lo10 |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
517 hi10 addb #10 |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
518 sta ,x+ |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
519 lda #'0 |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
520 lo1 decb |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
521 bmi hi1 |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
522 inca |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
523 bra lo1 |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
524 hi1 |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
525 * terminate with CR |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
526 ldb #13 |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
527 std ,x |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
528 * switch to system process descriptor |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
529 IFGT Level-1 |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
530 ldd <D.Proc Get current process dsc. ptr |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
531 pshs d Save on stack |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
532 ldd <D.SysPrc Get system process dsc. ptr |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
533 std <D.Proc Make it the current process |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
534 ENDC |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
535 * link device |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
536 leax 2,s |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
537 lda #Devic+Objct get module type |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
538 os9 F$Link try & link it |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
539 IFGT Level-1 |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
540 puls y |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
541 * switch back to current process descriptor |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
542 sty <D.Proc Make it the current process |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
543 ENDC |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
544 leas 4,s restore stack |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
545 bcs openex |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
546 * if no error on link, manipulate device table |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
547 * Got a device descriptor, put into device table & save window # into static |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
548 ldy ,s get path descriptor pointer |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
549 ldx PD.DEV,y get pointer to device table |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
550 stu V$DESC,x save pointer to descriptor into it |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
551 os9 F$UnLink unlink it from system map |
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
552 bra openex |
2338 | 553 |
2324 | 554 IFEQ 1 |
555 SetPortSig | |
556 cmpa #SS.PortSig | |
557 bne SetPortRel | |
558 lda PD.CPR,y current process ID | |
559 ldb R$X+1,x LSB of [X] is signal code | |
560 std <PortSigPID | |
561 clrb | |
562 rts | |
563 SetPortRel | |
564 cmpa #SS.PortRel | |
565 bne donebad | |
566 leax PortSigPID,u | |
567 bsr ReleaSig | |
568 clrb | |
569 rts | |
570 ENDC | |
571 donebad comb | |
2339
f9ff11331a2f
Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents:
2338
diff
changeset
|
572 ldb #E$UnkSvc |
2324 | 573 rts |
574 | |
575 ReleaSig pshs cc save IRQ enable status | |
576 orcc #IntMasks disable IRQs while releasing signal | |
577 lda PD.CPR,y get current process ID | |
578 suba ,x same as signal process ID? | |
579 bne NoReleas no, go return... | |
580 sta ,x clear this signal's process ID | |
581 NoReleas puls cc,pc restore IRQ enable status, return | |
582 | |
583 emod | |
584 eom equ * | |
585 end |