From: ANTHONY APPLEYARD To: djgpp AT sun DOT soe DOT clarkson DOT edu Date: Wed, 19 Oct 1994 12:07:45 GMT Subject: Bug in GO32's interrupt handler; a Windows funny Cc: bug-gcc AT prep DOT ai DOT mit DOT edu, djgpp-announce AT sun DOT soe DOT clarkson DOT edu (0) I have go32 1.12, binutils 2.4, bison 1.22, diffutils 2.6, gas 2.3, gcc 2.6.0, gdb 4.12, gzip 1.2.4, libg++-2.6.0, and its first two `maint' updates, which I ftp'ed from oak.oakland.edu (1) With this version, if I call Windows, then come out of Windows, then call the Gnu C compiler, it fails "Cannot exec go32", and I must re-boot, thus also losing and having to re-login my Novell net connection etc. This is a nuisance. It didn't happen with the version I used before, which was "DJGPP version 1.08, GCC version 2.2.2 for DOS". (2) I have found a fault in an interrupt handler in C:\DJGPP\GO32\EXPHDLR.C In function i_10(void), in the section that handles the two interrupts that let the user define his own text characters:- tss2reg(&r); i = (word16)tss_ptr->tss_eax; /* int10 function 0x11 subfunctions 0 & 0x10 */ if(i==0x1100 || i==0x1110) { /* user-defined text characters */ v = tss_ptr->tss_edx + ARENA; /* bh*cx bytes starting at (ds:dx) */ CHECK_SEGFAULT(v); j = ((tss_ptr->tss_ebx >> 8) & 0xff) * ((word16)tss_ptr->tss_ecx); memget(v, transfer_buffer, j); r.r_dx = FP_OFF(transfer_buffer); r.r_ds = _DS; intr(0x10, &r); reg2tss(&r); tss_ptr->tss_ebp = r.r_es * 16L + r.r_bp + 0xe0000000L; return 0; } I suspect that this should be as follows, or something similar:- tss2reg(&r); i = (word16)tss_ptr->tss_eax; /* int10 function 0x11 subfunctions 0 & 0x10 */ if(i==0x1100 || i==0x1110) { /* user-defined text characters */ v = tss_ptr->tss_bp + ARENA; /* bh*cx bytes starting at (es:bp) *//*****/ CHECK_SEGFAULT(v); j = ((tss_ptr->tss_ebx >> 8) & 0xff) * ((word16)tss_ptr->tss_ecx); memget(v, transfer_buffer, j); r.r_bp = FP_OFF(transfer_buffer); /*****/ r.r_es = _ES; /*****/ intr(0x10, &r); reg2tss(&r); tss_ptr->tss_ebp = r.r_es * 16L + r.r_bp + 0xe0000000L; return 0; } as a reference to a PC system programming manual will show that the new characters are read from bh*cx bytes starting at (es:bp). dx is merely the ascii value of the first character to be redefined. I got this fault (reformatted and my comments added) when I tried to use it to redefine the `superscript underlined `a' and `o'' characters (166 and 167) as superscript `3' and superscript `6':- Segmentation violation in pointer 0x000000a6 at d8:1d3 eax=00001110 /* interrupt 10, function 0x11, subfunction 0x10 */ ebx=00001000 /* 0x10 lines per character, character table 0 */ ecx=00000001 /* 1 character in my table */ edx=000000a6 /* use my char as replacement for char 0xa6 (raised underlined a) esi=00000000 edi=00000000 ebp=00001018 /* pointer to byte pattern of my raised-3 (cubed) character */ esp=7ffffdfc cs=d8 ds=48 es=48 fs=48 gs=38 ss=48 cr2=00003000 Call frame traceback EIPs: 0x000001d3 0x3018d870 but go32 used the `0xa6' in dx as the byte pattern address instead.