*BSD News Article 83303


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!howland.erols.net!news.mathworks.com!EU.net!usenet2.news.uk.psi.net!uknet!usenet1.news.uk.psi.net!uknet!dispatch.news.demon.net!demon!awfulhak.demon.co.uk!awfulhak.demon.co.uk!awfulhak.demon.co.uk!not-for-mail
From: brian@anorak.coverform.lan (Brian Somers)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: DMA
Date: 20 Nov 1996 21:32:22 -0000
Organization: Coverform Ltd.
Lines: 32
Sender: brian@awfulhak.demon.co.uk
Message-ID: <56vtd6$1mo@anorak.coverform.lan>
References: <328C8861.48A3@mercurio.uc.pt> <56mjnr$b4a@uriah.heep.sax.de>
    <329083AC.7048@mercurio.uc.pt>
Reply-To: brian%anorak.coverform.lan@awfulhak.demon.co.uk
NNTP-Posting-Host: localhost.coverform.lan
X-NNTP-Posting-Host: awfulhak.demon.co.uk
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Newsreader: knews 0.9.8

In article <329083AC.7048@mercurio.uc.pt>,
	Filipe Araujo <filipius@mercurio.uc.pt> writes:
: 
: 	I believe I must follow these steps:
: 
: 	- allocate contiguous memory under 16 MB;
: 	- give the physical addresses (and sizes) to the adapter;
: 	- lock the corresponding pages in central memory (how?);
: 
: 	The adapter is now able to perform DMA.
: 	Is this correct?
: 
: 	Thank you very much.

As J"org already said, there's no 16Mb limit on a PCI bus - btw, does
anyone know how many usable address lines a PCI bus has ?

The second point, I'm fairly sure, is correct and I assume that the
third point (question) is saying "how do I make sure that physical
memory isn't used for anything else".  I *think* you should use
kvm_alloc().  I'm no kernel hacker, but it seems that this allocates
the memory (returning a virtual pointer) and you can then use the
KVTOPHYS() macro to get a physical address to give to the hardware.

Of course, I've never hacked in places like this, so I apologise if
I send you on a wild-goose-chase :-()

-- 
Brian <brian%anorak.coverform.lan@awfulhak.demon.co.uk>
      <http://www.awfulhak.demon.co.uk/>
Don't _EVER_ lose your sense of humour....
.