delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/08/04:15:40

Newsgroups: comp.os.msdos.djgpp
From: Peter Berdeklis <peter AT atmosp DOT physics DOT utoronto DOT ca>
Subject: Re: Interrupts (Hardware)
Message-ID: <Pine.SGI.3.91.970407142951.17332A-100000@atmosp.physics.utoronto.ca>
Nntp-Posting-Host: chinook.physics.utoronto.ca
Sender: news AT info DOT physics DOT utoronto DOT ca (System Administrator)
Mime-Version: 1.0
Organization: University of Toronto - Dept. of Physics
In-Reply-To: <Pine.SUN.3.95.970406144445.11066A-100000@rainbow>
Date: Mon, 7 Apr 1997 18:45:10 GMT
References: <Pine DOT SUN DOT 3 DOT 95 DOT 970406144445 DOT 11066A-100000 AT rainbow>
Lines: 24
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hardware interrupts captured in protected mode are handled in protected
mode.  Hardware interrupts captured in real mode are handled in real mode. 
In order to deal with all interrupts the DPMI server installs a real mode
hardware interrupt for every pmode int installed.  The handler code that
is called switches to protected mode and calls the appropriate handler. 
Therefore, for most applications, installing a pmode handler is
sufficient. 

If you have a high interrupt frequency the time for the protected mode 
switch may be too costly.  In that case you need to install a second, 
real mode handler to deal with the interrupt, when the machine is in real 
mode, without a mode switch.  Installing the real mode handler involves 
allocating DOS memory for it, copying the rmode handler into the 
allocated memory, and installing the real mode interrupt to point to the 
handler (there's a DPMI func for this).  Uninstalling the handler means 
reversing these steps.  Unnecessary complication - avoid it if possible.

By the way, all this is described in greater detail in the FAQ.

---------------
Peter Berdeklis
Dept. of Physics, Univ. of Toronto

- Raw text -


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