Message-ID: <3890E439.FD44975@connection.com> Date: Thu, 27 Jan 2000 19:35:07 -0500 From: sam X-Mailer: Mozilla 4.6 [en] (Win95; I) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: DMA access References: <001701bf690e$754e7d40$c71b15c8 AT telecomco DOT net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 216.13.21.123 X-Trace: 27 Jan 2000 19:34:20 -0500, 216.13.21.123 Lines: 41 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Julian Rolon wrote: > ----- Original Message ----- > From: Eli Zaretskii > To: Julian Rolon > Cc: > Sent: Thursday, January 27, 2000 11:13 AM > Subject: Re: DMA access > > > > > On Thu, 27 Jan 2000, Julian Rolon wrote: > > > > > faq states two methods for correct DMA accessig, one of these is = > > > allocate a buffer in conventional memory with DPMI function = > > > allocate_dos_memory but this function return a real mode segment between > = > > > 0000 and FFFF, How can i guarantee that segment returned falls into = > > > Conventional memory?? > > > > The function __dpmi_allocate_dos_memory, by its very definition, *always* > > allocates buffers in conventional memory. So you don't have to worry > > about that. (Only conventional memory buffers can have a real-mode > > segment, btw.) > > I am very confused cause function is returning segments like 1FC2 and i need > to pass physical address to a chip, so what is the physical addres of a > segment like this?? Also with DMA you can only use buffers that do not cross 64K boundary that is 1000, 2000 , 3000 and so on. So, in your example (1fc2) if there is only 3e paragraphs ( 16 bytes ) or 992 bytes before new 64K of physical memory begins. So if you need say 8 K buffer you must free the allocated block, add what's remaining in the old 64Ksegment (992 ) to what you intend to use (falling entirely in the next segment in this case 8192) and allocate a block with this new size. The pointer returned will be later used to free the memory but your buffer for use with DMA will be at 3000 or 3000:0. Good luck, and many happy reboots.