Skip to contentSkip to conversation

Introducing my own interrupt in dosemu.

DISCUSSION Stas Sergeev 1 participant 1 message Jul 21, 2004

lore
Share & tools
lore
#0 lore raw

Hello.

Quoted 2 lines · Wartan Hachaturow

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.