X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Rod Pemberton Newsgroups: comp.os.msdos.djgpp Subject: Re: Need to hook INT 21h from a DJGPP TSR Date: Fri, 7 Oct 2005 20:57:31 +0000 (UTC) Organization: cyberjustice.org Lines: 89 Message-ID: References: NNTP-Posting-Host: 66.28.207.11 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8bit X-Trace: sadr.dfn.de 1128718651 8565 66.28.207.11 (7 Oct 2005 20:57:31 GMT) X-Complaints-To: usenet AT sadr DOT dfn DOT de NNTP-Posting-Date: Fri, 7 Oct 2005 20:57:31 +0000 (UTC) X-User-Real-E-Mail: nobody AT no DOT where DOT com User-Agent: http://www.cyberjustice.org To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com > 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