All of lore.kernel.org
 help / color / mirror / Atom feed
* ESCape issue with 1.1.3.2
@ 2002-06-18 21:10 Roger Ripley
  2002-06-18 23:40 ` Bart Oldeman
  0 siblings, 1 reply; 9+ messages in thread
From: Roger Ripley @ 2002-06-18 21:10 UTC (permalink / raw)
  To: linux-msdos

Hi,

I'm using Dosemu 1.1.3.2 with MS-DOS 6.22, and under the
slang terminal mode, I now have to press ESC twice, in very
rapid succession, in order for the keypress to be
registered.  This was not an issue with 1.1.3.1 or 1.0.2.
I have the problem whether TERM=linux or TERM=vt220.  The
easiest way to reduplicate the issue is to press ESC at the
command.com prompt and see if the "\" and newline show up.

This is the log excerpt for the single ESC press:

KBD: do_slang_getkeys()
KBD: cc found 1 characters (Xlate)
KBD: do_slang_getkeys() found 1 bytes
KBD: cc found -1 characters (Xlate)
KBD: got ESC character
KBD: slang got single ESC

And for the double quick ESC presses:

KBD: do_slang_getkeys()
KBD: cc found 1 characters (Xlate)
KBD: do_slang_getkeys() found 1 bytes
KBD: cc found -1 characters (Xlate)
KBD: got ESC character
KBD: do_slang_getkeys()
KBD: cc found 1 characters (Xlate)
KBD: do_slang_getkeys() found 2 bytes
KBD: scan=0000001b Shift_Flags=00000000 str[0]=3 str='^[^['
len=2
KBD: slang_send_scancode(ls_flags=0000001b, lscan=0000001b)
put_symbol: modifiers=0000 keysym=001b
put_keynum_r: old_make:0 make:1 key:01
translate_key: make=1, key=0001, input
KBD: translate(shiftstate=0000, key=0001, input)
KBD: translate(shiftstate=0000, key=0001, input)
KBD: translated key = 001b
KBD: writing to queue: scan=00000001
KBD: resize queue 0->255 head=0 tail=0 level=0
KBD: queuelevel=1
KBD: read queue: raw=01
KBD: queuelevel=0
8042: scheduling IRQ1
put_symbol: modifiers=0000 keysym=001b
put_keynum_r: old_make:1 make:0 key:01
translate_key: make=0, key=0001, input
KBD: translate(shiftstate=0000, key=0001, input)
KBD: translate(shiftstate=0000, key=0001, input)
KBD: translated key = 001b
KBD: writing to queue: scan=00000081
KBD: queuelevel=1
KBD: port60 still has data
KBD: port60 still has data
KBD: port60 still has data
KBD: port60 still has data
KBD: port60 still has data
KBD: port60 still has data
KBD: port60 still has data
8042: do_irq1(), VIF = 1
8042: read port 0x60 read=0x01
KBD: int9 running
INT15 0x4f CARRY=1 AX=8601
KBD: int9 running
KBD: compute_keynum(1, 0, dos) called
translate_key: make=1, key=0001, dos
KBD: translate(shiftstate=0000, key=0001, dos)
KBD: translate(shiftstate=0000, key=0001, dos)
KBD: translated key = 001b
HELPER: get_bios_key() returned 011b
KBD: int9 running
KBD: int9 running
KBD: read queue: raw=81
KBD: queuelevel=0
8042: scheduling IRQ1
8042: do_irq1(), VIF = 1
8042: read port 0x60 read=0x81
INT15 0x4f CARRY=1 AX=8681 
KBD: compute_keynum(81, 0, dos) called
translate_key: make=0, key=0001, dos
KBD: translate(shiftstate=0000, key=0001, dos)
KBD: translate(shiftstate=0000, key=0001, dos)
KBD: translated key = 001b
HELPER: get_bios_key() returned 0000

Thanks for looking into this...

-- Roger


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ESCape issue with 1.1.3.2
  2002-06-18 21:10 Roger Ripley
@ 2002-06-18 23:40 ` Bart Oldeman
  0 siblings, 0 replies; 9+ messages in thread
From: Bart Oldeman @ 2002-06-18 23:40 UTC (permalink / raw)
  To: Roger Ripley; +Cc: linux-msdos

On Tue, 18 Jun 2002, Roger Ripley wrote:

> I'm using Dosemu 1.1.3.2 with MS-DOS 6.22, and under the
> slang terminal mode, I now have to press ESC twice, in very
> rapid succession, in order for the keypress to be
> registered.  This was not an issue with 1.1.3.1 or 1.0.2.
> I have the problem whether TERM=linux or TERM=vt220.  The
> easiest way to reduplicate the issue is to press ESC at the
> command.com prompt and see if the "\" and newline show up.

Enabling new keyboard code by default brings more testers and it shows
;)

Anyhow, the following cures it for me:

--- dosemu-1.1.3.2/src/plugin/term/keyb_slang.c	Sun May 26 16:57:56 2002
+++ dosemu-1.1.3.3/src/plugin/term/keyb_slang.c	Wed Jun 19 00:43:02 2002
@@ -1281,7 +1281,7 @@
 		keyb_state.kbcount -= keyb_state.Keystr_Len;	/* update count */
 		keyb_state.kbp += keyb_state.Keystr_Len;
 		
-		if (key == NULL) {
+		if (key == NULL && symbol != KEY_ESC) {
 			/* undefined key --- return */
 			DOSemu_Slang_Show_Help = 0;
 			keyb_state.kbcount = 0;


Bart



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ESCape issue with 1.1.3.2
@ 2002-06-19  3:01 Stas Sergeev
  2002-06-19 10:23 ` Bart Oldeman
  0 siblings, 1 reply; 9+ messages in thread
From: Stas Sergeev @ 2002-06-19  3:01 UTC (permalink / raw)
  To: linux-msdos

Hello.

Bart Oldeman wrote:
> Anyhow, the following cures it for me:
> -               if (key == NULL) {
> +               if (key == NULL && symbol != KEY_ESC) {
I think this will cause a null
pointer dereference later in
k_printf() so you have to also
add a check.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ESCape issue with 1.1.3.2
  2002-06-19  3:01 Stas Sergeev
@ 2002-06-19 10:23 ` Bart Oldeman
  2002-06-19 19:35   ` Roger Ripley
  0 siblings, 1 reply; 9+ messages in thread
From: Bart Oldeman @ 2002-06-19 10:23 UTC (permalink / raw)
  To: linux-msdos; +Cc: Roger Ripley

On Wed, 19 Jun 2002, Stas Sergeev wrote:

> Bart Oldeman wrote:
> > Anyhow, the following cures it for me:
> > -               if (key == NULL) {
> > +               if (key == NULL && symbol != KEY_ESC) {
> I think this will cause a null
> pointer dereference later in
> k_printf() so you have to also
> add a check.

You are right; here's a second fix (including the hitimer stuff for
various cases, which in turn includes a fix from you (essentially).

Bart

--- dosemu-1.1.3.2/src/base/async/int.c	Sun Jun 16 01:14:36 2002
+++ dosemu-1.1.3.3/src/base/async/int.c	Wed Jun 19 11:11:02 2002
@@ -79,20 +79,19 @@
 int redir_state = 0;
 
 void kill_time(long usecs) {
-   hitimer_t t_start;
-   long t_dif;
+   hitimer_t t_start, t_dif;
    scr_tv.tv_sec = 0L;
    scr_tv.tv_usec = usecs;
 
    t_start = GETusTIME(0);
    while ((int) select(STDIN_FILENO, NULL, NULL, NULL, &scr_tv) < (int) 1)
      {
-	t_dif = (long)(GETusTIME(0)-t_start);
+	t_dif = GETusTIME(0)-t_start;
 
         if ((t_dif >= usecs) || (errno != EINTR))
           return ;
         scr_tv.tv_sec = 0L;
-        scr_tv.tv_usec = usecs - t_dif;
+        scr_tv.tv_usec = usecs - (long)t_dif;
      }
 }
 
--- dosemu-1.1.3.2/src/env/video/miscemu.c	Sun May 26 16:57:56 2002
+++ dosemu-1.1.3.3/src/env/video/miscemu.c	Wed Jun 19 11:15:54 2002
@@ -287,8 +287,7 @@
      such accuracy is probably not important... I hope. (--adm) */
   static int vvfreq = 17000;	/* 70 Hz - but the best we'll get with
   				 * current PIC will be 50 Hz */
-  hitimer_t t;
-  long tdiff;
+  hitimer_t t, tdiff;
   unsigned char retval;
 
 #ifdef X_SUPPORT
--- dosemu-1.1.3.2/src/plugin/keyboard/keyb_slang.c	Sun Jun 16 00:53:08 2002
+++ dosemu-1.1.3.3/src/plugin/keyboard/keyb_slang.c	Wed Jun 19 11:12:21 2002
@@ -863,9 +863,8 @@
 static int sltermio_input_pending(void)
 {
   struct timeval scr_tv;
-  hitimer_t t_start;
+  hitimer_t t_start, t_dif;
   fd_set fds;
-  long t_dif;
 
 #if 0
 #define	THE_TIMEOUT 750000L
@@ -880,13 +879,13 @@
   t_start = GETusTIME(0);
   errno = 0;
   while ((int)select(kbd_fd + 1, &fds, NULL, NULL, &scr_tv) < (int)1) {
-    t_dif = (long)(GETusTIME(0) - t_start);
+    t_dif = GETusTIME(0) - t_start;
 
     if ((t_dif >= THE_TIMEOUT) || (errno != EINTR))
       return 0;
     errno = 0;
     scr_tv.tv_sec = 0L;
-    scr_tv.tv_usec = THE_TIMEOUT - t_dif;
+    scr_tv.tv_usec = THE_TIMEOUT - (long)t_dif;
   }
   return 1;
 }
--- dosemu-1.1.3.2/src/plugin/term/keyb_slang.c	Sun May 26 16:57:56 2002
+++ dosemu-1.1.3.3/src/plugin/term/keyb_slang.c	Wed Jun 19 11:05:30 2002
@@ -873,9 +873,8 @@
 static int sltermio_input_pending(void)
 {
 	struct timeval scr_tv;
-	hitimer_t t_start;
+	hitimer_t t_start, t_dif;
 	fd_set fds;
-	long t_dif;
 	
 #if 0
 #define	THE_TIMEOUT 750000L
@@ -890,13 +889,13 @@
 	t_start = GETusTIME(0);
 	errno = 0;
 	while ((int)select(keyb_state.kbd_fd + 1, &fds, NULL, NULL, &scr_tv) < (int)1) {
-		t_dif = (long)(GETusTIME(0) - t_start);
+		t_dif = GETusTIME(0) - t_start;
 		
 		if ((t_dif >= THE_TIMEOUT) || (errno != EINTR))
 			return 0;
 		errno = 0;
 		scr_tv.tv_sec = 0L;
-		scr_tv.tv_usec = THE_TIMEOUT - t_dif;
+		scr_tv.tv_usec = THE_TIMEOUT - (long)t_dif;
 	}
 	return 1;
 }
@@ -1281,7 +1280,7 @@
 		keyb_state.kbcount -= keyb_state.Keystr_Len;	/* update count */
 		keyb_state.kbp += keyb_state.Keystr_Len;
 		
-		if (key == NULL) {
+		if (key == NULL && symbol != KEY_ESC) {
 			/* undefined key --- return */
 			DOSemu_Slang_Show_Help = 0;
 			keyb_state.kbcount = 0;
@@ -1295,8 +1294,8 @@
 		
 		
 		k_printf("KBD: scan=%08lx Shift_Flags=%08lx str[0]=%d str='%s' len=%d\n",
-			scan,keyb_state.Shift_Flags,key->str[0],strprintable(key->str+1),
-			keyb_state.Keystr_Len);
+			scan,keyb_state.Shift_Flags,key ? key->str[0] : 27,
+                       key ? strprintable(key->str+1): "ESC", keyb_state.Keystr_Len);
 		if (!(scan&0x80000000)) {
 			slang_send_scancode(keyb_state.Shift_Flags | scan, symbol);
 		}


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ESCape issue with 1.1.3.2
@ 2002-06-19 12:45 Stas Sergeev
  2002-06-19 21:50 ` Bart Oldeman
  0 siblings, 1 reply; 9+ messages in thread
From: Stas Sergeev @ 2002-06-19 12:45 UTC (permalink / raw)
  To: linux-msdos

Hello.

Bart Oldeman wrote:
>> I think this will cause a null
>> pointer dereference later in
> You are right;
I think that the real problem with
this is that as soon as the low mem
is mapped, we are no longer receive
a SIGSEGV on a null dereference, so
such dereferences may be unnumbered
all around the code...

> here's a second fix (including the hitimer stuff for
> various cases, which in turn includes a fix from you
Actually when I have found that
overflow in miscemu.c (which later
turned out to be a miscompilation of
gcc-2.96-RH) I searched and looked
into the keyboard case and even those
lock-up reports came to my mind, but
I considered that code to be safe
(the t_dif might not exceed the
src_tv.tv_usec value).
Even now I don't see how it can
overflow, but well, maybe I am overlooking
some corner cases, let's see if it fixes
the problem...


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ESCape issue with 1.1.3.2
  2002-06-19 10:23 ` Bart Oldeman
@ 2002-06-19 19:35   ` Roger Ripley
  2002-06-19 21:02     ` Bart Oldeman
  0 siblings, 1 reply; 9+ messages in thread
From: Roger Ripley @ 2002-06-19 19:35 UTC (permalink / raw)
  To: linux-msdos; +Cc: Bart Oldeman

The patch fixes both the ESC problem and the 30 minute
problem, as far as I can tell so far.  I haven't
encountered any issues created by it either.

Great job; thanks a lot!

-- Roger

--On Wednesday, June 19, 2002 11:23 AM +0100 Bart Oldeman
<Bart.Oldeman@bristol.ac.uk> wrote:

> On Wed, 19 Jun 2002, Stas Sergeev wrote:
> 
>> Bart Oldeman wrote:
>> > Anyhow, the following cures it for me:
>> > -               if (key == NULL) {
>> > +               if (key == NULL && symbol != KEY_ESC) {
>> I think this will cause a null
>> pointer dereference later in
>> k_printf() so you have to also
>> add a check.
> 
> You are right; here's a second fix (including the hitimer
> stuff for various cases, which in turn includes a fix
> from you (essentially).
> 
> Bart
> 
> --- dosemu-1.1.3.2/src/base/async/int.c	Sun Jun 16
> 01:14:36 2002 +++ dosemu-1.1.3.3/src/base/async/int.c	Wed
> Jun 19 11:11:02 2002 @@ -79,20 +79,19 @@
>  int redir_state = 0;
>  
>  void kill_time(long usecs) {
> -   hitimer_t t_start;
> -   long t_dif;
> +   hitimer_t t_start, t_dif;
>     scr_tv.tv_sec = 0L;
>     scr_tv.tv_usec = usecs;
>  
>     t_start = GETusTIME(0);
>     while ((int) select(STDIN_FILENO, NULL, NULL, NULL,
> &scr_tv) < (int) 1)       {
> -	t_dif = (long)(GETusTIME(0)-t_start);
> +	t_dif = GETusTIME(0)-t_start;
>  
>          if ((t_dif >= usecs) || (errno != EINTR))
>            return ;
>          scr_tv.tv_sec = 0L;
> -        scr_tv.tv_usec = usecs - t_dif;
> +        scr_tv.tv_usec = usecs - (long)t_dif;
>       }
>  }
>  
> --- dosemu-1.1.3.2/src/env/video/miscemu.c	Sun May 26
> 16:57:56 2002 +++ dosemu-1.1.3.3/src/env/video/miscemu.c
> 	Wed Jun 19 11:15:54 2002 @@ -287,8 +287,7 @@
>       such accuracy is probably not important... I hope.
> (--adm) */    static int vvfreq = 17000;	/* 70 Hz - but
> the best we'll get with    				 * current PIC will be 50
> Hz */
> -  hitimer_t t;
> -  long tdiff;
> +  hitimer_t t, tdiff;
>    unsigned char retval;
>  
>  #ifdef X_SUPPORT
> --- dosemu-1.1.3.2/src/plugin/keyboard/keyb_slang.c	Sun
> Jun 16 00:53:08 2002 +++
> dosemu-1.1.3.3/src/plugin/keyboard/keyb_slang.c	Wed Jun
> 19 11:12:21 2002 @@ -863,9 +863,8 @@
>  static int sltermio_input_pending(void)
>  {
>    struct timeval scr_tv;
> -  hitimer_t t_start;
> +  hitimer_t t_start, t_dif;
>    fd_set fds;
> -  long t_dif;
>  
>  #if 0
>  #define	THE_TIMEOUT 750000L
> @@ -880,13 +879,13 @@
>    t_start = GETusTIME(0);
>    errno = 0;
>    while ((int)select(kbd_fd + 1, &fds, NULL, NULL,
> &scr_tv) < (int)1) { -    t_dif = (long)(GETusTIME(0) -
> t_start);
> +    t_dif = GETusTIME(0) - t_start;
>  
>      if ((t_dif >= THE_TIMEOUT) || (errno != EINTR))
>        return 0;
>      errno = 0;
>      scr_tv.tv_sec = 0L;
> -    scr_tv.tv_usec = THE_TIMEOUT - t_dif;
> +    scr_tv.tv_usec = THE_TIMEOUT - (long)t_dif;
>    }
>    return 1;
>  }
> --- dosemu-1.1.3.2/src/plugin/term/keyb_slang.c	Sun May
> 26 16:57:56 2002 +++
> dosemu-1.1.3.3/src/plugin/term/keyb_slang.c	Wed Jun 19
> 11:05:30 2002 @@ -873,9 +873,8 @@
>  static int sltermio_input_pending(void)
>  {
>  	struct timeval scr_tv;
> -	hitimer_t t_start;
> +	hitimer_t t_start, t_dif;
>  	fd_set fds;
> -	long t_dif;
>  	
>  #if 0
>  #define	THE_TIMEOUT 750000L
> @@ -890,13 +889,13 @@
>  	t_start = GETusTIME(0);
>  	errno = 0;
>  	while ((int)select(keyb_state.kbd_fd + 1, &fds, NULL,
> NULL, &scr_tv) < (int)1) { -		t_dif = (long)(GETusTIME(0)
> - t_start);
> +		t_dif = GETusTIME(0) - t_start;
>  		
>  		if ((t_dif >= THE_TIMEOUT) || (errno != EINTR))
>  			return 0;
>  		errno = 0;
>  		scr_tv.tv_sec = 0L;
> -		scr_tv.tv_usec = THE_TIMEOUT - t_dif;
> +		scr_tv.tv_usec = THE_TIMEOUT - (long)t_dif;
>  	}
>  	return 1;
>  }
> @@ -1281,7 +1280,7 @@
>  		keyb_state.kbcount -= keyb_state.Keystr_Len;	/* update
> count */  		keyb_state.kbp += keyb_state.Keystr_Len;
>  		
> -		if (key == NULL) {
> +		if (key == NULL && symbol != KEY_ESC) {
>  			/* undefined key --- return */
>  			DOSemu_Slang_Show_Help = 0;
>  			keyb_state.kbcount = 0;
> @@ -1295,8 +1294,8 @@
>  		
>  		
>  		k_printf("KBD: scan=%08lx Shift_Flags=%08lx str[0]=%d
> str='%s' len=%d\n", -
> 	scan,keyb_state.Shift_Flags,key->str[0],strprintable(key
> ->str+1), -			keyb_state.Keystr_Len);
> +			scan,keyb_state.Shift_Flags,key ? key->str[0] : 27,
> +                       key ? strprintable(key->str+1):
> "ESC", keyb_state.Keystr_Len);  		if (!(scan&0x80000000))
> {
>  			slang_send_scancode(keyb_state.Shift_Flags | scan,
> symbol);  		}
> 
> -
> To unsubscribe from this list: send the line "unsubscribe
> linux-msdos" in the body of a message to
> majordomo@vger.kernel.org More majordomo info at
> http://vger.kernel.org/majordomo-info.html



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ESCape issue with 1.1.3.2
  2002-06-19 19:35   ` Roger Ripley
@ 2002-06-19 21:02     ` Bart Oldeman
  2002-06-20 22:52       ` Roger Ripley
  0 siblings, 1 reply; 9+ messages in thread
From: Bart Oldeman @ 2002-06-19 21:02 UTC (permalink / raw)
  To: Roger Ripley; +Cc: linux-msdos

On Wed, 19 Jun 2002, Roger Ripley wrote:

> The patch fixes both the ESC problem and the 30 minute
> problem, as far as I can tell so far.  I haven't
> encountered any issues created by it either.

Ok great; but I'm still wondering what really fixed the 30 mins bug here.

Can you "patch -R" the patch I sent before and only use this?

See if that alone fixes the bug; for the other cases I cannot imagine,
studying the select(2) behaviour (agreed with Stas).

you will find "patch" saying something about offsets but that's just
because I stripped lines in the patch directly; but it should patch.

My theory in this is now that programs like MSDOS EDIT check for CGA
"SNOW" and if you don't press a key then you _also_ do not get an updated
screen, so your program does not check for "snow" so the remembered
miscemu.c static time variable does not change. Now your DOSEMU calculates
negative values and your DOS program waits forever until the virtual
"snow" disappears.

Bart

--- dosemu-1.1.3.2/src/env/video/miscemu.c	Sun May 26 16:57:56 2002
+++ dosemu-1.1.3.3/src/env/video/miscemu.c	Wed Jun 19 11:15:54 2002
@@ -287,8 +287,7 @@
      such accuracy is probably not important... I hope. (--adm) */
   static int vvfreq = 17000;	/* 70 Hz - but the best we'll get with
   				 * current PIC will be 50 Hz */
-  hitimer_t t;
-  long tdiff;
+  hitimer_t t, tdiff;
   unsigned char retval;

 
 #ifdef X_SUPPORT
--- dosemu-1.1.3.2/src/plugin/term/keyb_slang.c	Sun May 26 16:57:56 2002
+++ dosemu-1.1.3.3/src/plugin/term/keyb_slang.c	Wed Jun 19 11:05:30 2002
@@ -1281,7 +1280,7 @@
 		keyb_state.kbcount -= keyb_state.Keystr_Len;	/* update count */
 		keyb_state.kbp += keyb_state.Keystr_Len;
 		
-		if (key == NULL) {
+		if (key == NULL && symbol != KEY_ESC) {
 			/* undefined key --- return */
 			DOSemu_Slang_Show_Help = 0;
 			keyb_state.kbcount = 0;
@@ -1295,8 +1294,8 @@
 		
 		
 		k_printf("KBD: scan=%08lx Shift_Flags=%08lx str[0]=%d str='%s' len=%d\n",
-			scan,keyb_state.Shift_Flags,key->str[0],strprintable(key->str+1),
-			keyb_state.Keystr_Len);
+			scan,keyb_state.Shift_Flags,key ? key->str[0] : 27,
+                        key ? strprintable(key->str+1): "ESC", keyb_state.Keystr_Len);
 		if (!(scan&0x80000000)) {
 			slang_send_scancode(keyb_state.Shift_Flags | scan, symbol);
 		}


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ESCape issue with 1.1.3.2
  2002-06-19 12:45 ESCape issue with 1.1.3.2 Stas Sergeev
@ 2002-06-19 21:50 ` Bart Oldeman
  0 siblings, 0 replies; 9+ messages in thread
From: Bart Oldeman @ 2002-06-19 21:50 UTC (permalink / raw)
  To: linux-msdos

On Wed, 19 Jun 2002, Stas Sergeev wrote:

> I think that the real problem with
> this is that as soon as the low mem
> is mapped, we are no longer receive
> a SIGSEGV on a null dereference, so
> such dereferences may be unnumbered
> all around the code...

yes, could well be. I can think of two possibilities to get trap anyway.

a) r/w protect the first page (first 4K) while DOSEMU is active (not in
vm86/DPMI). Then it needs to protect/unprotect around updates of the BIOS
data area (at 0040:0000-00ff). That's bad for performance (though that is
less of an issue for debugging). Fortunately this should not be that hard
to program becuase most of the BIOS data area r/w's are done using macros,
so you only need to change those.

b) set a hardware watchpoint for address 0. That can be done using
"awatch (*0)" in gdb. But gdb does not play well with DOSEMU in this
respect. Somewhere the debug registers must get trashed.

Bart


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ESCape issue with 1.1.3.2
  2002-06-19 21:02     ` Bart Oldeman
@ 2002-06-20 22:52       ` Roger Ripley
  0 siblings, 0 replies; 9+ messages in thread
From: Roger Ripley @ 2002-06-20 22:52 UTC (permalink / raw)
  To: Bart Oldeman; +Cc: linux-msdos

That patch seems to work too.  Thanks again!

-- Roger

--On Wednesday, June 19, 2002 10:02 PM +0100 Bart Oldeman
<Bart.Oldeman@bristol.ac.uk> wrote:

> On Wed, 19 Jun 2002, Roger Ripley wrote:
> 
>> The patch fixes both the ESC problem and the 30 minute
>> problem, as far as I can tell so far.  I haven't
>> encountered any issues created by it either.
> 
> Ok great; but I'm still wondering what really fixed the
> 30 mins bug here.
> 
> Can you "patch -R" the patch I sent before and only use
> this?
> 
> See if that alone fixes the bug; for the other cases I
> cannot imagine, studying the select(2) behaviour (agreed
> with Stas).
> 
> you will find "patch" saying something about offsets but
> that's just because I stripped lines in the patch
> directly; but it should patch.
> 
> My theory in this is now that programs like MSDOS EDIT
> check for CGA "SNOW" and if you don't press a key then
> you _also_ do not get an updated screen, so your program
> does not check for "snow" so the remembered miscemu.c
> static time variable does not change. Now your DOSEMU
> calculates negative values and your DOS program waits
> forever until the virtual "snow" disappears.
> 
> Bart
> 
> --- dosemu-1.1.3.2/src/env/video/miscemu.c	Sun May 26
> 16:57:56 2002 +++ dosemu-1.1.3.3/src/env/video/miscemu.c
> 	Wed Jun 19 11:15:54 2002 @@ -287,8 +287,7 @@
>       such accuracy is probably not important... I hope.
> (--adm) */    static int vvfreq = 17000;	/* 70 Hz - but
> the best we'll get with    				 * current PIC will be 50
> Hz */
> -  hitimer_t t;
> -  long tdiff;
> +  hitimer_t t, tdiff;
>    unsigned char retval;
> 
>  
>  #ifdef X_SUPPORT
> --- dosemu-1.1.3.2/src/plugin/term/keyb_slang.c	Sun May
> 26 16:57:56 2002 +++
> dosemu-1.1.3.3/src/plugin/term/keyb_slang.c	Wed Jun 19
> 11:05:30 2002 @@ -1281,7 +1280,7 @@
>  		keyb_state.kbcount -= keyb_state.Keystr_Len;	/* update
> count */  		keyb_state.kbp += keyb_state.Keystr_Len;
>  		
> -		if (key == NULL) {
> +		if (key == NULL && symbol != KEY_ESC) {
>  			/* undefined key --- return */
>  			DOSemu_Slang_Show_Help = 0;
>  			keyb_state.kbcount = 0;
> @@ -1295,8 +1294,8 @@
>  		
>  		
>  		k_printf("KBD: scan=%08lx Shift_Flags=%08lx str[0]=%d
> str='%s' len=%d\n", -
> 	scan,keyb_state.Shift_Flags,key->str[0],strprintable(key
> ->str+1), -			keyb_state.Keystr_Len);
> +			scan,keyb_state.Shift_Flags,key ? key->str[0] : 27,
> +                        key ? strprintable(key->str+1):
> "ESC", keyb_state.Keystr_Len);  		if (!(scan&0x80000000))
> {
>  			slang_send_scancode(keyb_state.Shift_Flags | scan,
> symbol);  		}
> 



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2002-06-20 22:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-19 12:45 ESCape issue with 1.1.3.2 Stas Sergeev
2002-06-19 21:50 ` Bart Oldeman
  -- strict thread matches above, loose matches on Subject: below --
2002-06-19  3:01 Stas Sergeev
2002-06-19 10:23 ` Bart Oldeman
2002-06-19 19:35   ` Roger Ripley
2002-06-19 21:02     ` Bart Oldeman
2002-06-20 22:52       ` Roger Ripley
2002-06-18 21:10 Roger Ripley
2002-06-18 23:40 ` Bart Oldeman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.