www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/02/28/23:39:40

From: sandmann AT clio DOT rice DOT edu (Charles Sandmann)
Subject: Re: Mouse under DPMI ?
To: pgf AT Cayman DOT COM
Date: Mon, 28 Feb 1994 22:01:01 -0600 (CST)
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu (DJGPP Mailing List)

> i've just been trying to use the mouse under go32/dpmi, and it wasn't working.
> these two messages imply that i'm probably going to have do a lot more to make
> it work than i thought.  i was using the "allocate_retf_wrapper" thingamajig
> to encapsulate my mouse handler, and handing the real-mode function pointer
> i obtain that way to the mouse handler installation trap.
> 
> this seems to get my handler called, but then i crash in a call i make
> to "show mouse cursor", using dpmi_simulate_int().
> 
> (i know i've been loose with routine names in this message -- i think if
> you've been here, you'll know what i'm talking about...)
> 
> is there more magic dust i need to sprinkle over the mouse code?

There are potentially several problems here:
1) Current go32_dpmi_* wrapper routines don't set SS, so they don't work 
   properly in DPMI mode if you try to work with automatic variables.
   They also don't clear the direction flag.
2) DPMI only provides a 4K stack for real mode callbacks.  This is too
   small to call many lib routines.
3) There are certain things you shouldn't do from a callback - I'm not
   sure if calling a real mode int is one of them.  You would have to read
   the DPMI spec to be sure.

The mouse code mentioned before is mostly inline GAS code and does not
call these routines (it was developed before I knew about them).  It 
allocates it's own 64K stack and switches to it.  It is part of the GRX
library with full DPMI support which is not finished or released yet.

I have a patched version of the go32_dpmi_chain_interrupt routine which
does this stack swapping and expansion (it was needed to make a routine
call work from a hardware interrupt under Windows).  I haven't had time to 
check all of the routines yet, but when I do I will send them to DJ.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019