delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/27/16:51:40

Message-ID: <38DFC431.8D19F7D6@corel.com>
Date: Mon, 27 Mar 2000 15:27:29 -0500
From: Jonathan Meunier <jonathanm AT corel DOT com>
X-Mailer: Mozilla 4.7 [en] (Win95; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: keyboard interrupt
References: <8bod7h$rj1$1 AT gxsn DOT com> <38DFBCCB DOT 6A1BC333 AT mtu-net DOT ru>
NNTP-Posting-Host: 120.150.3.42
X-Trace: 27 Mar 2000 15:26:38 -0500, 120.150.3.42
Lines: 41
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019