🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #302

Help: Software Interrupts in Protected Mode?

#302
From: Klaus Malorny
Date: Fri, 10 Apr 1992 16:51
32 lines
1999 bytes
Hi,

I'm currently writing an application with MSC & Windows SDK that communicates
with a TSR-based hardware driver. The TSR writes its data in a shared memory
provided by my application via "GlobalDOSAlloc". To perform functions provided
by TSR one have to use a certain software interrupt. I did this by using the
library function "int86" and for that case it works well. 
But some of the functions of the TSR expect an address to the shared memory
with the segment part of the address in the "es" register. My attempt
was to use the "int86x" function with the "es" register set to the real
mode segment address of the shared memory (as the TSR is executed in real
mode). The result was an UAE, as the library function "int86x" (still running
in protected mode) tries to setup the "es" register with a segment address.
When using a valid selector in the "es" register, the TSR is called, but with
modified contents of the "es" register.

Well, I do know that things are complicated in proctected mode, but I thought
it would work because the int86 functions are still available in dos.h (in
contrast to e.g. _dos_setvect, which is "removed" by #ifndef _WINDOWS etc.).
Maybe I misused a facility provided to process hardware interrupts ? ;-)

MY QUESTION IS: is there an *easy* way to call a software interrupt of a TSR
                by a protected mode Windows application (with the ability to
                set all registers (execpt ss,sp,cs,ip of course!:-)) ???

Perhaps DPMI does the job, but as the documentation of Windows SDK doesn't
contain anything about it, I am rather unfamiliar with it. 

Thanks in advance

   Klaus
Technical Details
Message-ID: <1992Apr10.165124.14438@knipp.en.open.de>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!unido!horga!ruhr.de!reswi!knipp!klaus

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!unido!horga!ruhr.de!reswi!knipp!klaus
From: klaus@knipp.en.open.de (Klaus Malorny)
Newsgroups: comp.windows.ms.programmer
Subject: Help: Software Interrupts in Protected Mode?
Message-ID: <1992Apr10.165124.14438@knipp.en.open.de>
Date: 10 Apr 92 16:51:24 GMT
Organization: Private/FRG
Lines: 33