🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Help: Software Interrupts in Protected Mode?

#303
From: Peter Haller
Date: Sat, 11 Apr 1992 12:22
47 lines
2888 bytes
In a previous article, klaus@knipp.en.open.de (Klaus Malorny) says:

>
>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
>
I would suggest you get the DPMI specs (1.0) from Intel. They are free. Also
get your hands on a copy of "Writing Windows Device Drivers" by Daniel Norton.
This book covers much of the Protected Mode interface to DOS and the Virtual
Machine handling of interrupts.

PCH
-- 
Peter C. Haller				|	'If you do what you 
Imagination Processing Systems		|	have always done,
aa596@cleveland.Freenet.Edu 		|	expect what you have
"Are we having fun yet?"		|	always recieved.'
Technical Details
Message-ID: <1992Apr11.122238.24418@usenet.ins.cwru.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!cleveland.Freenet.Edu!aa596
References: <1992Apr10.165124.14438@knipp.en.open.de>

Show Full Headers
Complete Article Headers
Newsgroups: comp.windows.ms.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!cleveland.Freenet.Edu!aa596
From: aa596@cleveland.Freenet.Edu (Peter Haller)
Subject: Re: Help: Software Interrupts in Protected Mode?
Message-ID: <1992Apr11.122238.24418@usenet.ins.cwru.edu>
Sender: news@usenet.ins.cwru.edu
Nntp-Posting-Host: cwns6.ins.cwru.edu
Reply-To: aa596@cleveland.Freenet.Edu (Peter Haller)
Organization: Case Western Reserve University, Cleveland, OH (USA)
References: <1992Apr10.165124.14438@knipp.en.open.de>  
Date: Sat, 11 Apr 92 12:22:38 GMT
Lines:       48