X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Rod Pemberton Newsgroups: comp.os.msdos.djgpp Subject: Re: Can I use transferbuffer temporarly a for short DMA transfer? Date: Fri, 18 Aug 2017 07:48:58 -0400 Organization: Aioe.org NNTP Server Lines: 60 Message-ID: References: NNTP-Posting-Host: ZTD62cW/Uw8bymX5ok+0NA.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Complaints-To: abuse AT aioe DOT org X-Notice: Filtered by postfilter v. 0.8.2 Bytes: 3045 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Fri, 18 Aug 2017 03:50:50 -0700 (PDT) RayeR 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.