Skip to contentSkip to conversation

dosemu-1.2.2

announce Stas Sergeev 2 participants 2 messages Jul 16, 2004 – Jul 19, 2004

lore
Share & tools
lore
#0 lore raw

Hello.

Quoted 1 line · Ralph Alvy

With version 1.2.1, hogthreshold at 2 keeps the CPU at 60% and printing is almost immediate at a timeout value of 10.

Probably the attached patch can
rectify the problem?

base/dev/misc/lpt.c +9 -6
@@ -20,6 +20,7 @@
 #include <sys/wait.h>
 
 #include "emu.h"
+#include "timers.h"
 #include "lpt.h"
 #include "utilities.h"
 #include "dos2linux.h"
@@ -53,11 +54,13 @@
     return 1;
   }
 
+  reset_idle();
+
   switch (HI(ax)) {
   case 0:			/* write char */
     /* p_printf("print character on lpt%d : %c (%d)\n",
 			       LO(dx), LO(ax), LO(ax)); */
-    HI(ax) = (lpt[LO(dx)].fops.write) (LO(dx), LO(ax));
+    HI(ax) = printer_write(LO(dx), LO(ax));
     break;
 
   case 1:			/* init */
@@ -178,12 +181,12 @@
 int
 stub_printer_write(int prnum, int outchar)
 {
-  (lpt[prnum].fops.open) (prnum);
+  printer_open(prnum);
 
   /* from now on, use real write */
   lpt[prnum].fops.write = lpt[prnum].fops.realwrite;
 
-  return ((lpt[prnum].fops.write) (prnum, outchar));
+  return printer_write(prnum, outchar);
 }
 
 int
@@ -234,8 +237,7 @@
   for (loop = 0; loop < NUM_PRINTERS; loop++) {
     p_printf("LPT: closing printer %d (%s)\n", loop,
 	     lpt[loop].dev ? lpt[loop].dev : "<<NODEV>>");
-    if (lpt[loop].fops.close)
-       (lpt[loop].fops.close) (loop);
+    printer_close(loop);
   }
 }
 
@@ -248,9 +250,10 @@
     if (lpt[i].remaining >= 0) {
       p_printf("LPT: doing real tick for %d\n", i);
       if (lpt[i].remaining) {
+        reset_idle();
 	lpt[i].remaining--;
 	if (!lpt[i].remaining)
-	  (lpt[i].fops.flush) (i);
+	  printer_flush(i);
       }
     }
   }

Scanned by evaluation version of Dr.Web antivirus Daemon
http://drweb.ru/unix/

#1 lore raw
Quoted 8 lines · Stas Sergeev

Hello.

Quoted 2 lines · Ralph Alvy

With version 1.2.1, hogthreshold at 2 keeps the CPU at 60% and printing is almost immediate at a timeout value of 10.

Probably the attached patch can
rectify the problem?

Well, I'll wait until the next binary. I'm not sure how to use that patch. I'm clearly not a very sophistated Linux user.