delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/11/17/04:12:48

Date: Tue, 17 Nov 1998 11:12:51 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: jjed AT hotmail DOT com
cc: djgpp AT delorie DOT com
Subject: Re: Virtual DMA services
In-Reply-To: <72qa9l$ak0$1@nnrp1.dejanews.com>
Message-ID: <Pine.SUN.3.91.981117111231.14078P-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Mon, 16 Nov 1998 jjed AT hotmail DOT com wrote:

> Lock/Unlock DMA buffer (INT 4B, function 8103H and 8104H) take a pointer to a
> DDS structure in ES:DI.
> 
> Shall I put _dpmi_my_ds() in ES and DDS linear offset in EDI and then call
> _dpmi_int (as I would expect in 32 bit protected mode)?

Of course not!  VDS expects a real-mode address in ES:DI.  So you must
copy the DDS into the transfer buffer, and then put the segment:offset
of the transfer buffer into ES:DI, like this:

      #include <dpmi.h>
      #include <go32.h>
      #include <sys/types.h>
      #include <sys/movedta.h>

	__dpmi_regs r;
	unsigned char *dds_buf;
	.
	.
	.
	dosmemput (dds_buf, dds_length, __tb);
	r.x.es = __tb >> 4;
	r.x.di = 0;  /* the transfer buffer is paragraph-aligned */

Note that this is explained in section 18.2 of the DJGPP FAQ list.
(That section doesn't deal with DMA, but your question is not specific
to DMA, it has to do with the way to pass buffers to real-mode
services.)

- Raw text -


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