Mail Archives: djgpp/1996/12/18/02:38:26
Hi Snarfy!
> > Hardware Interrupts with C
Thanks for the Asembler routine (although I don't understand any part
of it).
> short data[11][120] is stored in the data segment of your program if
> you declared it globally. In an interrupt handler, the data segment
> register (%ds) is set by the DPMI provider. With this new %ds, all
> access to your C variables will SIGSEGV.
I've declared them as global, your right and used _go32_dpmi -
functions.
But I still donot understand why the Interrupt works, the programm
is running, but when releasing the interrupt or shutting down the
program, why the program crashes.
Also non array, global variables, are still in use in my
interrupthandler, and they don't harm anything (till now). Is this ok, then?
(perhaps you explained that with the register %ds, but as I told I
don't know anything about registers, asembler ...)
> And then install it with the __dpmi_set_.... Don't use the _go32_dpmi
> functions to install this, as it won't work. The _go32_dpmi functions
> expect the function to 'ret' not 'iret', which is a bad thing because
> there is a race condition and you can't lock the code really well.
Hmm??
Thanks again. I will test it.
Michi
BTW: Allegro is wunderful!
**********************************************
Michael Schuster
E-mail: Schuster AT eev DOT e-technik DOT uni-erlangen DOT de
Universitaet Erlangen/Nuernberg
Lehrstuhl fuer Elektrische Energieversorgung
Cauerstrasse 4
91058 Erlangen
http://www.eev.e-technik.uni-erlangen.de/
**********************************************
- Raw text -