🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Tsr problems

#3059
From: Norbert Unterberg
Date: Mon, 03 Jun 1991 18:30
52 lines
3060 bytes
 > If anyone can answer the following questions or provide any information
 > on this topic at all please send us a message.
 >
 > 1)      Is it possible to get the physical location of a piece
 >         of GlobalAlloc'ed memory in standard or enhanced mode?

Yes. But this won't help you much, because Windows allocates the global memory 
from an area above 1 MB. So the linear address will be a number > 100000h and 
is not accessible from your real mode TSR.

 > 2)      Does GlobalDosAlloc work in standard or enhanced mode and how?

This function is specially designed for protected mode applications. However, 
it also works in real mode. It allocates memory below the 1 MB `fence' and 
returns both the _segement address_ and the _selector_ of that memory. Use the 
selector in your windows application, and pass the segment address for the TSR. 
So for Windows the memory beginns at the address LOWORD(return value):0, the 
TSR will sees the same memory at HIWORD(return value):0

 > 3)      Is there a bug in this GlobalDosAlloc function ?

I don't know, why do you think?

 > 4)      Where is a safe area of memory to block out and how can
 >         we create a selector to point to it?

Don't do it that way. Use the GlobalDosAlloc or some DPMI functions for that, 
but do not try to work around Windows' memory management. To create a selector 
from a segement address, the DPMI provides the neccesary functions.

 > 5)      What is DPMI and where can we get more information on it?

DPMI is the `Dos Protected Mode Interface'. It ia a specification/programming 
interface for protected mode programs and dos extenders, which provides an 
interface between protected mode programs and real mode (dos) applications, and 
is implemented in Windows 3.0 enhanced mode. It provides function calls from 
Local Descriptor Table management (allocate/free selector, get segment base 
address etc.) up to interrupt services and communication with TSRs (simulate 
real mode interrupt, call real mode procedure with far return/iret frame etc.). 
If you are doing `low level things', hardware interrupts, memory mapped i/o, 
you need the DPMI. A free(!) copy of the specification is available at Intel. 
Contact Intel in Australia(?) and ask for a copy. The Intel Order Number is 
240736-001.

 > 6)      Any suggestions on how we can solve this problem?

DPMI. See above.

Hope I could help,

Norbert
Technical Details
Message-ID: <1637046833@p4.f36.n245.z2.fidonet.org>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!unido!rwthinf!slcdec!hippo!f1.n6000.z2.fidonet.org!p4.f36.n245.z2.fidonet.org!Norbert_Unterberg

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!unido!rwthinf!slcdec!hippo!f1.n6000.z2.fidonet.org!p4.f36.n245.z2.fidonet.org!Norbert_Unterberg
From: Norbert_Unterberg@p4.f36.n245.z2.fidonet.org (Norbert Unterberg)
Newsgroups: comp.windows.ms.programmer
Subject: Tsr problems
Message-ID: <1637046833@p4.f36.n245.z2.fidonet.org>
Date: 3 Jun 91 18:30:00 GMT
Reply-To: Norbert_Unterberg%p4.f36.n245.z2@hippo.dfv.rwth-aachen.de (Norbert Unterberg)
Organization: Point of SoftStream, Dortmund, Germany
Lines: 53
Comment-To: John_Morey@f1.n6000.z2.fidonet.org (John Morey)