Mail Archives: djgpp/2003/04/30/15:46:58
"Markus Meng" <meng DOT engineering AT bluewin DOT ch> said:
> However the application crashes as soon as some of the memory location
> 0x000D0000...0x000D0000 are being accessed.
You cannot access that mem-area directly as if it's part of you
address space (it's not). That only works with DOS4GW types
extenders where DOS-memory is mapped to application data
area.
But djgpp has near-ptr feature if you prefer to avoid using the
'far' functions. Enable it (read the docs on how), then access
the area like so:
memcpy (dest, (const void*)(0x000D0000 + __djgpp_conventional_base), length)
But it pretty simple using the <sys/farptr.h> functions instead:
dosmemget (0xD0000, dest, length);
The speed advantage of using near-ptr access (memcpy) is neglible
cause dosmemget() is pretty smart in moving those bytes. Even
faster than _dosmemgetl() even when src/dest are DWORD aligned.
--gv
- Raw text -