🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.msdos.programmer
Article #155

Re: Keyboard interrupt conflict?

#155
From: geeslin
Date: Mon, 13 Apr 1992 21:02
67 lines
3168 bytes
In article <sbe4gINN2a9@agate.berkeley.edu>, andywang@crown.berkeley.edu (Andrew Wang) writes:
> Hello,
>     I am having a problem with keyboard interrupts crashing my
> program.  It is a control program with a real-time hardware interrupt
> driven at 39 hz. Everything works fine until a) the keyboard buffer
> fills up and the computer tries to beep or b) sometimes a single keypress 
> will cause it to crash.
> 
> This is what I have in my (QuickC) interrupt handler:
> 
> void _far _interrupt() 
> {
>    reset_timer();		/* Reset hardware timer for next interrupt */
>    clr_int();			/* Clear interrupt request from timer */
>    outp(8259control,0x20);	/* Re-enable 8259 for next interrupt? */
>    _enable();
> 
> 
>    (body of interrupt handler)
> 
> 
> }
> 
> The interrupt handler takes maybe 1 - 4 milliseconds to complete.
> The program works on a 386-33, but neither of the AMI bios 486's
> that we have (25,33 mhz).
> 
> Here are the things I've tried:
> 
>    Removing _enable() will cause the program to crash after a certain amount
>    of time. This is possibly due to other interrupts not getting serviced? 
>    Refresh?
> 
>    Ignoring the keyboard entirely (not fetching any keys) will cause the
>    computer to crash when the buffer fills up and beeps.  Quick C says never
>    to use INT10 to beep when the video BIOS routines are running, otherwise a 
>    crash may occur. My main routine is very video-intensive, but I never TRY
>    to make the computer beep.  The interrupt handler does not touch video.
> 
>    Hmm, I tried some other things but now I can't remember!
> 
> Does anyone know how to disable the keyboard interrupt? I would like to try
> to disable it during my interrupt handler. I'll be sure to post a follow-up
> if this works!
> 
> Thanks in advance for any help you might be able to provide me!!!!
> 
> Andrew
> (arrgh!)

	I share your frustration!  I had the same problem with a
	routine to do reaction times.  In it, the speaker was being
	driven under program control and as soon as the respondent
	pressed the key (the object of the whole routine), the 486
	locked up.  Solution was to replace the keyboard interrupt
	handler address with an address of my own choosing.  Then I
	could watch for a keystroke, time it, and not let the system
	(the buffer) see it.

	Hope this helps!
	R*


-- 
Robert H. Geeslin, Ed.D.                    | Voice (918) |  Department
Geeslin@VMS.OCOM.OKSTATE.EDU                | 582-2681 day|      of
doing EDucational Programming for 20 years  | 224-0065 eve|  P. and B.S.
Technical Details
Message-ID: <1992Apr13.150233.1@vms.ocom.okstate.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!qt.cs.utexas.edu!cs.utexas.edu!convex!constellation!unx.ucc.okstate.edu!vms.ocom.okstate.edu!geeslin
References: <sbe4gINN2a9@agate.berkeley.edu>

Show Full Headers
Complete Article Headers
Newsgroups: alt.msdos.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!qt.cs.utexas.edu!cs.utexas.edu!convex!constellation!unx.ucc.okstate.edu!vms.ocom.okstate.edu!geeslin
From: geeslin@vms.ocom.okstate.edu
Subject: Re: Keyboard interrupt conflict?
Message-ID: <1992Apr13.150233.1@vms.ocom.okstate.edu>
Lines: 67
Sender: news@unx.ucc.okstate.edu (USENET News System)
Organization: College of Osteopathic Medicine, O.S.U.
References: <sbe4gINN2a9@agate.berkeley.edu>
Date: Mon, 13 Apr 1992 21:02:33 GMT