Introducing my own interrupt in dosemu.

2004-07-16 Thread Wartan Hachaturow
Hello.

I've got a rather simple task: generate an irq inside dosemu and let
PIC propagate it further into DOS or whatever is running inside.
The irq generation should be driven by a signal to a dosemu process.
I've managed to set my signal handler in arch/linux/async/signal.c, and
I see dosemu actully recieving the needed signal.
Then, in signal handler:
pic_sched(PIC_IRQ10, 1);  /* That should schedule an irq 10 in 
   * 1 dosemu jiffie, right?
   */
do_irq(); 
(I decided to use IRQ10 for my needs, since it doesn't look being used
for other stuff in real mode).
If I understand right, this should be enough for IRQ to be generated by
PIC emulation -- but for some reason, when I install a 0x72 interrupt
handler in FreeDOS running under DOSEmu, I don't see any actual calls.

Additionally, I initialize PIC to unmask the interrupt in init.c:
pic_seti(PIC_IRQ10, my_interrupt, 0, NULL);
pic_unmaski(PIC_IRQ10);

But my_interrupt() (which should just do a warn()) doesn't get called
either :(
I must say I'm pretty lost in the code. If someone would show me some
basic direction to go, I'll be thankful..

-- 
TIA, Wartan.
-
To unsubscribe from this list: send the line unsubscribe linux-msdos in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Introducing my own interrupt in dosemu.

2004-07-16 Thread Stas Sergeev
Hello.
Wartan Hachaturow wrote:
Then, in signal handler:
pic_sched(PIC_IRQ10, 1);  /* That should schedule an irq 10 in 
			   * 1 dosemu jiffie, right?
			   */
  do_irq(); 
That's rather wrong. You took that from the
timer code, but that's really not the case
here. You should just use pic_request().
Additionally, I initialize PIC to unmask the interrupt in init.c:
pic_seti(PIC_IRQ10, my_interrupt, 0, NULL);
pic_unmaski(PIC_IRQ10);
That's correct.
But my_interrupt() (which should just do a warn()) doesn't get called
either :(
Note that pic_unmaski() unmasks the IRQ only
internally, i.e. it makes it available for the
use of a DOS prog. You still have to unmask it
from within your DOS program yourself, when
setting up the handler. I guess this is what
you have not done.
-
To unsubscribe from this list: send the line unsubscribe linux-msdos in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [announce] dosemu-1.2.2

2004-07-16 Thread Stas Sergeev
Hello.
Ralph Alvy wrote:
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?

--- src/base/dev/misc/lpt.c	2004-06-07 00:14:59.0 +0400
+++ src/base/dev/misc/lpt.c	2004-07-16 21:26:10.157433832 +0400
@@ -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/



[no subject]

2004-07-16 Thread qkhyfgmqkwa
-
To unsubscribe from this list: send the line unsubscribe linux-msdos in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html