Mail Archives: djgpp/1997/02/19/18:51:30
Jih-Shin Ho writes:
>For some reason, I want to use __dpmi_int() in real-mode-callback function.
>Can it work ?
I'm not 100% sure, but I doubt it. The only reason I can think of that
you would need to call __dpmi_int() is for accessing OS functions, and
given DOS's lack of reentrancy that is likely to cause trouble.
From personal experience, the only time I tried this was when I was
writing the mouse handler for Allegro, and it didn't work then. I wanted
to draw the pointer (which involves calling VESA interrupt functions),
inside the mouse driver callback, and that caused some spectacular
crashes :-) I later moved the pointer display code to my timer interrupt
handler, and just set a flag in the real mode callback which causes the
timer routine to redraw the pointer, and that works fine. So calling the
VESA functions in a timer interrupt seems to be ok, but not in a real
mode callback... Disclaimer: this knowledge is empirical in origin, and
could be completely wrong :-)
>This RMCB is called by a hardware interrupt service in real-mode.
Why? Wouldn't it be simpler to trap the hardware interrupt directly in
protected mode? If you install a protected mode handler, DPMI
automatically reflects real mode interrupts to it...
/*
* Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
* Ghoti: 'gh' as in 'enough', 'o' as in 'women', and 'ti' as in 'nation'.
*/
- Raw text -