www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/12/17/08:16:46

From: Thomas Demmer <demmer AT LSTM DOT Ruhr-UNI-Bochum DOT De>
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: <BC109B5D17 AT merlin2 DOT e-technik DOT uni-erlangen DOT de>
NNTP-Posting-Host: bvb.lstm.ruhr-uni-bochum.de
Mime-Version: 1.0
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                *
*************************************************************

- Raw text -


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