www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/02/08:13:48

Date: Wed, 2 Sep 1998 11:06:11 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Zixyer S Qwerty <zixyer AT juno DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: HW Interrupts
In-Reply-To: <19980901.164210.6318.1.zixyer@juno.com>
Message-ID: <Pine.SUN.3.91.980902110533.517U-100000@is>
MIME-Version: 1.0

On Tue, 1 Sep 1998, Zixyer S Qwerty wrote:

> I'm porting a program that hooks int 9 and chains to the initial
> interrupt only under certain conditions (by executing a jmp instruction).
> How would you do this in DJGPP?

There are several examples floating around that do this.  The FAQ
lists some of them (in section 22.2).  Another example is in the DJGPP
library sources (djlsr201.zip), in the file src/libc/go32/exceptn.S
(yes, the DJGPP startup code itself hooks the keyboard interrupt).

> Also, the FAQ says that in practice it's impossible to lock all the
> memory that an interrupt handler touches if it's written in C.  Is
> this true?

Of course, it's true!  One particularly nasty problem is that you
cannot lock the stack from a C function, so automatic variables cannot
be locked.  Locking the code of a C function is also hard (how do you
know the size of the code of a function?).  A trick is widely used to
work around this, but it isn't guaranteed to work with all versions of
the compiler and with all possible combinations of optimization
options.

- Raw text -


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