*BSD News Article 71874


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.mira.net.au!news.mel.connect.com.au!munnari.OZ.AU!news.ecn.uoknor.edu!news.cis.okstate.edu!newsfeed.ksu.ksu.edu!news.physics.uiowa.edu!math.ohio-state.edu!howland.reston.ans.net!newsfeed.internetmci.com!pier2.bayarea.net!baygate.bayarea.net!thorpej
From: thorpej@baygate.bayarea.net (Jason R. Thorpe)
Newsgroups: comp.unix.bsd.freebsd.misc,comp.unix.bsd.netbsd.misc
Subject: Re: Curious about *BSD History
Date: 23 Jun 1996 21:55:28 GMT
Organization: Numerical Aerodynamic Simulation Project - NASA Ames
Lines: 57
Message-ID: <4qkegg$9as@pier2.bayarea.net>
References: <4k1nue$lm8@orb.direct.ca> <4kl863$rno@news.rhrz.uni-bonn.de> <1996Apr12.210743.28292@wavehh.hanse.de> <317006C4.77C0450E@lambert.org>
NNTP-Posting-Host: baygate.bayarea.net
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:22030 comp.unix.bsd.netbsd.misc:3833

In article <317006C4.77C0450E@lambert.org>,
Terry Lambert  <terry@lambert.org> wrote:
>Martin Cracauer wrote:

>I am more than passingly familiar with the 21066 Alpha boxes.

My 21066 machine isn't due to arrive until Tuesday, but I have
hacked NetBSD on 21064 (DEC 3000/400) and 21164 (AlphaStation 600 5/266
and AlphaServer 8200 5/300) systems.  The 600 has multiple PCI, EISA,
and ISA busses.  The 8200 has multiple _primary_ PCI busses (attached
to a KFTHA or KFTIA i/o "hoses" behind the TurboLaser backplane), each
with multiple secondary PCI and EISA busses behind bridges (it's
awe-inspiring to have what amounts to a rack fill of NCR53c825 cards
looking at you :-).

>Why do you think DMA transfers *always* require bounce buffers?
>
>How could you allocate such buffers from main memory, if no area
>of main memory could be safely targeted in a DMA transfer?
>
>Alpha needs bounce buffers for > 16M of memory -- but only in
>that case.
>
>Like Amiga needs bounce buffers for "device accessable" vs.
>"device inaccessable" ("fast") RAM.

Actually, it's more of a "bounce buffer-like" scheme that the Alpha needs.
This is because, unlike the i386, the ISA's view of system memory
can is radically different from the CPU's view of system memory.

So, really, NetBSD won't be getting "bounce buffers", per se, but rather
a "machine independent ISA DMA solution", which will have a bounce buffer
effect for machines that require such a scheme.

This is actually the symptom of a larger problem with MI bus code
and device drivers.  Most PCI drivers are written on the i386, and
hence driver writers tend to use things like kvtop() or vtophys()
to point bus-mastering cards (like the DEC Tulip, for example) at
their memory space.  NetBSD/alpha currently has an evil little
hack to get around this problem, but real DMA mapping functions need
to be designed and written; can't survive on little hacks forever.

Other problems arise when dealing with cards like the Matrox frame-grabber,
which wants a chunk of several physically contiguous pages.  FreeBSD
has a VM routine (contig_alloc() I think?) that deals with this.
However, systems like the Alpha can do the scatter/gather in hardware,
transparently to the card that wants the contiguous space (like DVMA
on the Sun 4).  Thus, a VM trick isn't needed.  This sort of routine
also needs to be implemented in bus DMA mapping routines.

Anyhow, hope this clarifies the NetBSD bounce-buffer issue a little.

-- 
Jason R. Thorpe                                       thorpej@nas.nasa.gov
NASA Ames Research Center                               Home: 408.866.1912
NAS: M/S 258-6                                          Work: 415.604.0935
Moffett Field, CA 94035                                Pager: 415.428.6939