Mail Archives: djgpp/1997/02/28/12:16:20
Petteri Kangaslampi (pekangas AT sci DOT fi) wrote:
: we don't lock any of the memory we use, even though most of it gets used
: in the timer interrupt. Everything seems to work OK, both under DOS
: (cwsdpi) and Win95, but this still isn't good practise. Any ideas on how
: to easily lock all memory used?
A timer interrupt handler shouldn't be too difficult to write in
assembly (which will be easy to lock) especially since you already have
the equivalent C code. Just put the handler (and any other code it could
call) into a separate source file, use gcc -S to compile it to assembly,
add the irq-handling code (executed by wrapper for C handler), and
change the handle-installing code not to allocate wrapper for the
handler. Of course, you still can have a few screenfuls of
memory-locking code for your data areas :-), but that's how it should be
done. Meanwhile, you should advise that all programs using this
timer interrupt should be compiled with the startup flag which causes
all program memory be locked (the name of which I can't remember) set.
--
Esa Peuha
student of mathematics at the University of Helsinki
http://www.helsinki.fi/~peuha/
- Raw text -