Sender: nate AT cartsys DOT com Message-ID: <362909EE.70AA4AB5@cartsys.com> Date: Sat, 17 Oct 1998 14:19:42 -0700 From: Nate Eldredge X-Mailer: Mozilla 4.05 [en] (X11; I; Linux 2.0.35 i486) MIME-Version: 1.0 To: djgpp AT delorie DOT com, geti AT mcis DOT de Subject: Re: UDMA <-> getting physical address of an array ? References: <36287AC1 DOT 743A9501 AT mcis DOT de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com Gero Timann wrote: > > Hi Toni ! > > Thanks for your reply. > > I try to write real-time-software for pentiums and above (clock > greater 200MHz needed for active sound control) and therefore have no > interrest in old machines (the software wouldn't run there anymore, not > enough performance). Here i've only to distinguish between some > cpu-support-chips, like VXpro, Intels HX,TX,BX, Intels 82378 > compatible... . All these Chips allow DMA for the low 16MB, without > 64k-boundaries. Take a look at INTELs peripherical guide. There is a > standard, i think, upper page-regs at 0x487..... Therefore no interest > in compatiblity to old 82C37s ! When needed, i can use the fcts from > allegro-source (do you know the author ?). > > Another point is, that there is no time to use dosmemget. Takes about > 100mikroseconds only for the skelett. This is already the time i can > use between two samples ! No more operations possible ! > Last night i've experimented with the farpoke-family (i've learned this > from a DJGPP vbe-programing-example-program). These seams the real > answer to my question. Measures with the time-stamp-counter shows, that > they use only about 100 nano seconds for reading one value. Much, > better. But if i know the real physical adress from an array, let a[], i > can fill this direct by DMA. Looks much simpler. Is this cs:? > > Sorry about my silly questions. But, i'm a DJGPP- and DPMI-newbe. > Therefore all these things looks not as simple for me as for you. > Let me know better ways, please. The problem is that there isn't really a good, widely supported way to find the physical address of a memory block. With DPMI, a virtual block can be spread all over physical memory, due to the paging mechanisms. The best solution is called VDMA or something similar, but it's only supported by a few commercial DPMI servers. Thus, the usual solution is to use a piece of conventional (DOS) memory, which is always physically located at the low 1MB of memory; i.e. exactly where you expect. To access this block, you can use `dosmemget/put' (if moving large blocks around is what you need), or the `_far*' family. `_farns*' will give you the most speed if you put it in a tight loop. See FAQ section 18.4. Alternatively, there's the nearptr hack (FAQ section 18.6), which will allow you to act as if the DOS memory block was just another array of your program, but has the disadvantage of effectively crippling memory protection, making the entire system much more vulnerable to your program's bugs. -- Nate Eldredge nate AT cartsys DOT com