Article View: gnu.gcc.help
Article #52083Re: GCC & DOS interrupts
From: Michael R Castle
Date: Thu, 18 Feb 1993 20:56
Date: Thu, 18 Feb 1993 20:56
50 lines
3442 bytes
3442 bytes
In article <1993Feb17.102315.1798@aber.ac.uk> auj@aber.ac.uk (Alun Jones) writes:
>Sorry if this is the wrong group or I am being hopelessly naive...
>
>I am running GCC 2.2.2d on a PC. Until recently I've been using Borland
>C, but would like to port my code to GCC to avoid the brain-dead segmented
>rubbish they call real mode. My problem is that I have to access a driver
>to talk to a DSP processor using DOS interrupts. Whenever I try this I
>get an exception from the program. Using interrupt 0x21 to find the
>required interrupt vector gives exception no. 0x21, likewise interrupt
>0x65 (to access the board) gives exception 0x65. I have a suspicion that
>I'm asking for the impossible here, and that real mode calls can't be
>made under the GO32 extender. If anyone could confirm that or give me
>a useful counterexample I'd be very grateful,
[disclaimer: I've switched from dos to os/2, and no longer use djgpp, so
some of this info may be out of date, or misremembered]
There are basically two approaches to doing this type of hardware manipulation.
1) modify the dos extender (go32). An example of doing this are the
lgrx.a functions (interrupt driven mouse routines instead of polling,
call back functions, etc). Probably the only thing I would have
recommended being added using this method would be generic signal
handlers. NO INTERRUPTS USING THIS METHOD! go32 is running tight on
real mode memory, and careful consideration should be made before
adding anything to it.
2) TSR method. the file aeasy10x.zip has an example of this. Basically,
a generic interface is provide, and the TSR provides the specific
interface to the hardware. While asy is for asychronous comm port
access, it should work with *any* hardware driven interrupts.
FYI, there is a mailling list dedicated to djgpp, go32, and apps written
for it. It is pretty active (last I was subscribed to it, anyway), and a
pretty good forum for this type of discussion. Be warned, DJ has just
become a new father and doesn't have a lot of time to spend on extra
development at the moment, though I beleive someone else is doing some
work on it (such as adding dpmi support), though I can't remember who
it is (Alan Eldridge, I *think* , the 'ae' from aeasy above).
Info on the list is in the documentation that comes with djgpp, or mail
me and I will send you info.
regards,
mrc
--
Mike Castle .-=NEXUS=-. Life is like a clock: You can work constantly
mcastle@cs.umr.edu and be right all the time, or not work at all
S087891@UMRVMA.UMR.EDU and be right at least twice a day. -- mrc
We are all of us living in the shadow of Manhattan. -- Watchmen
Technical Details
Message-ID:
<1993Feb18.205626.18460@umr.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!agate!howland.reston.ans.net!wupost!crcnis1.unl.edu!moe.ksu.ksu.edu!usenet-feed.umr.edu!mcastleReferences:
<1993Feb17.102315.1798@aber.ac.uk>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,c4b73af4d01c7169 X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1993-02-18 12:56:26 PST Newsgroups: gnu.gcc.help Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!agate!howland.reston.ans.net!wupost!crcnis1.unl.edu!moe.ksu.ksu.edu!usenet-feed.umr.edu!mcastle From: mcastle@cs.umr.edu (Michael R Castle) Subject: Re: GCC & DOS interrupts References: <1993Feb17.102315.1798@aber.ac.uk> Date: Thu, 18 Feb 1993 20:56:26 GMT Nntp-Posting-Host: next5.cs.umr.edu Organization: University of Missouri - Rolla, Rolla, MO Keywords: DOS. Sender: cnews@umr.edu (UMR Usenet News Post) Message-ID: <1993Feb18.205626.18460@umr.edu> Lines: 50