Mail Archives: djgpp/2005/11/28/21:15:09
<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 -