www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/12/18/02:38:26

From: "Michael Schuster" <Schuster AT eev DOT e-technik DOT uni-erlangen DOT de>
Organization: LS f. Elektr. Energieversorgung
To: snarfy AT goodnet DOT com, djgpp AT delorie DOT com
Date: Wed, 18 Dec 1996 08:24:36 MEZ
Subject: Re: Accessing Data in an interrupt handler
Message-Id: <D1AD2145BF@merlin2.e-technik.uni-erlangen.de>

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 -


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