1 | ; $Id: startup.asm,v 1.1.1.1 2003/07/02 13:56:56 eleph Exp $
|
---|
2 | ;*
|
---|
3 | ;* 16bit entrypoints to the PDD with thunks to the 32bit functions
|
---|
4 | ;*
|
---|
5 | ;* (C) 2000-2002 InnoTek Systemberatung GmbH
|
---|
6 | ;* (C) 1998-2001 Sander van Leeuwen (sandervl@xs4all.nl)
|
---|
7 | ;*
|
---|
8 | ;* Partly based on MWDD32 (32 bits OS/2 device driver and IFS support driver)
|
---|
9 | ;* Copyright (C) 1995, 1996 Matthieu WILLM
|
---|
10 | ;*
|
---|
11 | ;* This program is free software; you can redistribute it and/or
|
---|
12 | ;* modify it under the terms of the GNU General Public License as
|
---|
13 | ;* published by the Free Software Foundation; either version 2 of
|
---|
14 | ;* the License, or (at your option) any later version.
|
---|
15 | ;*
|
---|
16 | ;* This program is distributed in the hope that it will be useful,
|
---|
17 | ;* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
18 | ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
19 | ;* GNU General Public License for more details.
|
---|
20 | ;*
|
---|
21 | ;* You should have received a copy of the GNU General Public
|
---|
22 | ;* License along with this program; if not, write to the Free
|
---|
23 | ;* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
|
---|
24 | ;* USA.
|
---|
25 | ;*
|
---|
26 |
|
---|
27 | .386p
|
---|
28 |
|
---|
29 |
|
---|
30 | INCL_DOS equ 1
|
---|
31 | INCL_DOSERRORS equ 1
|
---|
32 | include os2.inc
|
---|
33 |
|
---|
34 | include segments.inc
|
---|
35 | include startup.inc
|
---|
36 |
|
---|
37 | DATA16 segment
|
---|
38 | extrn DOS32FLATDS : abs ; ring 0 FLAT kernel data selector
|
---|
39 | ;*********************************************************************************************
|
---|
40 | ;************************* Device Driver Header **********************************************
|
---|
41 | ;*********************************************************************************************
|
---|
42 | public help_header
|
---|
43 | help_header dw OFFSET DATA16:uniaud_header ; Pointer to next driver
|
---|
44 | dw SEG DATA16:uniaud_header
|
---|
45 | dw 1000100110000000b ; Device attributes
|
---|
46 | ; ||||| +-+ ||||
|
---|
47 | ; ||||| | | |||+------------------ STDIN
|
---|
48 | ; ||||| | | ||+------------------- STDOUT
|
---|
49 | ; ||||| | | |+-------------------- NULL
|
---|
50 | ; ||||| | | +--------------------- CLOCK
|
---|
51 | ; ||||| | |
|
---|
52 | ; ||||| | +------------------------+ (001) OS/2
|
---|
53 | ; ||||| | | (010) DosDevIOCtl2 + SHUTDOWN
|
---|
54 | ; ||||| +--------------------------+ (011) Capability bit strip
|
---|
55 | ; |||||
|
---|
56 | ; ||||+----------------------------- OPEN/CLOSE (char) or Removable (blk)
|
---|
57 | ; |||+------------------------------ Sharing support
|
---|
58 | ; ||+------------------------------- IBM
|
---|
59 | ; |+-------------------------------- IDC entry point
|
---|
60 | ; +--------------------------------- char/block device driver
|
---|
61 |
|
---|
62 | dw offset CODE16:help_stub_strategy ; Strategy routine entry point
|
---|
63 | dw 0 ; IDC routine entry point
|
---|
64 | db 'ALSAHLP$' ; Device name
|
---|
65 | db 8 dup (0) ; Reserved
|
---|
66 | dw 0000000000010011b ; Level 3 device driver capabilities
|
---|
67 | ; |||||
|
---|
68 | ; ||||+------------------ DosDevIOCtl2 + Shutdown
|
---|
69 | ; |||+------------------- More than 16 MB support
|
---|
70 | ; ||+-------------------- Parallel port driver
|
---|
71 | ; |+--------------------- Adapter device driver
|
---|
72 | ; +---------------------- InitComplete
|
---|
73 | dw 0000000000000000b
|
---|
74 |
|
---|
75 | public uniaud_header
|
---|
76 | uniaud_header dd -1
|
---|
77 | dw 1101100110000000b ; Device attributes
|
---|
78 | ; ||||| +-+ ||||
|
---|
79 | ; ||||| | | |||+------------------ STDIN
|
---|
80 | ; ||||| | | ||+------------------- STDOUT
|
---|
81 | ; ||||| | | |+-------------------- NULL
|
---|
82 | ; ||||| | | +--------------------- CLOCK
|
---|
83 | ; ||||| | |
|
---|
84 | ; ||||| | +------------------------+ (001) OS/2
|
---|
85 | ; ||||| | | (010) DosDevIOCtl2 + SHUTDOWN
|
---|
86 | ; ||||| +--------------------------+ (011) Capability bit strip
|
---|
87 | ; |||||
|
---|
88 | ; ||||+----------------------------- OPEN/CLOSE (char) or Removable (blk)
|
---|
89 | ; |||+------------------------------ Sharing support
|
---|
90 | ; ||+------------------------------- IBM
|
---|
91 | ; |+-------------------------------- IDC entry point
|
---|
92 | ; +--------------------------------- char/block device driver
|
---|
93 |
|
---|
94 | dw offset CODE16:uniaud_stub_strategy ; Strategy routine entry point
|
---|
95 | dw offset CODE16:uniaud_stub_idc ; IDC routine entry point
|
---|
96 | db 'ALSA32$ ' ; Device name
|
---|
97 | db 8 dup (0) ; Reserved
|
---|
98 | dw 0000000000010011b ; Level 3 device driver capabilities
|
---|
99 | ; |||||
|
---|
100 | ; ||||+------------------ DosDevIOCtl2 + Shutdown
|
---|
101 | ; |||+------------------- More than 16 MB support
|
---|
102 | ; ||+-------------------- Parallel port driver
|
---|
103 | ; |+--------------------- Adapter device driver
|
---|
104 | ; +---------------------- InitComplete
|
---|
105 | dw 0000000000000000b
|
---|
106 |
|
---|
107 |
|
---|
108 | public DevHelpInit
|
---|
109 | DevHelpInit dd 0
|
---|
110 |
|
---|
111 | public fOpen
|
---|
112 | fOpen dd 0
|
---|
113 |
|
---|
114 | public InitPktSeg
|
---|
115 | public InitPktOff
|
---|
116 | InitPktSeg dw 0
|
---|
117 | InitPktOff dw 0
|
---|
118 |
|
---|
119 | IFDEF DEBUG
|
---|
120 | public DbgU32TimerCnt
|
---|
121 | public DbgU32IntCnt
|
---|
122 | DbgU32TimerCnt dd 0
|
---|
123 | DbgU32IntCnt dd 0
|
---|
124 | ENDIF
|
---|
125 |
|
---|
126 | ;needed for rmcalls.lib
|
---|
127 | public _RM_Help0
|
---|
128 | public _RM_Help1
|
---|
129 | public _RM_Help3
|
---|
130 | public _RMFlags
|
---|
131 | _RM_Help0 dd 0
|
---|
132 | _RM_Help1 dd 0
|
---|
133 | _RM_Help3 dd 0
|
---|
134 | _RMFlags dd 0
|
---|
135 |
|
---|
136 | public _MESSAGE_STR
|
---|
137 | public _MSG_TABLE16
|
---|
138 | _MESSAGE_STR db 1024 dup (0)
|
---|
139 | _MSG_TABLE16 dw 0 ;message length
|
---|
140 | dw OFFSET _MESSAGE_STR ;message far pointer
|
---|
141 | dw SEG _MESSAGE_STR
|
---|
142 |
|
---|
143 | FileName db 'ALSAHLP$', 0
|
---|
144 | ResMgr db 'RESMGR$ ',0
|
---|
145 |
|
---|
146 | _RMIDCTable DB 00H,00H,00H,00H,00H,00H,00H,00H
|
---|
147 | DB 00H,00H,00H,00H
|
---|
148 |
|
---|
149 | ;last byte in 16 bits data segment
|
---|
150 | public __OffFinalDS16
|
---|
151 | __OffFinalDS16 label byte
|
---|
152 |
|
---|
153 | DATA16 ends
|
---|
154 | ; ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
|
---|
155 | CODE16 segment
|
---|
156 | assume cs:CODE16, ds:DATA16
|
---|
157 |
|
---|
158 | extrn DOSOPEN : far
|
---|
159 | extrn _DOSWRITE : far
|
---|
160 | extrn DOSCLOSE : far
|
---|
161 |
|
---|
162 | ALIGN 2
|
---|
163 | help_stub_strategy proc far
|
---|
164 | movzx eax, byte ptr es:[bx].reqCommand
|
---|
165 | cmp eax, 04h ; DosRead
|
---|
166 | je uniaud_stub_strategy
|
---|
167 |
|
---|
168 | enter 0, 0
|
---|
169 | and sp, 0fffch ; align stack
|
---|
170 |
|
---|
171 | pushad
|
---|
172 | push ds
|
---|
173 | push es
|
---|
174 | push fs
|
---|
175 | push gs
|
---|
176 |
|
---|
177 | mov dx, DATA16
|
---|
178 | mov ds, dx
|
---|
179 |
|
---|
180 | cmp eax, 0 ; Init
|
---|
181 | je short @@help_init
|
---|
182 | cmp eax, 0Eh ; DosClose
|
---|
183 | je short @@help_close
|
---|
184 | cmp eax, 0Dh ; DosOpen
|
---|
185 | jne short @@help_error
|
---|
186 | ;DosOpen:
|
---|
187 | cmp word ptr fOpen, 0
|
---|
188 | je short @@help_ret_ok ; not ours
|
---|
189 | push ebx ; save ebx
|
---|
190 | push es
|
---|
191 | mov word ptr fOpen, 0
|
---|
192 | mov ax, word ptr InitPktSeg
|
---|
193 | mov fs, ax ; fs:ebx = req. packet
|
---|
194 | xor ebx, ebx
|
---|
195 | mov bx, word ptr InitPktOff
|
---|
196 | call far ptr FLAT:STRATEGY_
|
---|
197 | pop es
|
---|
198 | pop ebx ; restore ebx ptr
|
---|
199 | @@help_ret:
|
---|
200 | mov word ptr es:[bx].reqStatus, ax
|
---|
201 | @@help_ret_error:
|
---|
202 | pop gs
|
---|
203 | pop fs
|
---|
204 | pop es
|
---|
205 | pop ds
|
---|
206 | popad
|
---|
207 |
|
---|
208 | leave
|
---|
209 | ret
|
---|
210 |
|
---|
211 | @@help_init:
|
---|
212 | mov eax, dword ptr es:[bx].i_devHelp
|
---|
213 | mov dword ptr DevHelpInit, eax
|
---|
214 | mov word ptr es:[bx].o_codeend, offset __OffFinalCS16
|
---|
215 | mov word ptr es:[bx].o_dataend, offset __OffFinalDS16
|
---|
216 |
|
---|
217 | @@help_ret_ok:
|
---|
218 | mov ax, STDON
|
---|
219 | jmp short @@help_ret
|
---|
220 |
|
---|
221 | @@help_close:
|
---|
222 | call far ptr FLAT:HelpClose
|
---|
223 | jmp short @@help_ret_ok
|
---|
224 |
|
---|
225 | @@help_error:
|
---|
226 | mov ax, STDON + STERR + ERROR_I24_BAD_COMMAND
|
---|
227 | mov word ptr es:[bx].reqStatus, ax
|
---|
228 | jmp short @@help_ret_error
|
---|
229 |
|
---|
230 | help_stub_strategy endp
|
---|
231 |
|
---|
232 | ALIGN 2
|
---|
233 | uniaud_stub_strategy proc far
|
---|
234 | enter 0, 0
|
---|
235 | and sp, 0fffch ; align stack
|
---|
236 |
|
---|
237 | pushad
|
---|
238 | push ds
|
---|
239 | push es
|
---|
240 | push fs
|
---|
241 | push gs
|
---|
242 |
|
---|
243 | mov ax, DATA16
|
---|
244 | mov ds, ax
|
---|
245 |
|
---|
246 | movzx eax, byte ptr es:[bx].reqCommand
|
---|
247 | cmp eax, 0
|
---|
248 | jz short @@init
|
---|
249 |
|
---|
250 | push ebx
|
---|
251 | push es
|
---|
252 | mov ax, bx
|
---|
253 | xor ebx, ebx
|
---|
254 | mov bx, ax
|
---|
255 | mov ax, es
|
---|
256 | mov fs, ax ; fs:ebx = req. packet
|
---|
257 |
|
---|
258 | call far ptr FLAT:STRATEGY_ ; 32 bits strategy entry point
|
---|
259 |
|
---|
260 | pop es
|
---|
261 | pop ebx ; oude bx ptr
|
---|
262 | mov word ptr es:[bx].reqStatus, ax ; status code
|
---|
263 |
|
---|
264 | @@uniaud_ret:
|
---|
265 |
|
---|
266 | pop gs
|
---|
267 | pop fs
|
---|
268 | pop es
|
---|
269 | pop ds
|
---|
270 | popad
|
---|
271 | leave
|
---|
272 | ret
|
---|
273 |
|
---|
274 | @@init:
|
---|
275 | ;
|
---|
276 | ; DEVICE= initialization
|
---|
277 | ;
|
---|
278 | mov word ptr InitPktSeg, es
|
---|
279 | mov word ptr InitPktOff, bx
|
---|
280 | inc word ptr fOpen
|
---|
281 | call device_init
|
---|
282 |
|
---|
283 | mov word ptr es:[bx].reqStatus, ax ; status code (ret by device_init)
|
---|
284 | mov word ptr es:[bx].o_codeend, offset __OffFinalCS16
|
---|
285 | mov word ptr es:[bx].o_dataend, offset __OffFinalDS16
|
---|
286 | jmp short @@uniaud_ret
|
---|
287 |
|
---|
288 | init_err:
|
---|
289 | mov dword ptr es:[bx].i_devHelp, 0
|
---|
290 | jmp short @@uniaud_ret
|
---|
291 |
|
---|
292 | uniaud_stub_strategy endp
|
---|
293 |
|
---|
294 | ;in: cx = cmd
|
---|
295 | ; bx = lower 16 bits of ULONG parameter
|
---|
296 | ; dx = upper 16 bits of ULONG parameter
|
---|
297 | ;return value in dx:ax
|
---|
298 | ALIGN 2
|
---|
299 | uniaud_stub_idc proc far
|
---|
300 | enter 0, 0
|
---|
301 | and sp, 0fffch ; align stack
|
---|
302 |
|
---|
303 | shl edx, 16
|
---|
304 | mov dx, bx
|
---|
305 | call far ptr FLAT:IDC_ ; 32 bits strategy entry point
|
---|
306 |
|
---|
307 | mov dx, ax
|
---|
308 | shr eax, 16
|
---|
309 | xchg ax, dx
|
---|
310 |
|
---|
311 | leave
|
---|
312 | retf
|
---|
313 | uniaud_stub_idc endp
|
---|
314 |
|
---|
315 | ALIGN 2
|
---|
316 | uniaud_stub_timer proc far
|
---|
317 | enter 0, 0
|
---|
318 | and sp, 0fffch ; align stack
|
---|
319 |
|
---|
320 | call far ptr FLAT:TIMER_ ; 32 bits timer entry point
|
---|
321 |
|
---|
322 | leave
|
---|
323 | retf
|
---|
324 | uniaud_stub_timer endp
|
---|
325 |
|
---|
326 |
|
---|
327 | ;;*****************************************************************************
|
---|
328 | ; device_init
|
---|
329 | ;
|
---|
330 | ; Use DosOpen to tell the 1st driver to handle init for us. We must do it this
|
---|
331 | ; way since right now our CPL is 3 and the flat code selector has DPL 0, so
|
---|
332 | ; we can't load it. In the open strategy request, CPL is 0
|
---|
333 | ;;*****************************************************************************
|
---|
334 | ALIGN 2
|
---|
335 | device_init proc near
|
---|
336 | enter 24, 0
|
---|
337 | push ds
|
---|
338 | push es
|
---|
339 | push bx
|
---|
340 | push si
|
---|
341 | push di
|
---|
342 |
|
---|
343 | ; bp -> old bp
|
---|
344 | ; bp - 2 -> FileHandle
|
---|
345 | ; bp - 4 -> ActionTaken
|
---|
346 | ; bp - 8 -> IOCTL parm (4 bytes) : union mwdd32_ioctl_init_device_parm
|
---|
347 | ; bp - 24 -> IOCTL data (16 bytes) : union mwdd32_ioctl_init_device_data
|
---|
348 |
|
---|
349 | ;
|
---|
350 | ; Opens wathlp$
|
---|
351 | ;
|
---|
352 | push seg DATA16 ; seg FileName
|
---|
353 | push offset FileName ; ofs FileName
|
---|
354 | push ss ; seg &FileHandle
|
---|
355 | lea ax, [bp - 2]
|
---|
356 | push ax ; ofs &FileHandle
|
---|
357 | push ss ; seg &ActionTaken
|
---|
358 | lea ax, [bp - 4]
|
---|
359 | push ax ; ofs &ActionTaken
|
---|
360 | push dword ptr 0 ; file size
|
---|
361 | push 0 ; file attributes
|
---|
362 | push OPEN_ACTION_FAIL_IF_NEW + OPEN_ACTION_OPEN_IF_EXISTS
|
---|
363 | push OPEN_SHARE_DENYNONE + OPEN_ACCESS_READONLY
|
---|
364 | push dword ptr 0 ; reserved
|
---|
365 | call DOSOPEN
|
---|
366 | cmp ax, NO_ERROR
|
---|
367 | jnz short @@error
|
---|
368 |
|
---|
369 |
|
---|
370 | ;
|
---|
371 | ; Closes wathlp$
|
---|
372 | ;
|
---|
373 | push word ptr [bp - 2] ; FileHandle
|
---|
374 | call DOSCLOSE
|
---|
375 | cmp ax, NO_ERROR
|
---|
376 | jnz short @@error
|
---|
377 |
|
---|
378 | @@out:
|
---|
379 | push eax ;gemold door doswrite
|
---|
380 |
|
---|
381 | push 0001H
|
---|
382 | push ds
|
---|
383 | push offset _MESSAGE_STR
|
---|
384 | push word ptr _MSG_TABLE16
|
---|
385 | push ss
|
---|
386 | lea dx, [bp - 2]
|
---|
387 | push dx
|
---|
388 | call _DOSWRITE
|
---|
389 |
|
---|
390 | pop eax
|
---|
391 |
|
---|
392 | pop di
|
---|
393 | pop si
|
---|
394 | pop bx
|
---|
395 | pop es
|
---|
396 | pop ds
|
---|
397 | leave
|
---|
398 | ret
|
---|
399 | @@error:
|
---|
400 | mov ax, STDON + STERR + ERROR_I24_GEN_FAILURE
|
---|
401 | jmp short @@out
|
---|
402 |
|
---|
403 | device_init endp
|
---|
404 |
|
---|
405 | ALIGN 2
|
---|
406 | ;use devhlp pointer stored in 16 bits code segment
|
---|
407 | public thunk3216_devhelp
|
---|
408 | thunk3216_devhelp:
|
---|
409 | push ds
|
---|
410 | push DATA16
|
---|
411 | pop ds
|
---|
412 | call dword ptr DevHelpInit
|
---|
413 | pop ds
|
---|
414 | jmp far ptr FLAT:thunk1632_devhelp
|
---|
415 |
|
---|
416 | ALIGN 2
|
---|
417 | public thunk3216_devhelp_modified_ds
|
---|
418 | thunk3216_devhelp_modified_ds:
|
---|
419 | push gs
|
---|
420 | push DATA16
|
---|
421 | pop gs
|
---|
422 | call dword ptr gs:DevHelpInit
|
---|
423 | pop gs
|
---|
424 | jmp far ptr FLAT:thunk1632_devhelp_modified_ds
|
---|
425 |
|
---|
426 |
|
---|
427 | ALIGN 2
|
---|
428 | PUBLIC _RMAllocResourceOrg
|
---|
429 | _RMAllocResourceOrg proc far
|
---|
430 | enter16
|
---|
431 | test byte ptr _RMFlags, 01H
|
---|
432 | je short AllocL1
|
---|
433 | lea eax, [bp+6]
|
---|
434 | push ss
|
---|
435 | push ax
|
---|
436 | push 0008H
|
---|
437 | push cs
|
---|
438 | call near ptr _CallRM
|
---|
439 | mov sp,bp
|
---|
440 | ret16
|
---|
441 | AllocL1: test byte ptr _RMFlags,02H
|
---|
442 | je short AllocL2
|
---|
443 | push es
|
---|
444 | push bx
|
---|
445 | les bx,dword ptr [bp+10]
|
---|
446 | mov word ptr es:[bx],0ffffH
|
---|
447 | mov word ptr es:+2H[bx],0ffffH
|
---|
448 | sub ax,ax
|
---|
449 | pop bx
|
---|
450 | pop es
|
---|
451 | ret16
|
---|
452 | AllocL2: mov ax,0001H
|
---|
453 | ret16
|
---|
454 | _RMAllocResourceOrg endp
|
---|
455 |
|
---|
456 | ALIGN 2
|
---|
457 | PUBLIC _RMAllocResource16
|
---|
458 | _RMAllocResource16 proc far
|
---|
459 | enter32
|
---|
460 | xor eax, eax
|
---|
461 | push dword ptr [bp+18]
|
---|
462 | push dword ptr [bp+14]
|
---|
463 | push dword ptr [bp+10]
|
---|
464 | call _RMAllocResourceOrg
|
---|
465 | add sp, 12
|
---|
466 | ret32
|
---|
467 | _RMAllocResource16 endp
|
---|
468 |
|
---|
469 | ALIGN 2
|
---|
470 | PUBLIC _RMModifyResourcesOrg
|
---|
471 | _RMModifyResourcesOrg proc far
|
---|
472 | enter16
|
---|
473 | test byte ptr _RMFlags, 01H
|
---|
474 | je short ModifyL1
|
---|
475 | lea eax, [bp+6]
|
---|
476 | push ss
|
---|
477 | push ax
|
---|
478 | push 001bH
|
---|
479 | push cs
|
---|
480 | call near ptr _CallRM
|
---|
481 | mov sp,bp
|
---|
482 | ret16
|
---|
483 | ModifyL1: test byte ptr _RMFlags,02H
|
---|
484 | je short ModifyL2
|
---|
485 | sub ax,ax
|
---|
486 | ret16
|
---|
487 | ModifyL2: mov ax,0001H
|
---|
488 | ret16
|
---|
489 | _RMModifyResourcesOrg endp
|
---|
490 |
|
---|
491 | ALIGN 2
|
---|
492 | PUBLIC _RMModifyResources16
|
---|
493 | _RMModifyResources16 proc far
|
---|
494 | enter32
|
---|
495 | xor eax, eax
|
---|
496 | push dword ptr [bp+22]
|
---|
497 | push word ptr [bp+18]
|
---|
498 | push dword ptr [bp+14]
|
---|
499 | push dword ptr [bp+10]
|
---|
500 | call _RMModifyResourcesOrg
|
---|
501 | add sp, 14
|
---|
502 | ret32
|
---|
503 | _RMModifyResources16 endp
|
---|
504 |
|
---|
505 | ALIGN 2
|
---|
506 | PUBLIC _RMCreateAdapterOrg
|
---|
507 | _RMCreateAdapterOrg proc far
|
---|
508 | enter16
|
---|
509 | test byte ptr _RMFlags,01H
|
---|
510 | je short CreateAdL1
|
---|
511 | lea eax, [bp+6]
|
---|
512 | push ss
|
---|
513 | push ax
|
---|
514 | push 0004H
|
---|
515 | push cs
|
---|
516 | call near ptr _CallRM
|
---|
517 | mov sp,bp
|
---|
518 | ret16
|
---|
519 | CreateAdL1: test byte ptr _RMFlags,02H
|
---|
520 | je short CreateAdL2
|
---|
521 | push es
|
---|
522 | push bx
|
---|
523 | les bx,dword ptr [bp+10]
|
---|
524 | mov word ptr es:[bx],0ffffH
|
---|
525 | mov word ptr es:+2H[bx],0ffffH
|
---|
526 | sub ax,ax
|
---|
527 | pop bx
|
---|
528 | pop es
|
---|
529 | ret16
|
---|
530 | CreateAdL2: mov ax,0001H
|
---|
531 | ret16
|
---|
532 | _RMCreateAdapterOrg endp
|
---|
533 |
|
---|
534 | ALIGN 2
|
---|
535 | PUBLIC _RMCreateAdapter16
|
---|
536 | _RMCreateAdapter16 proc far
|
---|
537 | enter32
|
---|
538 | xor eax, eax
|
---|
539 | push dword ptr [bp+26]
|
---|
540 | push dword ptr [bp+22]
|
---|
541 | push dword ptr [bp+18]
|
---|
542 | push dword ptr [bp+14]
|
---|
543 | push dword ptr [bp+10]
|
---|
544 | call _RMCreateAdapterOrg
|
---|
545 | add sp, 20
|
---|
546 | ret32
|
---|
547 | _RMCreateAdapter16 endp
|
---|
548 |
|
---|
549 | ALIGN 2
|
---|
550 | PUBLIC _RMCreateDeviceOrg
|
---|
551 | _RMCreateDeviceOrg proc far
|
---|
552 | enter16
|
---|
553 | test byte ptr _RMFlags,01H
|
---|
554 | je short CreateDevL1
|
---|
555 | lea ax, [bp+6]
|
---|
556 | push ss
|
---|
557 | push ax
|
---|
558 | push 0006H
|
---|
559 | push cs
|
---|
560 | call near ptr _CallRM
|
---|
561 | mov sp,bp
|
---|
562 | ret16
|
---|
563 | CreateDevL1: test byte ptr _RMFlags,02H
|
---|
564 | je short CreateDevL2
|
---|
565 | push es
|
---|
566 | push bx
|
---|
567 | les bx,dword ptr [bp+10]
|
---|
568 | mov word ptr es:[bx],0ffffH
|
---|
569 | mov word ptr es:+2H[bx],0ffffH
|
---|
570 | sub ax,ax
|
---|
571 | pop bx
|
---|
572 | pop es
|
---|
573 | ret16
|
---|
574 | CreateDevL2: mov ax,0001H
|
---|
575 | ret16
|
---|
576 | _RMCreateDeviceOrg endp
|
---|
577 |
|
---|
578 | ALIGN 2
|
---|
579 | PUBLIC _RMCreateDevice16
|
---|
580 | _RMCreateDevice16 proc far
|
---|
581 | enter32
|
---|
582 | xor eax, eax
|
---|
583 | push dword ptr [bp+26]
|
---|
584 | push dword ptr [bp+22]
|
---|
585 | push dword ptr [bp+18]
|
---|
586 | push dword ptr [bp+14]
|
---|
587 | push dword ptr [bp+10]
|
---|
588 | call _RMCreateDeviceOrg
|
---|
589 | add sp, 20
|
---|
590 | ret32
|
---|
591 | _RMCreateDevice16 endp
|
---|
592 |
|
---|
593 | ALIGN 2
|
---|
594 | PUBLIC _RMDestroyDeviceOrg
|
---|
595 | _RMDestroyDeviceOrg proc far
|
---|
596 | enter16
|
---|
597 | test byte ptr _RMFlags,01H
|
---|
598 | je short DestroyL1
|
---|
599 | lea ax, [bp+6]
|
---|
600 | push ss
|
---|
601 | push ax
|
---|
602 | push 0007H
|
---|
603 | push cs
|
---|
604 | call near ptr _CallRM
|
---|
605 | mov sp,bp
|
---|
606 | ret16
|
---|
607 | DestroyL1: test byte ptr _RMFlags,02H
|
---|
608 | je short DestroyL2
|
---|
609 | sub ax,ax
|
---|
610 | ret16
|
---|
611 | DestroyL2: mov ax,0001H
|
---|
612 | ret16
|
---|
613 | _RMDestroyDeviceOrg endp
|
---|
614 |
|
---|
615 | ALIGN 2
|
---|
616 | PUBLIC _RMDestroyDevice16
|
---|
617 | _RMDestroyDevice16 proc far
|
---|
618 | enter32
|
---|
619 | xor eax, eax
|
---|
620 | push dword ptr [bp+10]
|
---|
621 | call _RMDestroyDeviceOrg
|
---|
622 | add sp, 4
|
---|
623 | ret32
|
---|
624 | _RMDestroyDevice16 endp
|
---|
625 |
|
---|
626 | ALIGN 2
|
---|
627 | PUBLIC _RMDeallocResourceOrg
|
---|
628 | _RMDeallocResourceOrg proc far
|
---|
629 | enter16
|
---|
630 | test byte ptr _RMFlags,01H
|
---|
631 | je short DeAllocL1
|
---|
632 | lea ax, [bp+6]
|
---|
633 | push ss
|
---|
634 | push ax
|
---|
635 | push 0009H
|
---|
636 | push cs
|
---|
637 | call near ptr _CallRM
|
---|
638 | mov sp,bp
|
---|
639 | ret16
|
---|
640 | DeAllocL1: test byte ptr _RMFlags,02H
|
---|
641 | je short DeAllocL2
|
---|
642 | sub ax,ax
|
---|
643 | ret16
|
---|
644 | DeAllocL2: mov ax,0001H
|
---|
645 | ret16
|
---|
646 | _RMDeallocResourceOrg endp
|
---|
647 |
|
---|
648 | ALIGN 2
|
---|
649 | PUBLIC _RMDeallocResource16
|
---|
650 | _RMDeallocResource16 proc far
|
---|
651 | enter32
|
---|
652 | xor eax, eax
|
---|
653 | push dword ptr [bp+14]
|
---|
654 | push dword ptr [bp+10]
|
---|
655 | call _RMDeallocResourceOrg
|
---|
656 | add sp, 8
|
---|
657 | ret32
|
---|
658 | _RMDeallocResource16 endp
|
---|
659 |
|
---|
660 | ALIGN 2
|
---|
661 | PUBLIC MY_DEVHELP_ATTACHDD
|
---|
662 | MY_DEVHELP_ATTACHDD proc near
|
---|
663 | push bp
|
---|
664 | mov bp,sp
|
---|
665 | push di
|
---|
666 | push es
|
---|
667 | mov ax, ds
|
---|
668 | mov es, ax
|
---|
669 | mov bx,word ptr +8H[bp]
|
---|
670 | mov di,word ptr +6H[bp]
|
---|
671 | mov dl,2aH
|
---|
672 | call dword ptr DevHelpInit
|
---|
673 | jb short L2
|
---|
674 | sub ax,ax
|
---|
675 | pop es
|
---|
676 | pop di
|
---|
677 | leave
|
---|
678 | ret 0004H
|
---|
679 | L2: pop es
|
---|
680 | pop di
|
---|
681 | leave
|
---|
682 | ret 0004H
|
---|
683 | MY_DEVHELP_ATTACHDD endp
|
---|
684 |
|
---|
685 | ALIGN 2
|
---|
686 | PUBLIC _RMCreateDriverOrg
|
---|
687 | _RMCreateDriverOrg proc far
|
---|
688 | enter16
|
---|
689 | test byte ptr _RMFlags,01H
|
---|
690 | je short CreateDrL4
|
---|
691 | CreateDrL3: lea ax, [bp+6]
|
---|
692 | push ss
|
---|
693 | push ax
|
---|
694 | push 0002H
|
---|
695 | push cs
|
---|
696 | call near ptr _CallRM
|
---|
697 | add sp,0006H
|
---|
698 | ret16
|
---|
699 | CreateDrL4: test byte ptr _RMFlags,02H
|
---|
700 | je short CreateDrL6
|
---|
701 | CreateDrL5: push es
|
---|
702 | push bx
|
---|
703 | les bx,dword ptr [bp+10]
|
---|
704 | mov word ptr es:[bx],0ffffH
|
---|
705 | mov word ptr es:+2H[bx],0ffffH
|
---|
706 | sub ax,ax
|
---|
707 | pop bx
|
---|
708 | pop es
|
---|
709 | ret16
|
---|
710 | CreateDrL6: mov ax, word ptr DevHelpInit + 2H
|
---|
711 | or ax, word ptr DevHelpInit
|
---|
712 | jne short CreateDrL7
|
---|
713 | mov ax,0008H
|
---|
714 | ret16
|
---|
715 | CreateDrL7: push offset ResMgr
|
---|
716 | push offset _RMIDCTable
|
---|
717 | push cs
|
---|
718 | call near ptr MY_DEVHELP_ATTACHDD
|
---|
719 | or ax,ax
|
---|
720 | je short CreateDrL8
|
---|
721 | or byte ptr _RMFlags, 02H
|
---|
722 | jmp short CreateDrL5
|
---|
723 | CreateDrL8: mov ax,word ptr _RMIDCTable+4H
|
---|
724 | mov word ptr _RM_Help3+2H,ax
|
---|
725 | mov word ptr _RM_Help3,0000H
|
---|
726 | mov ax,word ptr _RMIDCTable+2H
|
---|
727 | mov word ptr _RM_Help0+2H,ax
|
---|
728 | mov ax,word ptr _RMIDCTable+6H
|
---|
729 | mov word ptr _RM_Help0,ax
|
---|
730 | or byte ptr _RMFlags,05H
|
---|
731 | jmp short CreateDrL3
|
---|
732 | _RMCreateDriverOrg endp
|
---|
733 |
|
---|
734 | ALIGN 2
|
---|
735 | PUBLIC _RMCreateDriver16
|
---|
736 | _RMCreateDriver16 proc far
|
---|
737 | enter32
|
---|
738 | xor eax, eax
|
---|
739 | push dword ptr [bp+14]
|
---|
740 | push dword ptr [bp+10]
|
---|
741 | call _RMCreateDriverOrg
|
---|
742 | add sp, 8
|
---|
743 | ret32
|
---|
744 | _RMCreateDriver16 endp
|
---|
745 |
|
---|
746 | ALIGN 2
|
---|
747 | PUBLIC _CallRM
|
---|
748 | _CallRM proc near
|
---|
749 | enter 0002H,00H
|
---|
750 | call near ptr _GetCS
|
---|
751 | test al,03H
|
---|
752 | je short L1
|
---|
753 | push word ptr +0aH[bp]
|
---|
754 | push word ptr +8H[bp]
|
---|
755 | push word ptr +6H[bp]
|
---|
756 | call dword ptr _RM_Help3
|
---|
757 | add sp,0006H
|
---|
758 | leave
|
---|
759 | ret
|
---|
760 | L1: push word ptr +6H[bp]
|
---|
761 | call dword ptr _RM_Help0
|
---|
762 | leave
|
---|
763 | ret
|
---|
764 | _CallRM endp
|
---|
765 |
|
---|
766 | ALIGN 2
|
---|
767 | _GetCS proc near
|
---|
768 | enter 0002H,00H
|
---|
769 | push cs
|
---|
770 | pop word ptr -2H[bp]
|
---|
771 | mov ax,word ptr -2H[bp]
|
---|
772 | leave
|
---|
773 | ret
|
---|
774 | _GetCS endp
|
---|
775 |
|
---|
776 | ALIGN 2
|
---|
777 | PUBLIC _RMDestroyDriverOrg
|
---|
778 | _RMDestroyDriverOrg proc far
|
---|
779 | enter16
|
---|
780 | test byte ptr _RMFlags,01H
|
---|
781 | je short DestroyDrvL1
|
---|
782 | lea ax, [bp+6]
|
---|
783 | push ss
|
---|
784 | push ax
|
---|
785 | push 0003H
|
---|
786 | push cs
|
---|
787 | call near ptr _CallRM
|
---|
788 | mov sp,bp
|
---|
789 | ret16
|
---|
790 | DestroyDrvL1: test byte ptr _RMFlags,02H
|
---|
791 | je short DestroyDrvL2
|
---|
792 | sub ax,ax
|
---|
793 | ret16
|
---|
794 | DestroyDrvL2: mov ax,0001H
|
---|
795 | ret16
|
---|
796 | _RMDestroyDriverOrg endp
|
---|
797 |
|
---|
798 | ALIGN 2
|
---|
799 | PUBLIC _RMDestroyDriver16
|
---|
800 | _RMDestroyDriver16 proc far
|
---|
801 | enter32
|
---|
802 | xor eax, eax
|
---|
803 | push dword ptr [bp+10]
|
---|
804 | call _RMDestroyDriverOrg
|
---|
805 | add sp, 4
|
---|
806 | ret32
|
---|
807 | _RMDestroyDriver16 endp
|
---|
808 |
|
---|
809 |
|
---|
810 | ALIGN 2
|
---|
811 | _RMGetNodeInfoOrg proc far
|
---|
812 | enter16
|
---|
813 | test byte ptr _RMFlags,01H
|
---|
814 | je short GetNodeInfo_L3
|
---|
815 | test byte ptr _RMFlags,04H
|
---|
816 | je short GetNodeInfo_L1
|
---|
817 | lea ax,+6H[bp]
|
---|
818 | push ss
|
---|
819 | push ax
|
---|
820 | push 001cH
|
---|
821 | push cs
|
---|
822 | call near ptr _CallRM
|
---|
823 | mov sp,bp
|
---|
824 | ret16
|
---|
825 | GetNodeInfo_L1: mov ax,0014H
|
---|
826 | ret16
|
---|
827 | nop
|
---|
828 | GetNodeInfo_L2: test byte ptr _RMFlags,02H
|
---|
829 | je short GetNodeInfo_L3
|
---|
830 | mov ax,0015H
|
---|
831 | ret16
|
---|
832 | GetNodeInfo_L3: mov ax,0001H
|
---|
833 | ret16
|
---|
834 | _RMGetNodeInfoOrg endp
|
---|
835 |
|
---|
836 | ALIGN 2
|
---|
837 | PUBLIC _RMGetNodeInfo16
|
---|
838 | _RMGetNodeInfo16 proc far
|
---|
839 | enter32
|
---|
840 | xor eax, eax
|
---|
841 | push word ptr [bp+18] ;pushed as dword by watcom
|
---|
842 | push dword ptr [bp+14]
|
---|
843 | push dword ptr [bp+10]
|
---|
844 | call _RMGetNodeInfoOrg
|
---|
845 | add sp, 10
|
---|
846 | ret32
|
---|
847 | _RMGetNodeInfo16 endp
|
---|
848 |
|
---|
849 | ALIGN 2
|
---|
850 | _RMDevIDToHandleListOrg proc far
|
---|
851 | enter16
|
---|
852 | test byte ptr _RMFlags,01H
|
---|
853 | je short RMDevIDToHandleList_L2
|
---|
854 | test byte ptr _RMFlags,04H
|
---|
855 | je short RMDevIDToHandleList_L1
|
---|
856 | lea ax,+6H[bp]
|
---|
857 | push ss
|
---|
858 | push ax
|
---|
859 | push 0020H
|
---|
860 | push cs
|
---|
861 | call near ptr _CallRM
|
---|
862 | mov sp,bp
|
---|
863 | ret16
|
---|
864 | RMDevIDToHandleList_L1:
|
---|
865 | mov ax,0014H
|
---|
866 | ret16
|
---|
867 | nop
|
---|
868 | RMDevIDToHandleList_L2:
|
---|
869 | test byte ptr _RMFlags,02H
|
---|
870 | je short RMDevIDToHandleList_L3
|
---|
871 | sub ax,ax
|
---|
872 | ret16
|
---|
873 | nop
|
---|
874 | RMDevIDToHandleList_L3:
|
---|
875 | mov ax,0001H
|
---|
876 | ret16
|
---|
877 | nop
|
---|
878 | _RMDevIDToHandleListOrg endp
|
---|
879 |
|
---|
880 | ALIGN 2
|
---|
881 | PUBLIC _RMDevIDToHandleList16
|
---|
882 | _RMDevIDToHandleList16 proc far
|
---|
883 | enter32
|
---|
884 | xor eax, eax
|
---|
885 | push dword ptr [bp+42]
|
---|
886 | push dword ptr [bp+38]
|
---|
887 | push dword ptr [bp+34]
|
---|
888 | push dword ptr [bp+30]
|
---|
889 | push dword ptr [bp+26]
|
---|
890 | push dword ptr [bp+22]
|
---|
891 | push dword ptr [bp+18]
|
---|
892 | push dword ptr [bp+14]
|
---|
893 | push dword ptr [bp+10]
|
---|
894 | call _RMDevIDToHandleListOrg
|
---|
895 | add sp, 36
|
---|
896 | ret32
|
---|
897 | _RMDevIDToHandleList16 endp
|
---|
898 |
|
---|
899 | ALIGN 2
|
---|
900 | _RMHandleToResourceHandleListOrg proc far
|
---|
901 | enter16
|
---|
902 | test byte ptr _RMFlags,01H
|
---|
903 | je short RMHandleToResourceHandleList_L2
|
---|
904 | test byte ptr _RMFlags,04H
|
---|
905 | je short RMHandleToResourceHandleList_L1
|
---|
906 | lea ax,+6H[bp]
|
---|
907 | push ss
|
---|
908 | push ax
|
---|
909 | push 0021H
|
---|
910 | push cs
|
---|
911 | call near ptr _CallRM
|
---|
912 | ret16
|
---|
913 | nop
|
---|
914 | RMHandleToResourceHandleList_L1:
|
---|
915 | mov ax,0014H
|
---|
916 | ret16
|
---|
917 | nop
|
---|
918 | RMHandleToResourceHandleList_L2:
|
---|
919 | test byte ptr _RMFlags,02H
|
---|
920 | je short RMHandleToResourceHandleList_L3
|
---|
921 | sub ax,ax
|
---|
922 | ret16
|
---|
923 | nop
|
---|
924 | RMHandleToResourceHandleList_L3:
|
---|
925 | mov ax,0001H
|
---|
926 | ret16
|
---|
927 | nop
|
---|
928 | _RMHandleToResourceHandleListOrg endp
|
---|
929 |
|
---|
930 | ALIGN 2
|
---|
931 | PUBLIC _RMHandleToResourceHandleList16
|
---|
932 | _RMHandleToResourceHandleList16 proc far
|
---|
933 | enter32
|
---|
934 | xor eax, eax
|
---|
935 | push dword ptr [bp+14]
|
---|
936 | push dword ptr [bp+10]
|
---|
937 | call _RMHandleToResourceHandleListOrg
|
---|
938 | add sp, 8
|
---|
939 | ret32
|
---|
940 | _RMHandleToResourceHandleList16 endp
|
---|
941 |
|
---|
942 | ALIGN 2
|
---|
943 | ISR00_16 proc far
|
---|
944 | push ebx
|
---|
945 | mov ebx, 0
|
---|
946 | call far ptr FLAT:Interrupt32
|
---|
947 | pop ebx
|
---|
948 | retf
|
---|
949 | ISR00_16 endp
|
---|
950 |
|
---|
951 | ALIGN 2
|
---|
952 | ISR01_16 proc far
|
---|
953 | push ebx
|
---|
954 | mov ebx, 1
|
---|
955 | call far ptr FLAT:Interrupt32
|
---|
956 | pop ebx
|
---|
957 | retf
|
---|
958 | ISR01_16 endp
|
---|
959 |
|
---|
960 | ALIGN 2
|
---|
961 | ISR02_16 proc far
|
---|
962 | push ebx
|
---|
963 | mov ebx, 2
|
---|
964 | call far ptr FLAT:Interrupt32
|
---|
965 | pop ebx
|
---|
966 | retf
|
---|
967 | ISR02_16 endp
|
---|
968 |
|
---|
969 | ALIGN 2
|
---|
970 | ISR03_16 proc far
|
---|
971 | push ebx
|
---|
972 | mov ebx, 3
|
---|
973 | call far ptr FLAT:Interrupt32
|
---|
974 | pop ebx
|
---|
975 | retf
|
---|
976 | ISR03_16 endp
|
---|
977 |
|
---|
978 | ALIGN 2
|
---|
979 | ISR04_16 proc far
|
---|
980 | push ebx
|
---|
981 | mov ebx, 4
|
---|
982 | call far ptr FLAT:Interrupt32
|
---|
983 | pop ebx
|
---|
984 | retf
|
---|
985 | ISR04_16 endp
|
---|
986 |
|
---|
987 | ALIGN 2
|
---|
988 | ISR05_16 proc far
|
---|
989 | push ebx
|
---|
990 | mov ebx, 5
|
---|
991 | call far ptr FLAT:Interrupt32
|
---|
992 | pop ebx
|
---|
993 | retf
|
---|
994 | ISR05_16 endp
|
---|
995 |
|
---|
996 | ALIGN 2
|
---|
997 | ISR06_16 proc far
|
---|
998 | push ebx
|
---|
999 | mov ebx, 6
|
---|
1000 | call far ptr FLAT:Interrupt32
|
---|
1001 | pop ebx
|
---|
1002 | retf
|
---|
1003 | ISR06_16 endp
|
---|
1004 |
|
---|
1005 | ALIGN 2
|
---|
1006 | ISR07_16 proc far
|
---|
1007 | push ebx
|
---|
1008 | mov ebx, 7
|
---|
1009 | call far ptr FLAT:Interrupt32
|
---|
1010 | pop ebx
|
---|
1011 | retf
|
---|
1012 | ISR07_16 endp
|
---|
1013 |
|
---|
1014 | ;end of 16 bits code segment
|
---|
1015 | public __OffFinalCS16
|
---|
1016 | __OffFinalCS16 label byte
|
---|
1017 |
|
---|
1018 | CODE16 ends
|
---|
1019 | ; ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
|
---|
1020 | ;Label to mark start of 32 bits code section
|
---|
1021 | FIRSTCODE32 segment
|
---|
1022 | public __OffBeginCS32
|
---|
1023 | __OffBeginCS32 label byte
|
---|
1024 | FIRSTCODE32 ends
|
---|
1025 | ; ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
|
---|
1026 | CODE32 segment
|
---|
1027 | ASSUME CS:FLAT, DS:FLAT, ES:FLAT
|
---|
1028 |
|
---|
1029 | extrn ALSA_STRATEGY : near
|
---|
1030 | extrn ALSA_IDC : near
|
---|
1031 | extrn ALSA_TIMER_ : near
|
---|
1032 | extrn ALSA_Interrupt : near
|
---|
1033 | extrn _rdOffset: dword
|
---|
1034 | extrn KernThunkStackTo16 : near
|
---|
1035 | extrn KernThunkStackTo32 : near
|
---|
1036 |
|
---|
1037 | ;Called by Watcom to set the DS
|
---|
1038 | ALIGN 4
|
---|
1039 | __GETDS proc near
|
---|
1040 | push eax
|
---|
1041 | mov eax, DOS32FLATDS
|
---|
1042 | mov ds, eax
|
---|
1043 | pop eax
|
---|
1044 | ret
|
---|
1045 | __GETDS endp
|
---|
1046 |
|
---|
1047 | ALIGN 4
|
---|
1048 | DevHelpDebug proc near
|
---|
1049 | int 3
|
---|
1050 | int 3
|
---|
1051 | ret
|
---|
1052 | DevHelpDebug endp
|
---|
1053 |
|
---|
1054 | ALIGN 4
|
---|
1055 | public DevHlp
|
---|
1056 | DevHlp proc near
|
---|
1057 | DevThunkStackTo16_Int
|
---|
1058 | jmp far ptr CODE16:thunk3216_devhelp
|
---|
1059 | ALIGN 4
|
---|
1060 | thunk1632_devhelp:
|
---|
1061 | DevThunkStackTo32_Int
|
---|
1062 | ret
|
---|
1063 | DevHlp endp
|
---|
1064 |
|
---|
1065 | ALIGN 4
|
---|
1066 | DevHlp_ModifiedDS proc near
|
---|
1067 | DevThunkStackTo16_Int
|
---|
1068 | jmp far ptr CODE16:thunk3216_devhelp_modified_ds
|
---|
1069 | ALIGN 4
|
---|
1070 | thunk1632_devhelp_modified_ds:
|
---|
1071 | DevThunkStackTo32_Int
|
---|
1072 | ret
|
---|
1073 | DevHlp_ModifiedDS endp
|
---|
1074 |
|
---|
1075 | ;*******************************************************************************
|
---|
1076 | ;Copy parameters to 16 bits stack and call 16:32 IDC handler
|
---|
1077 | ;
|
---|
1078 | ; Paramters: IDC16_HANDLER pHandler
|
---|
1079 | ; ULONG cmd
|
---|
1080 | ; ULONG param1
|
---|
1081 | ; ULONG param2
|
---|
1082 | ;*******************************************************************************
|
---|
1083 | PUBLIC _CallPDD16
|
---|
1084 | ALIGN 4
|
---|
1085 | _CallPDD16 proc near
|
---|
1086 | push ebp
|
---|
1087 | mov ebp, esp
|
---|
1088 | push ebx
|
---|
1089 | lea ebx, [ebp+8]
|
---|
1090 | DevThunkStackTo16_Int
|
---|
1091 | push dword ptr [ebx+16] ;param2
|
---|
1092 | push dword ptr [ebx+12] ;param1
|
---|
1093 | push dword ptr [ebx+8] ;cmd
|
---|
1094 | call fword ptr [ebx]
|
---|
1095 | add sp, 12
|
---|
1096 | DevThunkStackTo32_Int
|
---|
1097 | pop ebx
|
---|
1098 | pop ebp
|
---|
1099 | ret
|
---|
1100 | _CallPDD16 endp
|
---|
1101 |
|
---|
1102 | ;*******************************************************************************
|
---|
1103 | ;Strategy entrypoint
|
---|
1104 | ; Parameter:
|
---|
1105 | ; fs:ebx -> request packet pointer
|
---|
1106 | ;*******************************************************************************
|
---|
1107 | ALIGN 4
|
---|
1108 | STRATEGY_ proc far
|
---|
1109 | push ds
|
---|
1110 | push es
|
---|
1111 | push fs
|
---|
1112 | push gs
|
---|
1113 | mov eax, DOS32FLATDS
|
---|
1114 | mov ds, eax
|
---|
1115 | mov es, eax
|
---|
1116 | DevThunkStackTo32
|
---|
1117 | call ALSA_STRATEGY
|
---|
1118 | DevThunkStackTo16
|
---|
1119 | pop gs
|
---|
1120 | pop fs
|
---|
1121 | pop es
|
---|
1122 | pop ds
|
---|
1123 | retf
|
---|
1124 | STRATEGY_ endp
|
---|
1125 |
|
---|
1126 | ;*******************************************************************************
|
---|
1127 | ;IDC entrypoint
|
---|
1128 | ;
|
---|
1129 | ;in: ecx = cmd
|
---|
1130 | ; edx = ULONG parameter
|
---|
1131 | ;return value in eax
|
---|
1132 | ;*******************************************************************************
|
---|
1133 | ALIGN 4
|
---|
1134 | IDC_ proc far
|
---|
1135 | push ds
|
---|
1136 | push es
|
---|
1137 | push fs
|
---|
1138 | push gs
|
---|
1139 | mov eax, DOS32FLATDS
|
---|
1140 | mov ds, eax
|
---|
1141 | mov es, eax
|
---|
1142 | DevThunkStackTo32
|
---|
1143 | call ALSA_IDC
|
---|
1144 | DevThunkStackTo16
|
---|
1145 | pop gs
|
---|
1146 | pop fs
|
---|
1147 | pop es
|
---|
1148 | pop ds
|
---|
1149 | retf
|
---|
1150 | IDC_ endp
|
---|
1151 | ;*******************************************************************************
|
---|
1152 | ;Timer entrypoint
|
---|
1153 | ;
|
---|
1154 | ;*******************************************************************************
|
---|
1155 | ALIGN 4
|
---|
1156 | TIMER_ proc far
|
---|
1157 | push ds
|
---|
1158 | push es
|
---|
1159 | push fs
|
---|
1160 | push gs
|
---|
1161 | mov eax, DOS32FLATDS
|
---|
1162 | mov ds, eax
|
---|
1163 | mov es, eax
|
---|
1164 | IFDEF DEBUG
|
---|
1165 | add DbgU32TimerCnt, 1
|
---|
1166 | ENDIF
|
---|
1167 | DevThunkStackTo32
|
---|
1168 | call ALSA_TIMER_
|
---|
1169 | DevThunkStackTo16
|
---|
1170 | IFDEF DEBUG
|
---|
1171 | add DbgU32TimerCnt, -1
|
---|
1172 | ENDIF
|
---|
1173 | pop gs
|
---|
1174 | pop fs
|
---|
1175 | pop es
|
---|
1176 | pop ds
|
---|
1177 | retf
|
---|
1178 | TIMER_ endp
|
---|
1179 |
|
---|
1180 |
|
---|
1181 | ;*******************************************************************************
|
---|
1182 | ;32 bits interrupt wrapper which calls the generic interrupt handler in irq.cpp
|
---|
1183 | ;On entry:
|
---|
1184 | ; EBX = irq nr
|
---|
1185 | ;*******************************************************************************
|
---|
1186 | ALIGN 4
|
---|
1187 | Interrupt32 proc far
|
---|
1188 | enter 0, 0
|
---|
1189 | and sp, 0fffch ; align stack
|
---|
1190 | pushad
|
---|
1191 | push ds
|
---|
1192 | push es
|
---|
1193 | push fs
|
---|
1194 | push gs
|
---|
1195 | mov eax, DOS32FLATDS
|
---|
1196 | mov ds, eax
|
---|
1197 | mov es, eax
|
---|
1198 | pushfd
|
---|
1199 | IFDEF DEBUG
|
---|
1200 | add DbgU32IntCnt, 1
|
---|
1201 | ENDIF
|
---|
1202 | ; At this point a cli is redundant
|
---|
1203 | ; we enter the interrupt handler with interrupts disabled.
|
---|
1204 | ;cli
|
---|
1205 | DevThunkStackTo32
|
---|
1206 | ;returns irq status in eax (1=handled; 0=unhandled)
|
---|
1207 | call ALSA_Interrupt
|
---|
1208 | DevThunkStackTo16
|
---|
1209 | IFDEF DEBUG
|
---|
1210 | add DbgU32IntCnt, -1
|
---|
1211 | ENDIF
|
---|
1212 | ;restore flags
|
---|
1213 | popfd
|
---|
1214 | cmp eax, 1
|
---|
1215 | je irqhandled
|
---|
1216 | stc ;tell OS/2 kernel we didn't handle this interrupt
|
---|
1217 | jmp short endofirq
|
---|
1218 | irqhandled:
|
---|
1219 | clc ;tell OS/2 kernel this interrupt was ours
|
---|
1220 | endofirq:
|
---|
1221 | pop gs
|
---|
1222 | pop fs
|
---|
1223 | pop es
|
---|
1224 | pop ds
|
---|
1225 | popad
|
---|
1226 | leave
|
---|
1227 | retf
|
---|
1228 | Interrupt32 endp
|
---|
1229 |
|
---|
1230 | ALIGN 4
|
---|
1231 | HelpClose proc far
|
---|
1232 | push ds
|
---|
1233 | mov eax, DOS32FLATDS
|
---|
1234 | mov ds, eax
|
---|
1235 | mov _rdOffset, 0
|
---|
1236 | pop ds
|
---|
1237 | retf
|
---|
1238 | HelpClose endp
|
---|
1239 |
|
---|
1240 |
|
---|
1241 | ;*******************************************************************************
|
---|
1242 | ;resource manager wrappers (switch stack and call 16 bits function)
|
---|
1243 | ;*******************************************************************************
|
---|
1244 | public _RMAllocResource
|
---|
1245 | public _RMModifyResources
|
---|
1246 | public _RMDeallocResource
|
---|
1247 | public _RMCreateDevice
|
---|
1248 | public _RMCreateAdapter
|
---|
1249 | public _RMCreateDriver
|
---|
1250 | public _RMDestroyDriver
|
---|
1251 | public _RMGetNodeInfo
|
---|
1252 | public _RMDevIDToHandleList
|
---|
1253 | public _RMHandleToResourceHandleList
|
---|
1254 |
|
---|
1255 | ALIGN 4
|
---|
1256 |
|
---|
1257 | ALIGN 4
|
---|
1258 | _RMAllocResource proc near
|
---|
1259 | enterKEERM
|
---|
1260 | xor eax, eax
|
---|
1261 | push dword ptr [edi+16]
|
---|
1262 | push dword ptr [edi+12]
|
---|
1263 | push dword ptr [edi+8]
|
---|
1264 | call fword ptr RMAllocResource1632
|
---|
1265 | add sp, 12
|
---|
1266 | retKEERM
|
---|
1267 | _RMAllocResource endp
|
---|
1268 |
|
---|
1269 | ALIGN 4
|
---|
1270 | _RMModifyResources proc near
|
---|
1271 | enterKEERM
|
---|
1272 | xor eax, eax
|
---|
1273 | push dword ptr [edi+20]
|
---|
1274 | push dword ptr [edi+16]
|
---|
1275 | push dword ptr [edi+12]
|
---|
1276 | push dword ptr [edi+8]
|
---|
1277 | call fword ptr RMModifyResources1632
|
---|
1278 | add sp, 16
|
---|
1279 | retKEERM
|
---|
1280 | _RMModifyResources endp
|
---|
1281 |
|
---|
1282 | ALIGN 4
|
---|
1283 | _RMDeallocResource proc near
|
---|
1284 | enterKEERM
|
---|
1285 | xor eax, eax
|
---|
1286 | push dword ptr [edi+12]
|
---|
1287 | push dword ptr [edi+8]
|
---|
1288 | call fword ptr RMDeallocResource1632
|
---|
1289 | add sp, 8
|
---|
1290 | retKEERM
|
---|
1291 | _RMDeallocResource endp
|
---|
1292 |
|
---|
1293 | ALIGN 4
|
---|
1294 | _RMCreateDevice proc near
|
---|
1295 | enterKEERM
|
---|
1296 | xor eax, eax
|
---|
1297 | push dword ptr [edi+24]
|
---|
1298 | push dword ptr [edi+20]
|
---|
1299 | push dword ptr [edi+16]
|
---|
1300 | push dword ptr [edi+12]
|
---|
1301 | push dword ptr [edi+8]
|
---|
1302 | call fword ptr RMCreateDevice1632
|
---|
1303 | add sp, 20
|
---|
1304 | retKEERM
|
---|
1305 | _RMCreateDevice endp
|
---|
1306 |
|
---|
1307 | ALIGN 4
|
---|
1308 | _RMCreateAdapter proc near
|
---|
1309 | enterKEERM
|
---|
1310 | xor eax, eax
|
---|
1311 | push dword ptr [edi+24]
|
---|
1312 | push dword ptr [edi+20]
|
---|
1313 | push dword ptr [edi+16]
|
---|
1314 | push dword ptr [edi+12]
|
---|
1315 | push dword ptr [edi+8]
|
---|
1316 | call fword ptr RMCreateAdapter1632
|
---|
1317 | add sp, 20
|
---|
1318 | retKEERM
|
---|
1319 | _RMCreateAdapter endp
|
---|
1320 |
|
---|
1321 | ALIGN 4
|
---|
1322 | _RMCreateDriver proc near
|
---|
1323 | enterKEERM
|
---|
1324 | xor eax, eax
|
---|
1325 | push dword ptr [edi+12]
|
---|
1326 | push dword ptr [edi+8]
|
---|
1327 | call fword ptr RMCreateDriver1632
|
---|
1328 | add sp, 8
|
---|
1329 | retKEERM
|
---|
1330 | _RMCreateDriver endp
|
---|
1331 |
|
---|
1332 | ALIGN 4
|
---|
1333 | _RMDestroyDriver proc near
|
---|
1334 | enterKEERM
|
---|
1335 | xor eax, eax
|
---|
1336 | push dword ptr [edi+8]
|
---|
1337 | call fword ptr RMDestroyDriver1632
|
---|
1338 | add sp, 4
|
---|
1339 | ret32
|
---|
1340 | _RMDestroyDriver endp
|
---|
1341 |
|
---|
1342 | ALIGN 4
|
---|
1343 | _RMGetNodeInfo proc near
|
---|
1344 | enterKEERM
|
---|
1345 | xor eax, eax
|
---|
1346 | push dword ptr [edi+16]
|
---|
1347 | push dword ptr [edi+12]
|
---|
1348 | push dword ptr [edi+8]
|
---|
1349 | call fword ptr RMGetNodeInfo1632
|
---|
1350 | add sp, 12
|
---|
1351 | retKEERM
|
---|
1352 | _RMGetNodeInfo endp
|
---|
1353 |
|
---|
1354 | ALIGN 4
|
---|
1355 | _RMDevIDToHandleList proc near
|
---|
1356 | enterKEERM
|
---|
1357 | xor eax, eax
|
---|
1358 | push dword ptr [edi+40]
|
---|
1359 | push dword ptr [edi+36]
|
---|
1360 | push dword ptr [edi+32]
|
---|
1361 | push dword ptr [edi+28]
|
---|
1362 | push dword ptr [edi+24]
|
---|
1363 | push dword ptr [edi+20]
|
---|
1364 | push dword ptr [edi+16]
|
---|
1365 | push dword ptr [edi+12]
|
---|
1366 | push dword ptr [edi+8]
|
---|
1367 | call fword ptr RMDevIDToHandleList1632
|
---|
1368 | add sp, 36
|
---|
1369 | retKEERM
|
---|
1370 | _RMDevIDToHandleList endp
|
---|
1371 |
|
---|
1372 | ALIGN 4
|
---|
1373 | _RMHandleToResourceHandleList proc near
|
---|
1374 | enterKEERM
|
---|
1375 | xor eax, eax
|
---|
1376 | push dword ptr [edi+12]
|
---|
1377 | push dword ptr [edi+8]
|
---|
1378 | call fword ptr RMHandleToResourceHandleList1632
|
---|
1379 | add sp, 8
|
---|
1380 | retKEERM
|
---|
1381 | _RMHandleToResourceHandleList endp
|
---|
1382 |
|
---|
1383 | ; shifted from devhlp.asm
|
---|
1384 | extrn DOSIODELAYCNT : ABS
|
---|
1385 | ALIGN 4
|
---|
1386 | public iodelay32_
|
---|
1387 | iodelay32_ proc near
|
---|
1388 | mov eax, DOSIODELAYCNT
|
---|
1389 | align 4
|
---|
1390 | @@: dec eax
|
---|
1391 | jnz @b
|
---|
1392 | loop iodelay32_
|
---|
1393 | ret
|
---|
1394 | iodelay32_ endp
|
---|
1395 |
|
---|
1396 | CODE32 ends
|
---|
1397 | ; ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
|
---|
1398 | ;Label to mark end of 32 bits code section
|
---|
1399 | LASTCODE32 segment
|
---|
1400 | public __OffFinalCS32
|
---|
1401 | __OffFinalCS32 label byte
|
---|
1402 | LASTCODE32 ends
|
---|
1403 | ; ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
|
---|
1404 | ;Label to mark start of 32 bits data section
|
---|
1405 | BSS32 segment
|
---|
1406 | public __OffBeginDS32
|
---|
1407 | __OffBeginDS32 dd 0
|
---|
1408 | BSS32 ends
|
---|
1409 | ; ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
|
---|
1410 | DATA32 segment
|
---|
1411 |
|
---|
1412 | public stackbase
|
---|
1413 | public stacksel
|
---|
1414 | stackbase dd 0
|
---|
1415 | stacksel dd 0
|
---|
1416 |
|
---|
1417 | public __OffsetFinalCS16
|
---|
1418 | public __OffsetFinalDS16
|
---|
1419 | __OffsetFinalCS16 dw OFFSET CODE16:__OffFinalCS16
|
---|
1420 | __OffsetFinalDS16 dw OFFSET DATA16:__OffFinalDS16
|
---|
1421 |
|
---|
1422 | public _MSG_TABLE32
|
---|
1423 | _MSG_TABLE32 dw OFFSET DATA16:_MSG_TABLE16
|
---|
1424 | dw SEG DATA16:_MSG_TABLE16
|
---|
1425 |
|
---|
1426 | ;16:32 addresses of resource manager functions in 16 bits code segment
|
---|
1427 | public RMAllocResource1632
|
---|
1428 | public RMModifyResources1632
|
---|
1429 | public RMDeallocResource1632
|
---|
1430 | public RMCreateDevice1632
|
---|
1431 | public RMCreateAdapter1632
|
---|
1432 | public RMCreateDriver1632
|
---|
1433 | public RMDestroyDriver1632
|
---|
1434 | public RMGetNodeInfo1632
|
---|
1435 | public RMDevIDToHandleList1632
|
---|
1436 | public RMHandleToResourceHandleList1632
|
---|
1437 | RMAllocResource1632 dd OFFSET CODE16:_RMAllocResource16
|
---|
1438 | dw SEG CODE16:_RMAllocResource16
|
---|
1439 | dw 0
|
---|
1440 | RMModifyResources1632 dd OFFSET CODE16:_RMModifyResources16
|
---|
1441 | dw SEG CODE16:_RMModifyResources16
|
---|
1442 | dw 0
|
---|
1443 | RMDeallocResource1632 dd OFFSET CODE16:_RMDeallocResource16
|
---|
1444 | dw SEG CODE16:_RMDeallocResource16
|
---|
1445 | dw 0
|
---|
1446 | RMCreateDevice1632 dd OFFSET CODE16:_RMCreateDevice16
|
---|
1447 | dw SEG CODE16:_RMCreateDevice16
|
---|
1448 | dw 0
|
---|
1449 | RMCreateAdapter1632 dd OFFSET CODE16:_RMCreateAdapter16
|
---|
1450 | dw SEG CODE16:_RMCreateAdapter16
|
---|
1451 | dw 0
|
---|
1452 | RMCreateDriver1632 dd OFFSET CODE16:_RMCreateDriver16
|
---|
1453 | dw SEG CODE16:_RMCreateDriver16
|
---|
1454 | dw 0
|
---|
1455 | RMDestroyDriver1632 dd OFFSET CODE16:_RMDestroyDriver16
|
---|
1456 | dw SEG CODE16:_RMDestroyDriver16
|
---|
1457 | dw 0
|
---|
1458 | RMGetNodeInfo1632 dd OFFSET CODE16:_RMGetNodeInfo16
|
---|
1459 | dw SEG CODE16:_RMGetNodeInfo16
|
---|
1460 | dw 0
|
---|
1461 | RMDevIDToHandleList1632 dd OFFSET CODE16:_RMDevIDToHandleList16
|
---|
1462 | dw SEG CODE16:_RMDevIDToHandleList16
|
---|
1463 | dw 0
|
---|
1464 |
|
---|
1465 | RMHandleToResourceHandleList1632 dd OFFSET CODE16:_RMHandleToResourceHandleList16
|
---|
1466 | dw SEG CODE16:_RMHandleToResourceHandleList16
|
---|
1467 | dw 0
|
---|
1468 |
|
---|
1469 | ;16:16 address of uniaud_stub_timer
|
---|
1470 | public _TimerHandler16
|
---|
1471 | _TimerHandler16 dd OFFSET CODE16:uniaud_stub_timer
|
---|
1472 | dw OFFSET CODE16:uniaud_stub_timer
|
---|
1473 |
|
---|
1474 | ;16:16 addresses of interrupt dispatchers
|
---|
1475 | public _ISR00
|
---|
1476 | public _ISR01
|
---|
1477 | public _ISR02
|
---|
1478 | public _ISR03
|
---|
1479 | public _ISR04
|
---|
1480 | public _ISR05
|
---|
1481 | public _ISR06
|
---|
1482 | public _ISR07
|
---|
1483 | _ISR00 dw OFFSET CODE16:ISR00_16
|
---|
1484 | dw SEG CODE16:ISR00_16
|
---|
1485 | _ISR01 dw OFFSET CODE16:ISR01_16
|
---|
1486 | dw SEG CODE16:ISR01_16
|
---|
1487 | _ISR02 dw OFFSET CODE16:ISR02_16
|
---|
1488 | dw SEG CODE16:ISR02_16
|
---|
1489 | _ISR03 dw OFFSET CODE16:ISR03_16
|
---|
1490 | dw SEG CODE16:ISR03_16
|
---|
1491 | _ISR04 dw OFFSET CODE16:ISR04_16
|
---|
1492 | dw SEG CODE16:ISR04_16
|
---|
1493 | _ISR05 dw OFFSET CODE16:ISR05_16
|
---|
1494 | dw SEG CODE16:ISR05_16
|
---|
1495 | _ISR06 dw OFFSET CODE16:ISR06_16
|
---|
1496 | dw SEG CODE16:ISR06_16
|
---|
1497 | _ISR07 dw OFFSET CODE16:ISR07_16
|
---|
1498 | dw SEG CODE16:ISR07_16
|
---|
1499 | DATA32 ends
|
---|
1500 | ; ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
|
---|
1501 | ;Label to mark end of 32 bits data section
|
---|
1502 | LASTDATA32 segment
|
---|
1503 | public __OffFinalDS32
|
---|
1504 | __OffFinalDS32 dd 0
|
---|
1505 | LASTDATA32 ends
|
---|
1506 |
|
---|
1507 | end
|
---|