Mail Archives: djgpp/2000/01/27/19:31:59
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 -