Mail Archives: djgpp/1998/11/22/09:01:11
On Sat, 21 Nov 1998, Antoine Pitrou wrote:
> For example, I've got a 16384-byte array named _ram (4096-aligned),
> and I want to map the 4 pages contained in that array to another
> address named _mapped_ram, so that _mapped_ram contains in order
> page 2, 3, 1 and 0 of _ram.
You will need to access the page directories for that, and most DPMI
servers won't let you do that. Sorry.
FWIW, I don't understand why do you even need a thing like that. Are
you trying to write `mmap', or use memory-mapped files?
> I've tried with __dpmi_physical_mapping and __djgpp_map_physical_memory,
> but both failed.
These functions are for mapping physical memory, not for remapping
logical memory.
> - I don't give the right physical address of the area to map (_ram in
> the example above) ; I've tried to add __djgpp_base_address (which strangely
> equals to 0x10000000, are the addresses below used by CWSDPMI for
> virtual memory ?
__djgpp_base_address is not a physical address at all! It's a logical
address, after mapping by the CPU's memory-mapping hardware.
There's no simple way to get a physical address in a protected-mode
environment, for the same reason you cannot easily access the page
directories: that's what protected mode is all about!
- Raw text -