Does someone has success when executing DPMI programs ? Every program I try to execute at this time fails, going to the debugger, saying :
Unhandled exception: privileged instruction in 32-bit code (0x00000000). In 32-bit mode. 0x00000000: int $0x31
DPMI16 programs should work as should simple DPMI32 programs. However, most DPMI32 programs are not even supposed to work because there is no real implementation of 32-bit interrupt handling. It is on my TODO list but I'm currently working on moving interrupt handlers to winedos dll and I shall return to DPMI32 support after this.
The problem is that Wine has no support for calling Wine functions from application context whose stack and code pointers use 32-bit segmented model. Wine interrupt emulation currently uses a simple scheme which works with any code pointer but which fails miserably if stack pointer is over 0xffff. The simplest fix would probably be to swap to 16-bit stack on entry to Wine interrupt handler. This would mean that only winedos dll needs to deal with 32-bit segmented stuff. I have a rather good idea on how this can be implemented.
Anyway, your error message looks quite interesting because current Wine version emulates *all* interrupt opcodes in real mode, 16-bit protected mode and 32-bit protected mode and thus it should be impossible to get this error message. Are you sure you tried executing using the latest CVS version or at least the latest release?
The problem is that Wine has no support for calling Wine functions from application context whose stack and code pointers use 32-bit segmented model. Wine interrupt emulation currently uses a simple scheme which works with any code pointer but which fails miserably if stack pointer is over 0xffff. The simplest fix would probably be to swap to 16-bit stack on entry to Wine interrupt handler. This would mean that only winedos dll needs to deal with 32-bit segmented stuff. I have a rather good idea on how this can be implemented.
Anyway, your error message looks quite interesting because current Wine version emulates *all* interrupt opcodes in real mode, 16-bit protected mode and 32-bit protected mode and thus it should be impossible to get this error message. Are you sure you tried executing using the latest CVS version or at least the latest release?
as i'm sending patches and working on cygwin/wine, i'm always doing cvs update and looking into the wine-cvs/wine-patches lists to see if some patches are committed.
if you look at the log of some dpmi program, it makes call to int31 handler and thus switches to 32-bit mode. after that program makes some things, then wants to make a dpmi call : wine says that int xx is forbidden in 32 bit mode.
___________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com
On Sun, Nov 24, 2002, Sylvain Petreolle wrote:
as i'm sending patches and working on cygwin/wine, i'm always doing cvs update and looking into the wine-cvs/wine-patches lists to see if some patches are committed.
if you look at the log of some dpmi program, it makes call to int31 handler and thus switches to 32-bit mode. after that program makes some things, then wants to make a dpmi call : wine says that int xx is forbidden in 32 bit mode.
Oh, that error message. Well, the line that generates the message was deleted about seven weeks ago from official Wine CVS. Anyway, as I already has stated, most DPMI32 programs won't work and I will start working on that problem when I get interrupt handler migration finished. This would likely happen during late december or early january.
Sigh, I just sometimes wonder why I bother to explain these things... All DPMI16 programs should work and for some strange reason some DPMI32 programs work, too (pkzip for example). StartPM is called from int31 handler when "int 0x31" opcode is executed in DPMI protected mode switch wrapper. StartPM always makes a switch to 16-bit protected mode. DPMI32 applications usually allocate a 32-bit selector and make a jump which loads that selector into CS register. This makes the application enter 32-bit protected mode.
--- Jukka Heinonen jhei@iki.fi a écrit : > > Does someone has success when executing DPMI programs ?
Every program I try to execute at this time fails, going to the debugger, saying :
Unhandled exception: privileged instruction in 32-bit code (0x00000000). In 32-bit mode. 0x00000000: int $0x31
DPMI16 programs should work as should simple DPMI32 programs. However, most DPMI32 programs are not even supposed to work because there is no real implementation of 32-bit interrupt handling. It is on my TODO list but I'm currently working on moving interrupt handlers to winedos dll and I shall return to DPMI32 support after this.
Instead of that, couldn't we call DOSVM_EmulateInterruptPM ? After all we are moving all msdos code to winedos.dll.
* DOSVM_EmulateInterruptPM * Emulate software interrupt in 16-bit or 32-bit protected mode. * Called from signal handler when intXX opcode is executed. * * Pushes interrupt frame to stack and changes instruction * pointer to interrupt handler. */
The problem is that Wine has no support for calling Wine functions from application context whose stack and code pointers use 32-bit segmented model. Wine interrupt emulation currently uses a simple scheme which works with any code pointer but which fails miserably if stack pointer is over 0xffff. The simplest fix would probably be to swap to 16-bit stack on entry to Wine interrupt handler. This would mean that only winedos dll needs to deal with 32-bit segmented stuff. I have a rather good idea on how this can be implemented.
Anyway, your error message looks quite interesting because current Wine version emulates *all* interrupt opcodes in real mode, 16-bit protected mode and 32-bit protected mode and thus it should be impossible to get this error message. Are you sure you tried executing using the latest CVS version or at least the latest release?
-- Jukka Heinonen http://www.iki.fi/jhei/
___________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com