Newsgroups: comp.os.msdos.djgpp From: Peter Berdeklis Subject: Re: Interrupts (Hardware) Message-ID: Nntp-Posting-Host: chinook.physics.utoronto.ca Sender: news AT info DOT physics DOT utoronto DOT ca (System Administrator) Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Organization: University of Toronto - Dept. of Physics In-Reply-To: Date: Mon, 7 Apr 1997 18:45:10 GMT References: 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