Mail Archives: djgpp/1997/08/02/21:16:56
Lo Alexander von Luenen <luenen AT informatik DOT uni-bonn DOT de>:
From the Symantec RTL docs:
-----------------------8<----------------------
_x386_map_physical_address
--------------------------
Prototype
void *_x386_map_physical_address(void *abs_addr,
unsigned size);
Description
This function maps specific physical addresses. The abs_addr argument
specifies the start address of the physical memory to map. The size
argument indicates the size of the region, in bytes. The function is
implemented for the X memory model only.
Typically, you use this function to access memory mapped I/O devices.
The region to be mapped must be completely above or completely below
the 1MB boundary; it cannot lap over the boundary itself. The function
will fail and return -1 if memory is insufficient or if the DPMI host
refuses service. X-32 must allocate a minimum of 4 KB for each
_x386_map_physical_address call.
Return Value
A near pointer that can be used to access the actual physical address
requested. The device will not be accessible at the actual physical
address; it will appear to be at the address returned by this
function.
Compatibility
Phar Lap, DOSX
----------------------->8----------------------
Search the DJGPP docs for __dpmi_physical_address_mapping().
> ushort AMem::MallocLow(ushort size)
> {
> union REGS regs;
> regs.h.ah=0x48;
> regs.x.bx=(size+15)>>4;
> int86_real(0x21, ®s, ®s);
> return (regs.x.ax);
> }
int86_real() sends an interrupt to DOS, it doesn't go through the
interrupt handlers of the DOS extender. DJGPP:
__dpmi_simulate_real_mode_interrupt()
Bye.
+- Conceived through intercalation and juxtaposition -+
| systems programmer / word player avant la lettre |
| proteus * worldaccess + nl |
+-----------------------------------------------------+
- Raw text -