From owner-freebsd-hackers Fri Aug 25 2:24: 2 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 39EEC37B42C for ; Fri, 25 Aug 2000 02:23:59 -0700 (PDT) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id e7P9Njo11283; Fri, 25 Aug 2000 02:23:45 -0700 (PDT) Date: Fri, 25 Aug 2000 02:23:44 -0700 From: Alfred Perlstein To: Pran Joseph Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Memory Mapping -2 Message-ID: <20000825022344.K1209@fw.wintelcom.net> References: <39A61CCA.2DB82AFF@procsys.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.4i In-Reply-To: <39A61CCA.2DB82AFF@procsys.com>; from pran@procsys.com on Fri, Aug 25, 2000 at 12:44:18PM +0530 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Pran Joseph [000825 00:11] wrote: > Hi, > > I am trying to write a PCI ethernet driver for FreeBSD 3.4 release. > > I have some questions > > 1. How can I convert physical address to virtual address . What I want > is to read the physical address from the device register and to copy it > to host memory. From my earlier post I found that I can use vtopys > macro to convert virtual to physical address. Now I want to do the > reverse. Um, I'm not sure what you mean here, a physical memory location can be mapped vitually anywhere :), you have to keep track of the virtual address somehow in your driver. > 2. What are things should I do if I want the driver to work on alpha > platform also. Don't use i386 assumptions? example: use PAGE_SIZE rather than hardcoding 4096, make sure you're using busdma rather than hardcoding all your stuff. Lastly buy and alpha. :) -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] "I have the heart of a child; I keep it in a jar on my desk." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message