www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/02/28/02:04:01

Date: Mon, 27 Feb 1995 16:24:16 -0500 (EST)
From: Long Doan <ldoan1 AT osf1 DOT gmu DOT edu>
To: THE MASKED PROGRAMMER <badcoe AT bsa DOT bris DOT ac DOT uk>
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: One More Confused Interrupt Question

On Mon, 27 Feb 1995, THE MASKED PROGRAMMER wrote:

> 	To do this I have to master interrupts, so some (naive) questions:
> 
> (i) What is the difference between a Real Mode interrupt and a Protected Mode
>     interrupt.

  A real-mode interrupt is an interrupt that happens while the CPU is in 
real mode, a protected mode interrupt is an interrupt that happens while 
the CPU is in protectted mode.

> (ii) Why, when I use the example from the documentation (which hooks the clock
>      tick and uses it to increment a volatile int) does the int seem to
>      increase (a) erratically and (b) far more slowly that 18.3 times per
>      second.

  The reason might be:
  1. Only the protected mode interrupt handler is increasing the count, 
but you spend most of the time in real mode (or vise versa).
  2. You chain the protected mode handler to something that is not 
there, so the only time that the count is increased is when the real-mode 
interrupt happens. Note, this case will eventually lead to crashing the 
system.
  3. The computer gets mad with all the interrupt handlers, and decides 
to suspend some of them ...
 
> (iii) If I use the provided _go32_* functions do they put a lot of overhead
>       into the interrupt servicing ?

  The overhead is not much, if the timer is programmed to tick at a low 
clock rate. But if the timer is ticking fast, you can always bypass some 
safeguard that these functions provide (your interrupt handler is not 
likely to use up all registers, etc.) 

+--------------------------------------------------------+
| Long Doan                          ldoan1 AT osf1 DOT gmu DOT edu |
|                                          ld AT netrix DOT com |
+--------------------------------------------------------+


- Raw text -


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