* Re: Introducing my own interrupt in dosemu.
@ 2004-07-21 16:26 Stas Sergeev
0 siblings, 0 replies; 4+ messages in thread
From: Stas Sergeev @ 2004-07-21 16:26 UTC (permalink / raw)
To: linux-msdos
Hello.
Wartan Hachaturow wrote:
> At irq frequencies of, say, 128 HZ, I've faced a "lost interrupts"
> Are there any common ways to deal with serialization of interrupts
Yes, see the timer code (as you already did,
pic_sched() is from there).
Doing pic_sched() before do_irq() should
do the trick for the periodic interrupts.
However, as your interrupt is not periodic
but rather a signal-driven, this may not be
what you want.
The easiest way around may be this: in
your signal handler you increment the counter
and call pic_request().
In the IRQ handler function you decrement
the counter, and if it is >0, you do
pic_request() right there, before do_irq().
This will compensate the lost irqs.
Something like that is done in
raw_mouse_getevents().
Maybe we need a better queueing mechanism,
but so far noone needed it and I think one
was removed 5 years ago.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Introducing my own interrupt in dosemu.
@ 2004-07-16 11:18 Stas Sergeev
2004-07-21 13:46 ` Wartan Hachaturow
0 siblings, 1 reply; 4+ messages in thread
From: Stas Sergeev @ 2004-07-16 11:18 UTC (permalink / raw)
To: linux-msdos
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Introducing my own interrupt in dosemu.
2004-07-16 11:18 Stas Sergeev
@ 2004-07-21 13:46 ` Wartan Hachaturow
0 siblings, 0 replies; 4+ messages in thread
From: Wartan Hachaturow @ 2004-07-21 13:46 UTC (permalink / raw)
To: linux-msdos
On Fri, Jul 16, 2004 at 03:18:20PM +0400, Stas Sergeev wrote:
> 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.
Thanks a lot, that helped.
If you don't mind, another small question :)
At irq frequencies of, say, 128 HZ, I've faced a "lost interrupts"
problem -- in some cases, my interrupts are lost (i.e. the amount of interrupts
I count from inside isn't the same as the amount of signals that are sent).
I think the reason is that one pending interrupt-deep queue.
Are there any common ways to deal with serialization of interrupts (with
a trade-off delay in triggering, of course) by dosemu "devices" or I have
to somehow figure out my own?
--
Thanks in advance, Wartan.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Introducing my own interrupt in dosemu.
@ 2004-07-16 10:25 Wartan Hachaturow
0 siblings, 0 replies; 4+ messages in thread
From: Wartan Hachaturow @ 2004-07-16 10:25 UTC (permalink / raw)
To: linux-msdos
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-07-21 16:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-21 16:26 Introducing my own interrupt in dosemu Stas Sergeev
-- strict thread matches above, loose matches on Subject: below --
2004-07-16 11:18 Stas Sergeev
2004-07-21 13:46 ` Wartan Hachaturow
2004-07-16 10:25 Wartan Hachaturow
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox