Mail Archives: djgpp/2005/10/07/17:00:58
> But the problem remains, I don't want a hardware interrupt. I was
looking
> for a replacement wrapper for
_go32_dpmi_allocate_real_mode_callback_iret
> since I suspect my problem lies in the fact those wrappers are non
> reentrant.
Sure, you might look at Chris Jones's old LFNDOS driver. He uses
some assembly to switch out of an interrupt context allowing full
use of C. I personally found that this didn't work too well, but
it may serve your needs. This is the only place I could find the
source lfndssrc.zip, so get it quick...
http://csd.lae.pp.ru:8101/pub/msdos/misc/
Also, there were four or five patches posted on www.ezboard.com
which are no longer available, including the assembly code (below).
LFNDOS.CPP shows how to call intwrap.asm.
Rod Pemberton
; INTWRAP.ASM - (c) 1998 Chris Jones
; This procedure is called in an interrupt context. It then calls
the
; cinthandler function out of interrupt context, which enables
system calls
; to be made. When the C function finishes, it returns to the
previous
; point of execution.
.model large,c
extrn cinthandler,tempstack
public intpointer,asminthandler
segment _DATA word public 'data'
intpointer dd 0
ends
segment _TEXT word public 'code'
assume cs:_text
asminthandler proc
pushf
push ax ; cs
push ax ; ip
push ax
push bx
push cx
push dx
push es
push ds
push si
push di
push bp
push ax
mov ax,DGROUP
mov ds,ax
pop ax
mov word ptr ds:intpointer+2,ss
mov word ptr ds:intpointer,sp
mov dx,word ptr ds:tempstack+2
mov ss,dx
mov sp,word ptr ds:tempstack
call far ptr cinthandler
mov dx,word ptr ds:intpointer+2
mov ss,dx
mov sp,word ptr ds:intpointer
pop bp
pop di
pop si
pop ds
pop es
pop dx
pop cx
pop bx
pop ax
iret
endp
ends
end
--
Posted via: http://www.cyberjustice.org
- Raw text -