www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1993/06/26/09:09:44

Date: Sat, 26 Jun 93 08:53:46 -0400
From: mjc AT zuvad DOT DNET DOT NASA DOT GOV (Mail from Martin Clayton)
To: "djgpp AT sun DOT soe DOT clarkson DOT edu"@EAST.DNET.NASA.GOV
Subject: Interrupts etc...

My work required an interrupt driven data acquisition system, and, 
for various reasons I needed a protected mode handler routine.  
With much help from DJD I have been able to get something working.  
Unfortunately, at the moment I do not have time to properly complete 
the work but as several people seem interested I'll sumarise the 
methods used so far here.  

The address of my handler function has to be passed to GO32,
this is done by adding a new case to those in turbo_assist() 
and a new global variable (call it pvec) to store the address.  
An interrupt handler which calls go32() having set the a_tss.tss_eip
to pvec is installed using setvect() when GO32 starts.  
In my program code I have three assembler functions, one to install 
a protected mode handler, the protected mode handler and the one 
pointed to by pvec.  The handler and pvec functions are pretty similar
except one has an iret instruction...both call a function pointed 
to by a program global, this lets me change the way the interrupt 
is processed without further use of setvect().

All of this basically works, however, I have carefully disabled the
interrupting hardware when using mouse/keyboard/time calls and I still have
the occasional program crash. Also, note that:

1) I haven't even tried to get DEBUG32 to support the interrupt system.
2) As previously mentioned system() calls will be a problem if
interrupts are enabled.  (Fortunately for me this is not the case!)
3) I'm using GO32 v1.08.
4) My hardware will not generate an interrupt until I configure it.
5) The address of the handler function `pvec' must be less than 64K.

With a bit more work on the turbo_assist part and the assembler function
to install the handler a basic implementation of setvect() may be possible.

Martin Clayton, mjc AT zuvad DOT nasa DOT dnet DOT gov


- Raw text -


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