delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/27/19:31:59

Message-ID: <3890E439.FD44975@connection.com>
Date: Thu, 27 Jan 2000 19:35:07 -0500
From: sam <samirw AT connection DOT com>
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: <Pine DOT SUN DOT 3 DOT 91 DOT 1000127191152 DOT 19181C-100000 AT is> <001701bf690e$754e7d40$c71b15c8 AT telecomco DOT net>
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 <eliz AT is DOT elta DOT co DOT il>
> To: Julian Rolon <jrolon AT alpha DOT telecom-co DOT net>
> Cc: <djgpp AT delorie DOT com>
> 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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019