*BSD News Article 83395


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.cs.su.oz.au!metro!metro!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!hunter.premier.net!news.mathworks.com!howland.erols.net!surfnet.nl!swidir.switch.ch!news.rccn.net!morgana.mat.uc.pt!usenet
From: Filipe Araujo <filipius@mercurio.uc.pt>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: DMA
Date: Thu, 21 Nov 1996 15:58:20 +0100
Organization: Lab. Redes de Alta Velocidade - DEE - FCTUC
Lines: 45
Message-ID: <32946E0C.EF5@mercurio.uc.pt>
References: <328C8861.48A3@mercurio.uc.pt> <56mjnr$b4a@uriah.heep.sax.de>
	    <329083AC.7048@mercurio.uc.pt> <56vtd6$1mo@anorak.coverform.lan>
NNTP-Posting-Host: obelix.dei.uc.pt
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 2.02Gold (Win95; I)

Hello,

Brian Somers wrote:

> In article <329083AC.7048@mercurio.uc.pt>,
>         Filipe Araujo <filipius@mercurio.uc.pt> writes:
> : ...
> :       - 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? 
> 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 PCI local bus has 32 bits for addressing. The PCI local bus
 specification also defines a transparent extension to 64 bits. The same
thing for data, because data and address lines are shared.

> 
> 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.

	I didn't find the function kvm_alloc()...
	I found a function with a very interesting name: vm_page_alloc_contig().
Does anyone know if it can be used to allocate contiguous memory? If so, do
I still need to lock it in memory?

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

	No problem. All kinds of help are wellcome.
	Regards,

	Filipe Machado de Araujo
        Departamento de Engenharia de Informatica
        Faculdade de Ciencias e Tecnologia
        Universidade de Coimbra
        Portugal