delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2005/11/28/21:15:09

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: "Rod Pemberton" <dont_have AT bitbucket DOT cmm>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: code from BC31(16bits) to DJGPP(32 bits)
Date: Mon, 28 Nov 2005 21:01:47 -0500
Organization: Aioe.org NNTP Server
Lines: 48
Message-ID: <dmgcpm$u34$1@domitilla.aioe.org>
References: <1133146328 DOT 335307 DOT 54810 AT g44g2000cwa DOT googlegroups DOT com> <dmf6p4$kke$1 AT domitilla DOT aioe DOT org> <1133226276 DOT 234728 DOT 136880 AT f14g2000cwb DOT googlegroups DOT com>
NNTP-Posting-Host: pCFjXAYAthfOLF6YhIh1ZA.user.domitilla.aioe.org
X-Complaints-To: abuse AT aioe DOT org
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
X-Priority: 3
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MSMail-Priority: Normal
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

<blk5743 AT yahoo DOT com DOT tw> wrote in message
news:1133226276 DOT 234728 DOT 136880 AT f14g2000cwb DOT googlegroups DOT com...
> sorry, one more question
>
> i want to use DMA transfer with CD-ROM and Host
> i must prepare a PRD to use.
> i have a buffer and PRD structure
> how can i assign my buf to PRD structure
> (i do not know the really physical address of buf)
>
> BYTE  buf[0x10000];
> void AssignValue(void)
> {
>     PRD_EDDS.Size = size;
>     PRD_EDDS.Seg = _my_ds();   ?????
>     PRD_EDDS.Offset = (DWORD)buf; ?????
>     PRD_EDDS.NumberAvail = Regions;
> }
>
> Thanks
>

You'll have to give me some more information.  I'm not familiar with DMA.
How does the 'buf' get created?  How does 'buf' get accessed?Do you have a
RM address for 'buf'?  PM address? a memory handle?  How does DMA know where
the 'buf' is located?

If you have either a RM or PM address, you can use dosmemput/get.  If you
have a memory handle, it must be converted to a RM or PM address.  You'll
need to get an address for 'buf' to access it, whether in C or assembly,
except if it is accessible through a CPU I/O port.  If it's on a port, you
can use inp/inport/inportb outp/outportb etc...


If I get a chance, I'll brush up on DMA.  But, you might check out these CD
links, the code compiles with DJGPP:

Chris Giese's CDPLAY http://my.execpc.com/CE/AC/geezer/software/cdplay.c
http://my.execpc.com/CE/AC/geezer/software

Jeremy Davis' ATAPICDD http://www.darklogic.org/fdos/projects/



Rod Pemberton


- Raw text -


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