Mail Archives: djgpp/2007/09/24/16:15:05
"Gerrit van Niekerk" <gerritvn AT gpvno DOT co DOT za> wrote in message
news:46F82772 DOT 52 DOT 2124586E AT gerritvn DOT gpvno DOT co DOT za...
> Have you actually done DMA programming using DJGPP and PMODEDJ ?
>
No, I've not done any DMA programming with DJGPP. That was why I posted the
"?" - meaning I didn't have an answer to the rest of your original
questions.
> Do you have any more pointers, warnings and/or gotchas if I simply
> malloc() a memory buffer and calculate the physical address by adding
> base from __dpmi_get_segment_base_address(_my_ds(),&base) to it ?
1) subtract base
2) if you're getting DPMI crashes, you might want to try increasing the
segment limit (0x0009FFFF or so) by one method:
a) __dpmi_set_segment_limit(_my_ds(),0xFFFFFFFF)
b) __djgpp_nearptr_enable()
3) you might want to try __dpmi_allocate_memory() instead of malloc()
4) if you're using CWSDPMI or CWSDPR0 instead of PMODEDJ, you'll need to
a) call __dpmi_physical_address_mapping()
b) be aware that 0-1Mb is already physically mapped, so you'll need to map
1Mb to xxMb.
c) my experience with CWSDPMI v5 indicates it can't physically map more
that 128Mb
d) IIRC, no errors were given for failures with b) and c)
e) you might want to try CWSDPMI v6 for a larger page size, and perhaps
more physically mapped memory...
5) there is a small (64k or less) amount of memory pre-allocated below 1Mb
called a transfer buffer which you might be able to use instead of
allocating DOS memory by DPMI. Look into __tb, __tb_segment,__tb_offset.
Rod Pemberton
- Raw text -