Mail Archives: djgpp/1994/05/11/16:19:25
> As I enter this, I realize that I don't know how to obtain a selector which
> points at a physical address outside the first MB. I suspect that there is a
> standard DPMI function call to do this, but is there a C routine which
> implements this call, and does go32 support this function? This question has
I believe that the DPMI function you want is 0x0800. I don't think
GO32 implements it, though, if a DPMI server does not already exist.
From the DPMI 0.9 specs (available as
ftp.cica.indiana.edu:/pub/pc/win3/misc/dpmi_txt.zip):
-------------------------------------------------------------------------------
16. PHYSICAL ADDRESS MAPPING
Memory mapped devices such as network adapters and displays
sometimes have memory mapped at physical addresses that lie
outside of the normal 1Mb of memory that is addressable in
real mode. Under many implementations of DPMI, all
addresses are linear addresses since they use the paging
mechanism of the 80386. This service can be used by device
drivers to convert a physical address into a linear address.
The linear address can then be used to access the device
memory.
Some implementations of DPMI may not support this call
because it could be used to circumvent system protection.
This call should only be used by programs that absolutely
require direct access to a memory mapped device.
To Call
AX = 0800h
BX:CX = Physical address of memory
SI:DI = Size of region to map in bytes
Returns
If function was successful:
Carry flag is clear.
BX:CX = Linear address that can be used to access the
physical memory
If function was not successful:
Carry flag is set.
Programmer's Notes
o Under DPMI implementations that do not use the
80386 paging mechanism, the function will always
succeed and the address returned will be equal to
the physical address parameter passed into this
function.
o It is up to the caller to build an appropriate
selector to access the memory.
o Do not use this service to access memory that is
mapped in the first megabyte of address space (the
real mode addressable region).
-------------------------------------------------------------------------------
The above is confusing, and I have no idea how it is used (there's
got to be a way of associating the resulting linear address with some
selector, but how?). Don't ask me any questions.
-- Darryl Okahata
Internet: darrylo AT sr DOT hp DOT com
DISCLAIMER: this message is the author's personal opinion and does not
constitute the support, opinion or policy of Hewlett-Packard or of the
little green men that have been following him all day.
- Raw text -