Mail Archives: djgpp-workers/1998/06/08/12:08:08
I think I know how to solve this. Please try this small variant on
Salvador's original program and see if it works. I tested it on DOS,
Windows 3.1 and Windows 95 and it seems to work on all of them,
including the one which had problems with the original program.
If this works, then we need to replace __dpmi_yield in the library and
rebuild the affected binaries.
I'm still clueless as to why issuing the INT instruction directly
wedges the DOS box, and why only on certain systems. Probably some
screwup in the way Windows' built-in DOS extender thunks the interrupt
to VMM.
Thanks to all of you who provided useful input.
#include <dpmi.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
void
__dpmi_yield(void)
{
__dpmi_regs r;
r.x.ax = 0x1680;
__dpmi_int(0x2f, &r);
if (r.h.al != 0)
errno = ENOSYS;
}
int main(int argc, char *argv[])
{
while (!kbhit ())
__dpmi_yield ();
printf("Hello!!\nRun some programs, then type \"exit RET\"\n");
system("");
printf("Now I call it\n");
while (!kbhit ())
__dpmi_yield ();
printf("All ok\n");
return 0;
}
- Raw text -