diff -u --recursive --new-file dosemu-0.60.3/ChangeLog dosemu/ChangeLog
--- dosemu-0.60.3/ChangeLog	Wed Jun 28 13:17:43 1995
+++ dosemu/ChangeLog	Thu Jul 27 15:28:01 1995
@@ -1,3 +1,25 @@
+Thu Jul 28	1995
+
+-	Release DOSEMU-0.60.4.tgz
+-	Hans' patch to dpmi.c
+-	Added CLTS from rde@tadpole.co.uk (Richard Evans)
+-	Added .ini extensions from Jon
+-	From Snow Cat
+2) pic/pic.c has some assembler code that doesn't work with -O3 because it's
+using global labels that get expanded more than once. Fixing it to use local
+labels solves the problem.
+
+3) mfs/mfs.c  doesn't handle "commit file" and  "flush all disk  buffers".  It
+causes AH=68H/int 21H to return an error code that confuses database programs.
+I  changed COMMIT_FILE to do fsync()  and  FLUSH_ALL_BUFFERS to do nothing and
+return success (because sync()ing every time DOS wants  to flush buffers makes
+too much noise).
+.... and some other patches too.
+
+-	Mfs patch from Andi.
+-	Mouse patches from beck@informatik.hu-berlin.de (Michael Beck)
+-	Patches for UID settings by Steven P. Crain
+
 Wed Jun 28	1995
 
 -	Release DOSEMU-0.60.3.tgz
diff -u --recursive --new-file dosemu-0.60.3/Makefile dosemu/Makefile
--- dosemu-0.60.3/Makefile	Wed Jun 28 13:18:06 1995
+++ dosemu/Makefile	Thu Jul 27 16:02:00 1995
@@ -74,6 +74,7 @@
   X11ROOTDIR  = /usr/X11R6
   endif
   X11LIBDIR = $(X11ROOTDIR)/lib
+# X11LIBDIR = /usr/i486-linuxaout/lib
   X11INCDIR = $(X11ROOTDIR)/include
 endif
 endif
@@ -131,7 +132,8 @@
 ifdef ELF
 export CC         = gcc # -elf I use gcc-specific features (var-arg macros, fr'instance)
 else
-export CC         = gcc  # I use gcc-specific features (var-arg macros, fr'instance)
+export CC         = gcc # I use gcc-specific features (var-arg macros, fr'instance)
+# export CC         = gcc -b i486-linuxaout # I use gcc-specific features (var-arg macros, fr'instance)
 endif
 ifdef do_DEBUG
 COPTFLAGS	=  -g -Wall
@@ -145,7 +147,7 @@
 # dosemu version
 VERSION = 0
 SUBLEVEL = 60
-PATCHLEVEL = 3
+PATCHLEVEL = 4
 LIBDOSEMU = libdosemu-$(VERSION).$(SUBLEVEL).$(PATCHLEVEL)
 
 EMUVER = $(VERSION).$(SUBLEVEL)
@@ -250,7 +252,7 @@
 
 
 # -m486 is usually in the specs for the compiler
-OPT=  -O2 -funroll-loops # -fno-inline
+OPT=  -O3 -m486 -fomit-frame-pointer
 # OPT=-fno-inline
 PIPE=-pipe
 export CFLAGS     = $(OPT) $(PIPE) $(USING_NET)
@@ -445,8 +447,8 @@
 		$(TCNTRL) $(XLIBS)
 
 $(LIBDOSEMU): 	emu.o data.o # dossubdirs
-	$(LD) $(LDFLAGS) $(MAGIC) -Ttext $(LIBSTART) -o $(LIBDOSEMU) \
-	   -nostdlib $^ $(addprefix -L,$(LIBPATH)) -L. $(SHLIBS) \
+	$(LD) $(LDFLAGS) $(MAGIC) -Wl,-Ttext -Wl,$(LIBSTART) -o $(LIBDOSEMU) \
+	   -nostartfiles -nostdlib $^ $(addprefix -L,$(LIBPATH)) -L. $(SHLIBS) \
 	    $(addprefix -l, $(LIBS)) bios/bios.o $(XLIBS) $(TCNTRL) -lc 
 
 libdosemu:	dossubdirs $(LIBDOSEMU)
diff -u --recursive --new-file dosemu-0.60.3/doc/DANG_CONFIG dosemu/doc/DANG_CONFIG
--- dosemu-0.60.3/doc/DANG_CONFIG	Sat Apr 29 14:03:50 1995
+++ dosemu/doc/DANG_CONFIG	Wed Jul  5 19:03:18 1995
@@ -24,7 +24,7 @@
 			dosemu/sigsegv.c include/int.h include/ports.h
 			dosemu/dosio.c dosemu/disks.c 
 			dosemu/cpu.c dosemu/lpt.c 
-GROUP:		Serial ../DANG_c/summary/Serial serial/README.serial
+GROUP:		Serial ../DANG_c/summary_Serial serial/README.serial
 			serial/ser_defs.h serial/ser_init.c
 			serial/ser_ports.c serial/ser_irq.c
 GROUP:		Mouse ../DANG_c/summary_Mouse mouse/mouse.c 
diff -u --recursive --new-file dosemu-0.60.3/doc/dosemu.lsm dosemu/doc/dosemu.lsm
--- dosemu-0.60.3/doc/dosemu.lsm	Sat Apr 29 14:03:54 1995
+++ dosemu/doc/dosemu.lsm	Wed Jun 28 13:36:57 1995
@@ -1,7 +1,7 @@
 Begin3
 Title:          DOSEMU PC Emulator
 
-Version:        0.60.1
+Version:        0.60.3
 
 Description:    This is a DOS emulation package with support for console, 
                 terminal and X-windows.  Includes DPMI emulation to run some 
@@ -15,7 +15,7 @@
 
 Maintained-by:  linux-msdos@vger.rutgers.edu (The DOSEMU team)
 
-Primary-site:   tsx-11.mit.edu /pub/linux/ALPHA/dosemu/dosemu-0.60.1.tgz
+Primary-site:   tsx-11.mit.edu /pub/linux/ALPHA/dosemu/dosemu-0.60.3.tgz
 
 Alternate-site: sunsite.unc.edu /pub/Linux/system/Emulators
                 dspsun.eas.asu.edu /pub/dosemu
diff -u --recursive --new-file dosemu-0.60.3/dosemu/dos2linux.c dosemu/dosemu/dos2linux.c
--- dosemu-0.60.3/dosemu/dos2linux.c	Sat May  6 13:25:42 1995
+++ dosemu/dosemu/dos2linux.c	Thu Jul 27 15:19:53 1995
@@ -199,12 +199,12 @@
      */
      
      /* DANG_FIXTHIS Remove the "SIMPLE_FORK" stuff if it is not really necessary */
-     
+     /* DANG_FIXTHIS This "SIMPLE_FORK" stuff is broken anyway, it makes unix commands execute uid=euid=root! */
     uid_t uid, gid;
     
     uid=geteuid();
     gid=geteuid();
-    setuid(getuid());
+    setuid(getuid());  /* Note: this won't help! euid=user, not root.  root is uid! */
     setgid(getgid());
     
     system(buffer);
@@ -213,11 +213,13 @@
     setgid(gid);
 
 #else
+    /* IMPORTANT NOTE: euid=user uid=root (not the other way around!) */
+
     int p[2];
     int q[2];
-    int pid, status, retval;
+    int pid, status, retval, tuid;
     char buf;
-    
+
     /* create a pipe... */
     if(pipe(p)!=0)
     {
@@ -260,8 +262,12 @@
         
         /* DOSEMU runs setuid(root). go back to the real uid/gid for
          * safety reasons.
+         *
+         * NOTE: euid=user uid=root!  -Steven P. Crain
          */
-        setuid(getuid());
+        tuid=geteuid(); /* Save user's uid */
+        setuid(getuid()); /* Switch to root */
+        setuid(tuid);     /* You can't switch back anymore: good thing we're forked! */ 
         setgid(getgid());
         
 #if 0
diff -u --recursive --new-file dosemu-0.60.3/dosemu/int.c dosemu/dosemu/int.c
--- dosemu-0.60.3/dosemu/int.c	Wed Jun 28 11:49:27 1995
+++ dosemu/dosemu/int.c	Sun Jul 16 22:14:43 1995
@@ -290,7 +290,7 @@
     break;
 #endif
     case 0x80:
-        LWORD(eax) = getcwd(SEG_ADR((char *), es, dx), (u_short)LWORD(eax));
+        LWORD(eax) = (u_short) getcwd(SEG_ADR((char *), es, dx), (u_short)LWORD(eax));
         break;
   case 0x81:
         LWORD(eax) = chdir(SEG_ADR((char *), es, dx));
@@ -694,6 +694,10 @@
       ext_fix(config.emusys);
       sprintf(ptr, "\\CONFIG.%-3s", config.emusys);
       d_printf("DISK: Substituted %s for CONFIG.SYS\n", ptr);
+ } else if (config.emuini && !strncmp(ptr+2, "\\WINDOWS\\SYSTEM.INI", 19)) {
+ ext_fix(config.emuini);
+      sprintf(ptr+2, "\\WINDOWS\\SYSTEM.%s", config.emuini);
+      d_printf("DISK: Substituted %s for system.ini\n", ptr);
 #ifndef INTERNAL_EMS
     }
 #else
@@ -1017,7 +1021,8 @@
     return;
   }
 
-  default_interrupt(i);
+  if IS_REDIRECTED(i)
+    default_interrupt(i);
 }
 
 /* mouse */
@@ -1141,7 +1146,10 @@
   saytime("do_int");
 #endif
 #if 0 /* 94/07/02 Just for reference */
+if (i== 0x2f) {
+  show_regs(__FILE__, __LINE__);
   k_printf("Do INT0x%02x, eax=0x%04x, ebx=0x%04x ss=0x%04x esp=0x%04x cs=0x%04x ip=0x%04x CF=%d \n", i, LWORD(eax), LWORD(ebx), LWORD(ss), LWORD(esp), LWORD(cs), LWORD(eip), (int)REG(eflags) & CF);
+}
 #endif
 
   if ((LWORD(cs)) != BIOSSEG && IS_REDIRECTED(i) && can_revector(i)){
diff -u --recursive --new-file dosemu-0.60.3/dosemu/sigsegv.c dosemu/dosemu/sigsegv.c
--- dosemu-0.60.3/dosemu/sigsegv.c	Sun Jun 25 20:05:10 1995
+++ dosemu/dosemu/sigsegv.c	Mon Jul  3 16:14:22 1995
@@ -1,4 +1,4 @@
-/* 
+/*
  * $Date: 1995/04/08 22:30:40 $
  * $Source: /usr/src/dosemu0.60/dosemu/RCS/sigsegv.c,v $
  * $Revision: 2.20 $
@@ -893,6 +893,15 @@
       LWORD(eip) += 1;
     }
     break;
+
+  case 0x0f: /* RDE hack */
+    if (csp[1] == 0x06)
+      /*
+	 CLTS - ignore
+      */
+      { LWORD(eip)+=2;
+	break;
+      }
 
   case 0xf0:			/* lock */
   default:
diff -u --recursive --new-file dosemu-0.60.3/dpmi/dpmi.c dosemu/dpmi/dpmi.c
--- dosemu-0.60.3/dpmi/dpmi.c	Mon Jun 26 18:15:37 1995
+++ dosemu/dpmi/dpmi.c	Mon Jul  3 17:45:45 1995
@@ -135,10 +135,15 @@
 #endif
 
 #include "kversion.h"
-#include <asm/segment.h>
 #include <string.h>
 #include <errno.h>
+#if KERNEL_VERSION < 1001067
+#include <linux/segment.h>
+#include <linux/page.h>
+#else
+#include <asm/segment.h>
 #include <asm/page.h>
+#endif
 #include "emu.h"
 #include "memory.h"
 #include "dosio.h"
diff -u --recursive --new-file dosemu-0.60.3/emu.c dosemu/emu.c
--- dosemu-0.60.3/emu.c	Mon Jun 26 19:55:13 1995
+++ dosemu/emu.c	Mon Jul  3 15:47:45 1995
@@ -957,7 +957,7 @@
     static int recurse_check = 0;
     if (recurse_check) return;
     recurse_check = 1;
-
+    priv_on();
 #if 1 /* BUG CATCHER */
     if (in_vm86) {
       g_printf("\nkilled while in vm86(), trying to dump DOS-registers:\n");
diff -u --recursive --new-file dosemu-0.60.3/include/emu.h dosemu/include/emu.h
--- dosemu-0.60.3/include/emu.h	Wed Jun 28 13:23:30 1995
+++ dosemu/include/emu.h	Thu Jul 27 16:02:27 1995
@@ -402,6 +402,7 @@
        int  fastfloppy;
        char *emusys;		/* map CONFIG.SYS to CONFIG.EMU */
        char *emubat;		/* map AUTOEXEC.BAT to AUTOEXEC.EMU */
+       char *emuini;           /* map system.ini to  system.EMU */
 
        u_short speaker;		/* 0 off, 1 native, 2 emulated */
        u_short fdisks, hdisks;
diff -u --recursive --new-file dosemu-0.60.3/init/config.c dosemu/init/config.c
--- dosemu-0.60.3/init/config.c	Sat Jun 10 20:53:08 1995
+++ dosemu/init/config.c	Thu Jun 29 13:30:04 1995
@@ -117,6 +117,7 @@
 
     config.emusys = (char *) NULL;
     config.emubat = (char *) NULL;
+    config.emuini = (char *) NULL;
     tmpdir = strdup(tempnam("/tmp", "dosemu"));
     config.dosbanner = 1;
     config.allowvideoportaccess = 0;
diff -u --recursive --new-file dosemu-0.60.3/init/lexer.l dosemu/init/lexer.l
--- dosemu-0.60.3/init/lexer.l	Sat May 27 13:11:58 1995
+++ dosemu/init/lexer.l	Thu Jun 29 13:31:37 1995
@@ -72,6 +72,7 @@
 printer			return(PRINTER);
 emusys                  return(EMUSYS);
 emubat                  return(EMUBAT);
+emuini                  return(EMUINI);
 ttylocks		return(TTYLOCKS);
 
 	/* sillyint values */
diff -u --recursive --new-file dosemu-0.60.3/init/parser.y dosemu/init/parser.y
--- dosemu-0.60.3/init/parser.y	Sat Jun 10 19:33:09 1995
+++ dosemu/init/parser.y	Thu Jun 29 13:33:00 1995
@@ -129,7 +129,7 @@
 %token DEBUG MOUSE SERIAL COM KEYBOARD TERMINAL VIDEO ALLOWVIDEOPORT TIMER
 %token MATHCO CPU BOOTA BOOTB BOOTC L_XMS L_DPMI PORTS DISK DOSMEM PRINTER
 %token L_EMS L_UMB EMS_SIZE EMS_FRAME TTYLOCKS
-%token BOOTDISK L_FLOPPY EMUSYS EMUBAT L_X
+%token BOOTDISK L_FLOPPY EMUSYS EMUBAT EMUINI L_X
 	/* speaker */
 %token EMULATED NATIVE
 	/* keyboard */
@@ -190,6 +190,16 @@
 		    {
 		    config.emubat = $2;
 		    c_printf("CONF: config.emubat = '%s'\n", $2);
+                    }
+                | EMUINI STRING
+                    {
+                    config.emuini = $2;
+                    c_printf("CONF: config.emuini = '%s'\n", $2);
+                    }
+                | EMUINI '{' STRING '}'
+                    {
+                    config.emuini = $3;
+                    c_printf("CONF: config.emuini = '%s'\n", $3);
 		    }
 		| EMUBAT '{' STRING '}'
 		    {
diff -u --recursive --new-file dosemu-0.60.3/keyboard/keyboard-server.c dosemu/keyboard/keyboard-server.c
--- dosemu-0.60.3/keyboard/keyboard-server.c	Mon May  8 20:07:51 1995
+++ dosemu/keyboard/keyboard-server.c	Sun Jul 16 22:30:22 1995
@@ -740,6 +740,9 @@
       else if (kbd_flag (KF_CTRL))
 	put_queue (ctrl_cursor[sc]);
       else
+      if (key_flag(KKF_E0))
+        put_queue (old_sc << 8 | 0xe0);
+      else
 	put_queue (old_sc << 8);
       return;
     }
@@ -855,7 +858,10 @@
   else if (kbd_flag (KF_ALT))
     put_queue (0xa600);
   else
-    put_queue (sc << 8 | 0x0d);
+    if (key_flag(KKF_E0))
+      put_queue (0xe00d);
+    else
+      put_queue (sc << 8 | 0x0d);
 }
 
 static void
diff -u --recursive --new-file dosemu-0.60.3/keyboard/slang-keyboard.c dosemu/keyboard/slang-keyboard.c
--- dosemu-0.60.3/keyboard/slang-keyboard.c	Sun May 28 22:20:36 1995
+++ dosemu/keyboard/slang-keyboard.c	Mon Jul 17 20:06:53 1995
@@ -192,22 +192,22 @@
    {"\033On",	0x5300},	       /* Keypad . */
 
 /* Now here are the simulated keys using escape sequences */
-   {"\033[2~",	0x5200},	       /* Ins */
-   {"\033[3~",	0x5300},	       /* Del    Another keyscan is 0x007F */
-   {"\033[1~",	0x4700},	       /* Ho     Another keyscan is 0x5c00 */
-   {"\033[H",	0x4700},	       /* Ho */
-   {"\033[4~",	0x4f00},	       /* End    Another keyscan is 0x6100 */
-   {"\033[K",	0x4f00},	       /* End */
-   {"\033[5~",	0x4900},	       /* PgUp */
-   {"\033[6~",	0x5100},	       /* PgDn */
-   {"\033[A",	0x4800},	       /* Up */
-   {"\033OA",	0x4800},	       /* Up */
-   {"\033[B",	0x5000},	       /* Dn */
-   {"\033OB",	0x5000},	       /* Dn */
-   {"\033[C",	0x4d00},	       /* Ri */
-   {"\033OC",	0x4d00},	       /* Ri */
-   {"\033[D",	0x4b00},	       /* Le */
-   {"\033OD",	0x4b00},	       /* Le */
+   {"\033[2~",	0x52E0},	       /* Ins */
+   {"\033[3~",	0x53E0},	       /* Del    Another keyscan is 0x007F */
+   {"\033[1~",	0x47E0},	       /* Ho     Another keyscan is 0x5c00 */
+   {"\033[H",	0x47E0},	       /* Ho */
+   {"\033[4~",	0x4fE0},	       /* End    Another keyscan is 0x6100 */
+   {"\033[K",	0x4fE0},	       /* End */
+   {"\033[5~",	0x49E0},	       /* PgUp */
+   {"\033[6~",	0x51E0},	       /* PgDn */
+   {"\033[A",	0x48E0},	       /* Up */
+   {"\033OA",	0x48E0},	       /* Up */
+   {"\033[B",	0x50E0},	       /* Dn */
+   {"\033OB",	0x50E0},	       /* Dn */
+   {"\033[C",	0x4dE0},	       /* Ri */
+   {"\033OC",	0x4dE0},	       /* Ri */
+   {"\033[D",	0x4bE0},	       /* Le */
+   {"\033OD",	0x4bE0},	       /* Le */
    {"\033[[A",	0x3b00},	       /* F1 */
    {"\033[[B",	0x3c00},	       /* F2 */
    {"\033[[C",	0x3d00},	       /* F3 */
@@ -526,7 +526,8 @@
 	flags |= ALT_MASK;
 	add_scancode_to_queue (ALT_SCAN);
      }
-   
+
+   if ((lscan & 0xFF) == 0xE0) add_scancode_to_queue (0xE0);
    add_scancode_to_queue ((lscan & 0xFF00) >> 8);
 
    if (flags & SHIFT_MASK) 
@@ -737,4 +738,3 @@
      DOSemu_Keyboard_Keymap_Prompt = "[Ctrl]";
    else DOSemu_Keyboard_Keymap_Prompt = NULL;
 }
-
Binary files dosemu-0.60.3/libslang.a and dosemu/libslang.a differ
diff -u --recursive --new-file dosemu-0.60.3/mfs/mfs.c dosemu/mfs/mfs.c
--- dosemu-0.60.3/mfs/mfs.c	Fri Jun 23 17:30:02 1995
+++ dosemu/mfs/mfs.c	Thu Jul 27 15:16:28 1995
@@ -1646,6 +1646,17 @@
 }
 
 static inline int
+dos_flush(fd)
+     int fd;
+{
+  int ret;
+
+  ret = RPT_SYSCALL(fsync(fd));
+
+  return (ret);
+}
+
+static inline int
 dos_read(fd, data, cnt)
      int fd;
      char *data;
@@ -2991,6 +3002,7 @@
 	return (TRUE);
       }
 
+      bs_pos = strlen( fpath);
       while (de != NULL) {
 	if ((de->mode & S_IFMT) == S_IFREG) {
 	  strncpy(fpath + bs_pos + 1, de->name, 8);
@@ -3205,8 +3217,12 @@
 		     get_unix_attr(0664, attr))) < 0) {
 	Debug0((dbg_fd, "can't open %s: %s (%d)\n",
 		fpath, strerror(errno), errno));
+#if 1
+	SETWORD(&(state->eax), FILE_NOT_FOUND);
+#else
 	SETWORD(&(state->eax), ACCESS_DENIED);
-	return (TRUE);
+#endif
+	return (FALSE);
       }
     }
 
@@ -3456,7 +3472,7 @@
     break;
   case FLUSH_ALL_DISK_BUFFERS:	/* 0x20 */
     Debug0((dbg_fd, "Flush Disk Buffers\n"));
-    break;
+    return TRUE;
   case SEEK_FROM_EOF:		/* 0x21 */
     {
       int offset = (state->ecx << 16) + (state->edx);
@@ -3605,6 +3621,8 @@
     break;
   case COMMIT_FILE:		/* 0x07 */
     Debug0((dbg_fd, "Commit\n"));
+    fd = sft_fd(sft);
+    return (dos_flush(fd));
     break;
   case MULTIPURPOSE_OPEN:
     {
diff -u --recursive --new-file dosemu-0.60.3/mouse/mouse.c dosemu/mouse/mouse.c
--- dosemu-0.60.3/mouse/mouse.c	Thu Jun 22 20:23:18 1995
+++ dosemu/mouse/mouse.c	Thu Jul 27 15:18:05 1995
@@ -702,9 +702,11 @@
   SETIVEC(0x74, Mouse_SEG, Mouse_OFF + 4);
 
 #ifdef X_SUPPORT
+#ifndef X_SLOW_CHANGE_CURSOR
   if (config.X)
     X_change_mouse_cursor();
 #endif
+#endif
   
   /* Return 0xffff on success, 0x21 on failure */
   LWORD(eax) = 0xffff;  
@@ -895,9 +897,11 @@
 
   mouse.cursor_on = -1;
 #ifdef X_SUPPORT
+#ifndef X_SLOW_CHANGE_CURSOR
   if (config.X)
      X_change_mouse_cursor();
 #endif
+#endif
   mouse.lbutton = mouse.mbutton = mouse.rbutton = 0;
   mouse.oldlbutton = mouse.oldmbutton = mouse.oldrbutton = 1;
   mouse.lpcount = mouse.mpcount = mouse.rpcount = 0;
@@ -952,9 +956,11 @@
   }
  
 #ifdef X_SUPPORT
+#ifndef X_SLOW_CHANGE_CURSOR
   if (config.X)
 	  X_change_mouse_cursor();
 #endif
+#endif
 
   m_printf("MOUSE: %s mouse cursor %d\n", mouse.cursor_on ? "hide" : "show", mouse.cursor_on);
 }
@@ -975,10 +981,14 @@
 void 
 mouse_setpos(void)
 {
-  mouse.x = LWORD(ecx);
-  mouse.y = LWORD(edx);
-  mouse_move();
-  m_printf("MOUSE: set cursor pos x:%d, y:%d\n", mouse.x, mouse.y);
+  if (!config.X) {
+     mouse.x = LWORD(ecx);
+     mouse.y = LWORD(edx);
+     mouse_move();
+     m_printf("MOUSE: set cursor pos x:%d, y:%d\n", mouse.x, mouse.y);
+  }
+  else
+     m_printf("MOUSE: ignoring 'set cursor pos' in X\n");
 }
 
 void 
@@ -1103,7 +1113,7 @@
 mouse_set_tcur(void)
 {
   /* Ignore if in X */
-  if (config.usesX) return;
+  if (config.X) return;
 
   m_printf("MOUSE: set text cursor...type: %d, start: 0x%04x, end: 0x%04x\n",
 	   LWORD(ebx), LWORD(ecx), LWORD(edx));
@@ -1111,6 +1121,7 @@
   if (LWORD(ebx)==0) {				/* Software cursor */
 	  mouse.textscreenmask = LWORD(ecx);
 	  mouse.textcursormask = LWORD(edx);
+	  mouse_do_cur();
   } else {					/* Hardware cursor */
   /* CX - should be starting line of hardware cursor 
    * DX - should be ending line of hardware cursor
@@ -1119,6 +1130,7 @@
    	erase it before hitting vram */
 	  mouse.textscreenmask = 0x7fff;
 	  mouse.textcursormask = 0xff00;
+	  mouse_do_cur();
   }
 }
 
@@ -1446,7 +1458,7 @@
 	/* sigh, too many programs seem to expect the mouse cursor
 		to magically redraw itself when in text mode, so we'll
 		bend to their will... */
-	if (mouse.rx != mouse.oldrx || mouse.ry != mouse.oldry ||
+	if ((mouse.rx != mouse.oldrx || mouse.ry != mouse.oldry) &&
 			!mouse.gfx_cursor) {
 		mouse_do_cur();
 		mouse.oldrx = mouse.rx;
@@ -1510,6 +1522,17 @@
 void
 mouse_curtick(void)
 {
+#ifdef X_SUPPORT
+#ifdef X_SLOW_CHANGE_CURSOR
+  static short last_cursor_on = -1;
+
+  if (config.X && mouse.cursor_on != last_cursor_on) {
+    X_change_mouse_cursor();
+    last_cursor_on = mouse.cursor_on;
+  }
+#endif
+#endif
+
   if ((mouse.cursor_on != 0) || config.X)
     return;
 
diff -u --recursive --new-file dosemu-0.60.3/pic/pic.c dosemu/pic/pic.c
--- dosemu-0.60.3/pic/pic.c	Wed Jun 28 12:15:55 1995
+++ dosemu/pic/pic.c	Thu Jul 27 15:13:51 1995
@@ -169,6 +169,8 @@
  * 
  * To avoid line wrap, the first seven values are printed without labels.
  * Instead, a header line is printed every 15 messages.
+ *
+ * DANG_END_FUNCTION pic_print
  */
 #ifdef NO_DEBUGPRINT_AT_ALL
 #define pic_print(code,s1,v1,s2)
@@ -212,6 +214,8 @@
  * could occur.  This external stack is kept strictly synchronized with
  * the actions of the dos code to avoid any problems.  pic_push and pic_pop
  * maintain the external stack.
+
+ * DANG_END_MODULE pic_print
  */
 void inline pic_push(int val)
 {
@@ -548,17 +552,17 @@
    "pushl %%ecx\n\t"                          /* save old ilevel             */
    "addl "CISH_INLINE(pic_smm)",%%ecx\n\t"    /* check spec. mask mode       */
                                               /***  while(.....){            */
-   "L1:movl "CISH_INLINE(pic_isr)",%%eax\n\t" /* 1: int_request = (pic_isr   */
+   "1:movl "CISH_INLINE(pic_isr)",%%eax\n\t" /* 1: int_request = (pic_isr   */
    "orl "CISH_INLINE(pic_imr)",%%eax\n\t"     /* | pic_imr)                  */
    "notl %%eax\n\t"                           /* int_request = ~int_request  */
    "andl "CISH_INLINE(pic_irr)",%%eax\n\t"    /* int_request &= pic_irr      */
-   "jz L3\n\t"                                /* if(!int_request) goto 3     */
-   "L2:bsfl %%eax,%%ebx\n\t"                  /* 2: ebx=find_bit(int_request)*/
-   "jz L3\n\t"                                /* if(!int_request) goto 3     */
+   "jz 3f\n\t"                                /* if(!int_request) goto 3     */
+   "2:bsfl %%eax,%%ebx\n\t"                  /* 2: ebx=find_bit(int_request)*/
+   "jz 3f\n\t"                                /* if(!int_request) goto 3     */
    "cmpl %%ebx,%%ecx\n\t"                     /* if(ebx > pic_ilevel)...     */
-   "jl L3\n\t"                                /* ... goto 3                  */
+   "jl 3f\n\t"                                /* ... goto 3                  */
    "btrl %%ebx,"CISH_INLINE(pic_irr)"\n\t"    /* clear_bit(ebx,&pic_irr)     */
-   "jnc L2\n\t"                               /* if bit wasn't set, go to 2  */
+   "jnc 2b\n\t"                               /* if bit wasn't set, go to 2  */
    "movl "CISH_INLINE(pic_isr)",%%ecx\n\t"    /* get current pic_isr         */
    "btsl %%ebx,%%ecx\n\t"                     /* set bit in pic_isr          */
    "movl %%ebx,"CISH_INLINE(pic_ilevel)"\n\t" /* set new ilevel              */
@@ -569,9 +573,9 @@
    "movl "CISH_INLINE(pic_ilevel)",%%eax\n\t" /* get new ilevel              */
    "btrl %%eax,"CISH_INLINE(pic_isr)"\n\t"    /* reset isr bit - just in case*/
    "btrl %%eax,"CISH_INLINE(pic1_isr)"\n\t"   /* reset isr bit - just in case*/
-   "jmp L1\n\t"                               /* go back for next irq        */
+   "jmp 1b\n\t"                               /* go back for next irq        */
                                               /**** end of while   }      ****/
-   "L3:popl "CISH_INLINE(pic_ilevel)"\n\t"    /* 3: restore old ilevel & exit*/
+   "3:popl "CISH_INLINE(pic_ilevel)"\n\t"    /* 3: restore old ilevel & exit*/
    :                                          /* no output                   */
    :                                          /* no input                    */
    :"eax","ebx","ecx");                       /* registers eax, ebx, ecx used*/
@@ -879,6 +883,7 @@
  * If the requested interrupt level is currently active, the returned status
  * will depend upon whether the interrupt code has re-requested itself.  If
  * no re-request has occurred, a value of false (zero) will be returned.  
+ * DANG_END_FUNCTION
  */
  
 int pic_pending(int ilevel)
@@ -890,6 +895,7 @@
  * pic_activate requests any interrupts whose scheduled time has arrived.
  * anything after pic_dos_time and before pic_sys_time is activated.
  * pic_dos_time is advanced to the earliest time scheduled.
+ * DANG_END_FUNCTION
  */
 void pic_activate()
 {
@@ -935,6 +941,7 @@
  * To assure proper repeat scheduling, pic_sched should be called from
  * within the interrupt handler for the same interrupt.  The maximum 
  * interval is 15 minutes (0x3fffffff).
+ * DANG_END_FUNCTION
  */
  
 void pic_sched(ilevel,interval)
diff -u --recursive --new-file dosemu-0.60.3/video/vc.c dosemu/video/vc.c
--- dosemu-0.60.3/video/vc.c	Sat Jun 24 16:56:49 1995
+++ dosemu/video/vc.c	Fri Jun 30 18:23:04 1995
@@ -611,6 +611,7 @@
 
 
 /* why count ??? */
+/* Because you do not want to open it more than once! */
 static u_char kmem_open_count = 0;
 
 void
@@ -625,6 +626,7 @@
 
   if (mem_fd != -1)
     return;
+  priv_on();
   mem_fd = open("/dev/kmem", O_RDWR);
   if (mem_fd < 0)
     {
