Mail Archives: djgpp/2017/08/18/08:00:09
On Fri, 18 Aug 2017 03:50:50 -0700 (PDT)
RayeR <glaux AT centrum DOT cz> wrote:
> I need to do one IDE busmaster DMA tranfer. For this purpose I need a
> 512+8B buffer in physical memory - I have to fill bussmaster PDRT IO
> register with physical address of buffer where I put PDR entry and
> data. So it seems to me the easiest way is to use __tb, where I can
> copy my structures and data via dosmemput and then start DMA transfer
> by writting to IO registers.
You should be able to use dosmemput to write to any low memory buffer.
> But I don't know how long my data in
> transferbuffer? Is it shared for some DJGPP functions like if I do a
> printf or anything calling a DOS it may get overwritten? Or should I
> rather allocate dos memory block separately?
...
> The DMA buffer must fulfil 2 conditions:
> 1) phys. address must be word aligned - probably OK, AFAIK dosmem is
> allocated in paragraphs 2) buffer cannot cross over 64kB boudary,
> e.g. FFF0h + size 512B is wrong, FE00h + size 512B is OK. Should I
> care about 2nd condition myself?
Using DMA w/DJGPP
http://www.delorie.com/djgpp/v2faq/faq18_13.html
Some FAQ excerpts:
"[For DMA,] You can allocate a buffer in conventional memory using the
library function __dpmi_allocate_dos_memory."
http://www.delorie.com/djgpp/v2faq/faq18_13.html
"[The transfer] buffer is used for all DOS/BIOS services supported by
DJGPP, it resides in conventional memory, and is allocated by the
startup code."
http://www.delorie.com/djgpp/v2faq/faq18_2.html
"... the size of transfer buffer used by DJGPP (at least 2KB, 16KB by
default), ..."
http://www.delorie.com/djgpp/v2faq/faq18_2.html
"The size of the transfer buffer is customizable up to a maximum of 64
KB ..."
http://www.delorie.com/djgpp/v2faq/faq14_4.html
"If the size of the transfer buffer isn't enough, you will have to
allocate your own buffer in conventional memory with a call to the
__dpmi_allocate_dos_memory library function."
http://www.delorie.com/djgpp/v2faq/faq18_2.html
Rod Pemberton
--
Isn't anti-hate just hate by another name? Isn't
anti-protesting just protesting by another name?
Peace is a choice that both sides rejected.
- Raw text -