Date: Tue, 17 Nov 1998 11:12:51 +0200 (IST) From: Eli Zaretskii 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: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 #include #include #include __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.)