|
Real Mode from Protected Mode: Accessing an RMode TSR from PMode
Author |
Message |
Daniel Brag #1 / 4
|
Real Mode from Protected Mode: Accessing an RMode TSR from PMode
We are having great difficulty with project that requires us to locate a real-mode TSR that intercepts the keyboard interrupt, and change one byte in that TSR's data segment allowing us to control the TSR. We have been successful in doing this if our test program is compiled in real mode, but the final product must be compiled in Protected mode. We have had no success in getting this to wotk with a PMode program. When we try to use the address from the INT #21 call, we point off to somewhere useless. We need some way to 1) interpret the Segment Descriptor we receive in a manner that is useful, 2) find a way to put a portion of our protected mode program into real mode, manage the TSR, then return to protected mode, or 3) find another answer. We are looking at using both Borland Pascal 7.0 and Turbo Assembler 3.2 linked together for our answer (but solutions not requiring TA 3.2 very welcome)! Help please! Daniel Bragg
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
|
nin.. #2 / 4
|
Real Mode from Protected Mode: Accessing an RMode TSR from PMode
On Thu, 27 Feb 1997 16:42:58 -0800, Daniel Bragg Quote:
>We are having great difficulty with project that requires us to locate a >real-mode TSR that intercepts the keyboard interrupt, and change one byte >in that TSR's data segment allowing us to control the TSR. We have been >successful in doing this if our test program is compiled in real mode, >but the final product must be compiled in Protected mode. We have had no >success in getting this to wotk with a PMode program. >When we try to use the address from the INT #21 call, we point off to >somewhere useless. We need some way to 1) interpret the Segment >Descriptor we receive in a manner that is useful, 2) find a way to put a >portion of our protected mode program into real mode, manage the TSR, >then return to protected mode, or 3) find another answer.
Two usefull functions here are: 1) GlobalDOSAlloc (int 31h, fn 0100h) and 2) Segment2Selector (int 31h, fn 0002h) Quote: >We are looking at using both Borland Pascal 7.0 and Turbo Assembler 3.2 >linked together for our answer (but solutions not requiring TA 3.2 very >welcome)! >Help please! >Daniel Bragg
******************************** * EB0A90486921203A290A0D24 * * BA0310B409CD21CD20 * ********************************
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
|
George Gonzale #3 / 4
|
Real Mode from Protected Mode: Accessing an RMode TSR from PMode
On Thu, 27 Feb 1997 11:25:56 GMT, Quote:
>On Thu, 27 Feb 1997 16:42:58 -0800, Daniel Bragg
>>We are having great difficulty with project that requires us to locate a >>real-mode TSR that intercepts the keyboard interrupt, and change one byte >>in that TSR's data segment allowing us to control the TSR. We have been >>successful in doing this if our test program is compiled in real mode, >>but the final product must be compiled in Protected mode. We have had no >>success in getting this to wotk with a PMode program.
The easiest way might be to have your TSR hook itself to an unused software INT and have it accept data though this INT. You can pass the control byte in a register. You can make INT calls in prot mode and the RTM code properly reflects it as a real-mode INT. If that is not the way you want to go, then you'll have to write some rather complex code to peek at memory to find your TSR and directly set the value. You'll need to use the DPMI calls to set up a descriptor. Not particularly easy but it can be done. -----------------------------------------------------------------------
Sr. Sys. Programmer University of Minnesota
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
|
Lars Indresaete #4 / 4
|
Real Mode from Protected Mode: Accessing an RMode TSR from PMode
Quote:
> We are having great difficulty with project that requires us to locate a > real-mode TSR that intercepts the keyboard interrupt, and change one byte > in that TSR's data segment allowing us to control the TSR. We have been > successful in doing this if our test program is compiled in real mode, > but the final product must be compiled in Protected mode. We have had no > success in getting this to wotk with a PMode program. > When we try to use the address from the INT #21 call, we point off to > somewhere useless. We need some way to 1) interpret the Segment > Descriptor we receive in a manner that is useful, 2) find a way to put a > portion of our protected mode program into real mode, manage the TSR, > then return to protected mode, or 3) find another answer. > We are looking at using both Borland Pascal 7.0 and Turbo Assembler 3.2 > linked together for our answer (but solutions not requiring TA 3.2 very > welcome)! > Help please! > Daniel Bragg
-- Give a smile...Get a smile :) ********************************** Lars Indresaeter
One of my classmates made a similar programm. He used GetIntVec and Keep to keep it resident.. You probably know allready that you need IntVec no. 9. If you intend to change the contenst of the prog. then you need an external file where you can write a status. And then use a IF statement.. Good luck.. Remember that in protected mode you have only base memory. So if you are going go use an external file exept from the TSR, stay within 0 - 640k... Hope it makes sense, and that it can be any help..
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
|
|