ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/02/14/09:51:54

Date: Tue, 14 Feb 1995 09:39:06 -0500
To: djgpp AT sun DOT soe DOT clarkson DOT edu
From: cburke AT mitre DOT org (Carl D. Burke)
Subject: Re: Keyboard int 9

>It should be possible to trap hardware interrupts using the functions
>in <dpmi.h>; some of the samples/dpmi sources do similar things.  Be
>aware that there are some issues with handling hardware interrupts
>without being able to lock down your pages; the system may
>occasionally hang.

Aside from the possibility of hanging the system, you can hook int 9
just fine.  The below may not be exact; I don't have my keyboard handler
code with me (but I can pass it on tomorrow 15 Feb 95 if you want it).
1) hook protected mode interrupt:
   - save off old vector
   - allocate an IRET wrapper
   - set protected mode interrupt vector
2) hook real mode interrupt
   - save off old vector
   - allocate a real mode callback w/iret return
   - set real mode interrupt vector.
3) restore old vectors when leaving program

The info files have the actual routine calls described.  Remember to set
the selector field w/_go32_my_cs() in addition to setting the offset field,
or the results can be flaky.

Carl Burke
cburke AT mitre DOT org



- Raw text -


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