comp.lang.ada
 help / color / mirror / Atom feed
From: Greg Bond <bond@ee.ubc.ca>
Cc: jerry@jvdsys.nextjk.stuyts.nl
Subject: Re: GNAT and interrupts with DJGPP and CWSPR0
Date: 1996/08/19
Date: 1996-08-19T00:00:00+00:00	[thread overview]
Message-ID: <3218DBEE.3988@ee.ubc.ca> (raw)
In-Reply-To: Dw96tE.2L@jvdsys.nextjk.stuyts.nl


Jerry van Dijk wrote:
> 
> As my news seems to get out and my last post was not really of
> examplary clarity, lets try an example:
> 
>    -----------------------------------------------------------------
>    -- Chains a GNAT procedure into the DOS timer interrupt        --
>    -- and displays the current time in the upper right corner     --
>    -- of the screen.                                              --
>    -- Note that this demo assumes that virtual memory is disabled --
>    -- and that there is enough space on the interrupt stack!      --
>    -----------------------------------------------------------------

<Much enlightening code deleted...>

While Jerry has shown with his sample code that it is relatively 
straightforward to chain interrupt handlers in DJGPP, this is only a 
partial solution for me. When I teach real-time, I stress that the bulk 
of interrupt processing should be performed by an interrupt task, not an 
interrupt handler (in order to avoid priority inversion). Unfortunately, 
most of the GNAT ports, including DJGPP, do not support interrupt tasks 
(i.e. using an interrupt handler to signal a task via a protected object 
as described in the Ada95 rationale).

The only workarounds that I can think of are either performing all the 
itnerrupt processing in the handler itself (poor practice), or having 
the interrupt handlers set flags, and poll the flags from Ada tasks 
(poor practice again). Any other suggestions?

I'm currently considering moving to ObjectAda which should support 
interrupt tasks, however the new challenge will be to avoid all the 
non-real-time aspects of Win95 (not that DPMI servers don't come with 
their own hidden real-time overhead)...

--
* Greg Bond                         * Dept. of Electrical Eng.  
* email: bond@ee.ubc.ca             * Univ. of British Columbia      
* voice: (604) 822 0899             * 2356 Main Mall                 
* fax:   (604) 822 5949             * Vancouver, BC              
* web: http://www.ee.ubc.ca/~bond   * Canada, V6T 1Z4




      reply	other threads:[~1996-08-19  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-08-13  0:00 GNAT and interrupts with DJGPP and CWSPR0 Greg Bond
1996-08-15  0:00 ` Jerry van Dijk
1996-08-16  0:00   ` Greg Bond
1996-08-16  0:00 ` Jerry van Dijk
1996-08-19  0:00   ` Greg Bond [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox