2000-05-06 21:34:20 +02:00
|
|
|
;
|
|
|
|
; File:
|
|
|
|
; execrh.asm
|
|
|
|
; Description:
|
|
|
|
; request handler for calling device drivers
|
|
|
|
;
|
|
|
|
; Copyright (c) 1995, 1998
|
|
|
|
; Pasquale J. Villani
|
|
|
|
; All Rights Reserved
|
|
|
|
;
|
|
|
|
; This file is part of DOS-C.
|
|
|
|
;
|
|
|
|
; DOS-C is free software; you can redistribute it and/or
|
|
|
|
; modify it under the terms of the GNU General Public License
|
|
|
|
; as published by the Free Software Foundation; either version
|
|
|
|
; 2, or (at your option) any later version.
|
|
|
|
;
|
|
|
|
; DOS-C is distributed in the hope that it will be useful, but
|
|
|
|
; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
|
|
|
|
; the GNU General Public License for more details.
|
|
|
|
;
|
|
|
|
; You should have received a copy of the GNU General Public
|
|
|
|
; License along with DOS-C; see the file COPYING. If not,
|
|
|
|
; write to the Free Software Foundation, 675 Mass Ave,
|
|
|
|
; Cambridge, MA 02139, USA.
|
|
|
|
;
|
|
|
|
; $Id$
|
|
|
|
;
|
|
|
|
|
|
|
|
%include "segs.inc"
|
|
|
|
|
2003-03-12 23:43:53 +01:00
|
|
|
segment HMA_TEXT
|
2004-04-09 13:16:03 +02:00
|
|
|
; EXECRH
|
2000-05-06 21:34:20 +02:00
|
|
|
; Execute Device Request
|
|
|
|
;
|
|
|
|
; execrh(rhp, dhp)
|
|
|
|
; request far *rhp;
|
|
|
|
; struct dhdr far *dhp;
|
|
|
|
;
|
|
|
|
;
|
|
|
|
; The stack is very critical in here.
|
|
|
|
;
|
2004-04-09 13:16:03 +02:00
|
|
|
global EXECRH
|
|
|
|
global INIT_EXECRH
|
2002-02-09 01:40:33 +01:00
|
|
|
|
2004-04-09 13:16:03 +02:00
|
|
|
%macro EXECRHM 0
|
2000-05-06 21:34:20 +02:00
|
|
|
push bp ; perform c entry
|
|
|
|
mov bp,sp
|
|
|
|
push si
|
2001-04-15 05:21:50 +02:00
|
|
|
push ds ; sp=bp-8
|
2000-05-06 21:34:20 +02:00
|
|
|
|
2004-04-09 13:16:03 +02:00
|
|
|
lds si,[bp+4] ; ds:si = device header
|
|
|
|
les bx,[bp+8] ; es:bx = request header
|
2000-05-06 21:34:20 +02:00
|
|
|
|
2001-11-04 20:47:39 +01:00
|
|
|
|
|
|
|
mov ax, [si+6] ; construct strategy address
|
2004-04-09 13:16:03 +02:00
|
|
|
mov [bp+4], ax
|
2001-11-04 20:47:39 +01:00
|
|
|
|
2003-03-12 07:36:00 +01:00
|
|
|
push si ; the bloody fucking RTSND.DOS
|
|
|
|
push di ; driver destroys SI,DI (tom 14.2.03)
|
|
|
|
|
2004-04-09 13:16:03 +02:00
|
|
|
call far[bp+4] ; call far the strategy
|
2001-11-04 20:47:39 +01:00
|
|
|
|
2003-03-12 07:36:00 +01:00
|
|
|
pop di
|
|
|
|
pop si
|
|
|
|
|
|
|
|
|
2002-01-23 23:29:41 +01:00
|
|
|
mov ax,[si+8] ; construct 'interrupt' address
|
2004-04-09 13:16:03 +02:00
|
|
|
mov [bp+4],ax ; construct interrupt address
|
|
|
|
call far[bp+4] ; call far the interrupt
|
2001-04-03 01:18:30 +02:00
|
|
|
|
2001-04-15 05:21:50 +02:00
|
|
|
sti ; damm driver turn off ints
|
|
|
|
cld ; has gone backwards
|
2000-05-06 21:34:20 +02:00
|
|
|
pop ds
|
|
|
|
pop si
|
|
|
|
pop bp
|
2004-04-09 13:16:03 +02:00
|
|
|
ret 8
|
2002-02-09 01:40:33 +01:00
|
|
|
%endmacro
|
|
|
|
|
2004-04-09 13:16:03 +02:00
|
|
|
EXECRH:
|
|
|
|
EXECRHM
|
2002-02-09 01:40:33 +01:00
|
|
|
|
|
|
|
segment INIT_TEXT
|
|
|
|
|
2004-04-09 13:16:03 +02:00
|
|
|
INIT_EXECRH:
|
|
|
|
EXECRHM
|