Mail Archives: djgpp/1998/11/21/17:55:18
Hi
here is a problem I don't know how to solve with djgpp.
I've got some memory areas (which are 4096-aligned) that I
would like to switch together. In order to make that quickly
I thought of using the paging facilities of the 386 in order
to map these memory areas over another slice of memory, so I can
just change of few physical addresses to swap some blocks.
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.
I've tried with __dpmi_physical_mapping and __djgpp_map_physical_memory,
but both failed. The problem is that I don't have a good knowledge of
protected mode and dpmi (and the dpmi doc on dj delorie's www isn't very
easy to understand), and I'm not sure where the problem comes from :
- CWSDPMI maybe doesn't allow it (I've tried under plain dos) ;
I've tried with CSWDPR0 once and it didn't work either
- 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 ?
that would explain the 256 MB limit) as well as to use the address by itself
- I don't give a valid mapping address (_mapped_ram in the example above) ;
I've tried numbers under 0x10000000 as well as very high numbers (0x80000000)
- another problem I don't know of ?
Please, could someone help me ? please reply by e-mail
Thanks
Antoine Pitrou.
- Raw text -