www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/01/09:39:52

Newsgroups: comp.os.msdos.djgpp
From: rd5718 AT irix DOT bris DOT ac DOT uk (Rich Dawe)
Subject: Protected mode ints & the FAQ (for Eli Z)
X-Nntp-Posting-Host: irix.bris.ac.uk
Message-ID: <F3AFtG.M74@fsa.bris.ac.uk>
Lines: 35
Sender: usenet AT fsa DOT bris DOT ac DOT uk (Usenet)
Organization: University of Bristol, England
X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
Date: Tue, 1 Dec 1998 13:22:28 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hello.

	I have found the info in the FAQ very helpful and well written,
especially with hardware issues, but I think there may be a mistake in it.

	I've been to trying to chain a function to the timer interrupt,
INT 0x1C, in protected mode. The FAQ says the following steps are needed:

1. Call _go32_dpmi_get_protected_mode_interrupt() to store the original
   interrupt vector.

2. Call _go32_dpmi_chain_protected_mode_interrupt() with a go32_seginfo
   structure pointing to your function. This function then gets wrapped
   with some code to chain to the old handler.

3. Call _go32_dpmi_set_protected_mode_interrupt() with the go32_seginfo
   structure you used in 2.

I think 2 implies that the go32_seginfo structure gets modified to point
to the wrapper function.

	However, using these three steps results in a protection fault.
The solution is not to use step 3, since the code then works fine - the
function gets called, etc. This appears to work, because
_go32_dpmi_chain_<blah>() calls the _go32_dpmi_set_<blah>() function for
you (as can be seen by looking at the library source, lsr201.zip).

	If this is incorrect, please correct me, as this is the first time
I've tried hooking interrupts.

-- 
==============================================================================
         Rich Dawe - 4th-year MSci Physicist @ Bristol University, UK
           richdawe AT bigfoot DOT com, http://www.bigfoot.com/~richdawe/
==============================================================================

- Raw text -


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