Date: Thu, 17 Dec 1998 09:33:45 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: djgpp-workers AT delorie DOT com, Charles Sandmann cc: Toshio KUDO Subject: Re: patches to 2.02 In-Reply-To: <199812162225.RAA03726@envy.delorie.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from QUOTED-PRINTABLE to 8bit by delorie.com id CAA24959 Reply-To: djgpp-workers AT delorie DOT com On Wed, 16 Dec 1998, DJ Delorie wrote: > So, when V2 COFF terminates, or executes real-mode command as a > child process, next, use FPU instruction in real-mode (ie detect x87), > then it hangs up, reboot, or something wrong occures. Seems like a good idea to fix this. > + #if 1 /* patched by adamtk AT altavista DOT net 98.12.16 */ > + /* CWSDPMI don't support DPMI-0E00 (and do not touch CR0), > + * So, set DPMIfpustate to 1 for make sure EM bit off. > + */ > + if ((lastfpustate = __dpmi_get_coprocessor_status ()) < 0) > + lastfpustate = 1; > + #endif /* end of patch by adamtk 98.12.16 */ What are the implications of this on other DPMI hosts? Aren't we introducing here something that relies on CWSDPMI features? Charles, can you comment on that? > EDEBUG32 works on PC/AT or compatible, but not works on Japanese > PC98. So, I make a patch for PC98. Could we please hear some more details about each individual change in edebug? I really don't understand the reasons for some of them (see below). > + #if 1 /* patched by adamtk AT altavista DOT net 98.12.14 */ > + static char char32spc[] = "xxx.xxx.xxx.xxx-xxx.xxx.xxx.xxx "; > + #else /* not patched by adamtk 98.12.14 */ > static char char32spc[] = "xxxúxxxúxxxúxxxùxxxúxxxúxxxúxxx "; > + #endif /* end of patch by adamtk 98.12.14 */ Why is this needed? > + #if 1 /* patched by adamtk AT altavista DOT net 98.12.14 */ > + ch = getkbd(); > + #else /* not patched by adamtk 98.12.14 */ > ch = getkey(); > + #endif /* end of patch by adamtk 98.12.14 */ As far as I could see, `getkbd' calls function 07h of Interrupt 21h. However, `getkey' goes through the BIOS, whereas 2107 goes through DOS, and the codes they return for special non-ASCII keys are different. I don't use edebug32, so I don't know whether this is of any practical significance (if edebug32 only reads ASCII keys, it is not important, in which case we could use the DOS function unconditionally). An additional problem with 2107 is that it reads from stdin, and so could mess up the input to the debuggee. But I must admit that I don't understand why the BIOS function is not good for PC98. AFAIK, BIOS keyboard support is not different there. For example, Emacs uses the BIOS keyboard functions called by `getkey', and I *know* Emacs works on Japanese DOS/V systems. > + #if 1 /* patched by adamtk AT altavista DOT net 98.12.14 */ > + { > + putchar('\n'); > + break; > + } > + #else /* not patched by adamtk 98.12.14 */ What is this (and several similar patches) for? > + #if 1 /* patched by adamtk AT altavista DOT net 98.12.14 */ > + vaddr++; > + #endif /* end of patch by adamtk 98.12.14 */ And this? > + #if 1 /* patched by adamtk AT altavista DOT net 98.12.14 */ > + if ((c&=0xFF)<' ') > + putchar('.'); > + else > + putchar(c); > + #else /* not patched by adamtk 98.12.14 */ And what does this do? > + #if 1 /* patched by adamtk AT altavista DOT net 98.12.14 */ > + printf(" \n"); /* for DBCS */ > + #else /* not patched by adamtk 98.12.14 */ > printf("\n"); > + #endif /* end of patch by adamtk 98.12.14 */ Why does DBCS require a blank before the newline? > + #if 1 /* patched by adamtk AT altavista DOT net 98.12.14 */ > + printf("%s ", buf2); > + #endif /* end of patch by adamtk 98.12.14 */ Why is this needed? > + #if 1 /* patched by adamtk AT altavista DOT net 98.12.14 */ > + printf("%04x ", *(word16 *)((word8 *)tss_ptr + regs[i].ofs)); > + #else /* not patched by adamtk 98.12.14 */ > printf("%04x ", *(word16 *)((word16 *)tss_ptr + regs[i].ofs)); > + #endif /* end of patch by adamtk 98.12.14 */ What was wrong with the original code here? > + #if 1 /* patched by adamtk AT altavista DOT net 98.12.14 */ > + if (len > 1) > + #else /* not patched by adamtk 98.12.14 */ > if (len < 2) > + #endif /* end of patch by adamtk 98.12.14 */ What is the reason for this change? > + if (ScreenPrimary == 0xa0000) /* Japanese PC98? */ Is this a reliable test for PC98? conio.c from v2.02 uses what I think is a better way: it calls function FEh of interrupt 10h. > + #if 1 /* patched by adamtk AT altavista DOT net 98.12.14 */ > + x stdout->_file = open(ctermid(NULL), (O_RDWR | O_TEXT), 0666); > + stdin->_file = dup(stdout->_file); > + #else /* not patched by adamtk 98.12.14 */ > x stdout->_file = dup(fileno(stdout)); > + #endif /* end of patch by adamtk 98.12.14 */ What does this do, and why? (And, btw, what are those `x' characters at the beginning of the line?) > + #if 1 /* patched by adamtk AT altavista DOT net 98.12.14 */ > + "%g2 %Eb,%Ibb", "%g2 %Ev,%Ibb", "ret %Iww", "ret", > + #else /* not patched by adamtk 98.12.14 */ > "%g2 %Eb,%Ibb", "%g2 %Ev,%Ibb", "ret %Iw", "ret", > + #endif /* end of patch by adamtk 98.12.14 */ What about this one? > + #if 1 /* patched by adamtk AT altavista DOT net 98.12.14 */ > + buf1[i] = (buf1[i-1] & 0x80) ? 0xff : 0; > + #else /* not patched by adamtk 98.12.14 */ > buf1[i] = (buf[i-1] & 0x80) ? 0xff : 0; > + #endif /* end of patch by adamtk 98.12.14 */ And what was wrong here? > + #if 1 /* patched by adamtk AT altavista DOT net 98.12.14 */ > + if (delta) > + uprintf("+%lu (0x%lx %c)", delta, vofs+vaddr, > + (vofs & 0x80000000UL) ? '^' : 'v'); > + #else /* not patched by adamtk 98.12.14 */ > if (delta) > uprintf("+%lu (0x%lx %c)", delta, vofs+vaddr, > (vofs & 0x80000000UL) ? 0x1e : 0x1f); > + #endif /* end of patch by adamtk 98.12.14 */ Doesn't PC98 support graphics characters with ASCII codes below 32 decimal?