www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/02/20/04:07:30

Xref: news2.mv.net comp.os.msdos.djgpp:1255
From: kalzus@[128.122.230.28] (Lance Kalzus)
Newsgroups: comp.os.msdos.djgpp
Subject: Interrupt trapping
Date: 19 Feb 1996 08:04:52 GMT
Organization: Pyros
Lines: 34
Message-ID: <4g9av4$fa2@cmcl2.NYU.EDU>
NNTP-Posting-Host: kim.nr.res.nyu.edu
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I apologize for this asinine question (but the only truly stupid question 
is an unasked one, no? :) involving hardware interrupts while running a 
DJGPPv2 program:

My situation is this:

I have an application which requires me to trap two hardware interrupts.  
Unfortunately, one of those hardware interrupts is the system timer 
itself.  I'd like to trap it while my program is running, have it 
increment a simple counter, and if possible, call the DOS clock handler 
at an appropriate time (this part isn't strictly necessary, but it _is_ 
nice to do properly :), and interrupt-return.

I tried using the _go32_set_protected_mode_interrupt_vector() call, but I 
found that it did not give my routine control before the DOS clock 
routine was called by the DPMI host (is that the program that handles 
this sort of thing?).  Since I had altered the PIC to generate interrupts 
100 times a second as opposed to ~18.2/second, the effects on the DOS 
clock were predictable :)

I have two questions:

1] How is a for-real hardware-generated interrupt handled?  A 
protected-mode interrupt?  A real-mode interrupt?

2] How do I go about intercepting hardware-generated interrupts in C, 
making sure that I get them before another program calls the DOS clock 
routine for me?

--
				Just another lamer in the soup,
				Lance Kalzus
				kalzus@[128.122.230.28]

- Raw text -


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