From: Thomas Demmer Newsgroups: comp.os.msdos.djgpp Subject: Re: Hardware Interrupts with C Date: Tue, 17 Dec 1996 12:47:25 +0100 Organization: Lehrstuhl fuer Stroemungsmechanik Lines: 52 Message-ID: <32B6884D.794B@LSTM.Ruhr-UNI-Bochum.De> References: NNTP-Posting-Host: bvb.lstm.ruhr-uni-bochum.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit CC: Schuster AT eev DOT e-technik DOT uni-erlangen DOT de To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Michael Schuster wrote: [...] > I've written the wrapper and other relating stuff preparing the > interrupt as described in libc - info. The > Interrupt was ok, but when leaving the program, it crashed, and I > never knew why. > In my interrupt routine an short array was filled with values by > inportb (myport). > > When I defined the array e.g. with > > short data[11][120]; > > and used it in the IR, the program crashed when leaving the IR or > stopping it within the programm. > After declaring with > > short **data; > > and malloc'ed the pointer the IR works stable, and now works > with allegro and rhide pretty good. > > Does anyone know why the difference in behaviour? > Out of the blue: Do you ever lock data, or your handler routines? What I just guess is that for what ever reasons parts of the static data area, including the array, gets swapped out. The malloc'd region happens to remain in memory and you were just lucky. OTOH, if you _did_ lock everything you had to lock, I lack an explaination. -- Ciao Tom ************************************************************* * Thomas Demmer * * Lehrstuhl fuer Stroemungsmechanik * * Ruhr-Uni-Bochum * * Universitaetsstr. 150 * * D-44780 Bochum * * Tel: +49 234 700 6434 * * Fax: +49 234 709 4162 * * Voice/Fax Box: +49 2561 91371 6148 * * http://www.lstm.ruhr-uni-bochum.de/~demmer * *************************************************************