DOS/32 Advanced DOS Extender - Programmer's Reference

2.43 - DPMI function 0800h - Physical Address Mapping

Converts a physical address into a linear address. This function allows device drivers running under DPMI hosts which use paging to reach physical memory that is associated with their devices above the 1 MB boundary. Examples of such devices are the Weitek numeric coprocessor (usually mapped at 3 GB), buffers that hold scanner bitmaps, and high-end displays that can be configured to make display memory appear in extended memory.


In: AX = 0800h
BX:CX = physical address of memory
SI:DI = size of region to map (bytes)

if successful:
CF clear
BX:CX = linear address that can be used to access the physical memory

if failed:
CF set
AX = error code

8003h - system integrity (DPMI host memory region)
8021h - invalid value (address is below 1 MB boundary)


a) It is the caller's responsibility to allocate and initialize a descriptor for access to the memory.

b) This function should only be used by clients that absolutely require direct access to a memory mapped device at physical addresses above 1 MB. Clients should not use this function to access memory below the 1 MB boundary (the real mode addressable region). See also DPMI functions 0002h.

c) When this function is called, the DPMI host either creates page table entries that directly map the physical addresses requested and returns the linear address of the created page table entries, or else just returns the linear address of the memory region that is already used to map the requested device. For example, if the client attempts to map a Weitek coprocessor and the host already has a linear region set up to map the Weitek chip and virtualize it, it would simply return the linear address of the existing region. If the host does not virtualize the Weitek chip, it would create 16 page table entries that map the 64 KB Weitek address space and return a linear address corresponding to the new page table entries.

d) If the host is not virtualizing the device, it will disable any memory caching on the mapped pages; in particular, on the 80486+ the host will set the PCD (page cache disable) bit in the page table entries.

e) Programs and device drivers which need to perform DMA I/O to physical addresses in a virtualized hardware environment should use the Virtual DMA Services.


Copyright Supernar Systems, Ltd. 1996-2005
All Rights Reserved.