Mail Archives: djgpp/2000/03/27/16:51:40
Actually, you can (look my other post), but DJGPP doesn't allow
reentrant interrupts.. Which means that you can either take over the
interrupt, or just run code before the interrupt (after your code is
done it automatically calls the BIOS one). It doesn't really matter for
keyboard handler, unless you want to use stdio function (eg: getch())..
Though, for timer interrupts, it's trivial to call the BIOS handler 18.2
times per second.
My question is, where can I find information on those wrappers? Like,
what they do, and what to put in them? As you can see from the other
post, I use a _go32 function to make the wrapper for me, but in the case
of timer interrupts, I read somewhere that I would need to make my own
wrapper..
TIA,
.(Trancelucid).
. Jaune .
"Alexei A. Frounze" wrote:
>
> In fact, you can't make it in plane C with DJGPP. That's because
> DJGPP/GCC doesn't know the reserved word such as "interrupt" or
> "__interrupt". You must make IRQ wrapper in ASM and switch there stack
> as well due to flat memory model which is used by C programs. But indeed
> most of things could be really made in a C function that you can call
> from the IRQ wrapper. This is a way Allegro works and I also implemented
> similar thing w/o Allegro myself. It's rather simple. Beleive me.
>
> Wanna sources?
>
> ASM file is 854 bytes long with about 30 lines. :)
> Main C module with kbd functions is 6 KB.
> Example program is 0.5 KB.
>
> So it's indeed very short and simple thingy.
>
> Alexei A. Frounze
> --
> Homepage: http://alexfru.chat.ru
> Mirror: http://members.xoom.com/alexfru
- Raw text -