Xref: news2.mv.net comp.os.msdos.djgpp:5555 From: Charles Sandmann Newsgroups: comp.os.msdos.djgpp Subject: Re: Help please! protected mode "TSR"'s Date: Sun, 30 Jun 1996 23:04:10 CDT Organization: Rice University, Houston, Texas Lines: 19 Message-ID: <31d74e3a.sandmann@clio.rice.edu> References: <31D6CE63 DOT 353587C0 AT beattie DOT demon DOT co DOT uk> Reply-To: sandmann AT clio DOT rice DOT edu NNTP-Posting-Host: clio.rice.edu To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp > Basically I want to write a program that traps a HW interrupt while a > DPMI32 program is running. Two ways. 1) Write your trap program which grabs the HW interrupts, then have it system/spawn the program you want to watch. Nice, simple, and easy to unload. This is similar to the way the debuggers do it - they hook Int 31 and watch what the child asks DPMI to do for them. See dbgcom.c for details on the hooking. 2) Write a DJGPP TSR. This can be done with CWSDPMI and the tools you already have. Basically you hook whatever HW/SW ints you want, then you call the simulate interrupt call with the dos TSR call (the amount of memory to keep should be just the PSP plus whatever amount of transfer buffer you might need (usually zero, since you can use the last 128 bytes of the psp as a mini real mode buffer, if needed). You can't unload it, and you have to put up with the entire CWSDPMI footprint always resident. This may also work under other DPMI providers but I haven't tested it. I did test TSRs with CWSDPMI.