Date: Mon, 8 Jun 1998 19:07:11 +0300 (IDT) From: Eli Zaretskii To: "Salvador Eduardo Tropea (SET)" cc: djgpp-workers AT delorie DOT com Subject: Re: __dpmi_yield considered harmful (sometimes) In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk 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 #include #include #include 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; }