delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/12/17/02:36:10

Date: Thu, 17 Dec 1998 09:33:45 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: djgpp-workers AT delorie DOT com, Charles Sandmann <sandmann AT clio DOT rice DOT edu>
cc: Toshio KUDO <adamtk AT altavista DOT net>
Subject: Re: patches to 2.02
In-Reply-To: <199812162225.RAA03726@envy.delorie.com>
Message-ID: <Pine.SUN.3.91.981217093147.1462G-100000@is>
MIME-Version: 1.0
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?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019