From owner-freebsd-hackers Fri Aug 25 23:59:22 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from mass.osd.bsdi.com (adsl-63-202-177-115.dsl.snfc21.pacbell.net [63.202.177.115]) by hub.freebsd.org (Postfix) with ESMTP id 8DC2D37B424 for ; Fri, 25 Aug 2000 23:59:15 -0700 (PDT) Received: from mass.osd.bsdi.com (localhost [127.0.0.1]) by mass.osd.bsdi.com (8.9.3/8.9.3) with ESMTP id AAA04702; Fri, 25 Aug 2000 00:29:59 -0700 (PDT) (envelope-from msmith@mass.osd.bsdi.com) Message-Id: <200008250729.AAA04702@mass.osd.bsdi.com> X-Mailer: exmh version 2.1.1 10/15/1999 To: pran@procsys.com Cc: freebsd-hackers@freebsd.org Subject: Re: Memory Mapping -2 In-reply-to: Your message of "Fri, 25 Aug 2000 12:44:18 +0530." <39A61CCA.2DB82AFF@procsys.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 25 Aug 2000 00:29:59 -0700 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Hi, > > I am trying to write a PCI ethernet driver for FreeBSD 3.4 release. Will you folks please give up and move to 4.x? 3.x is *dead*. 8) > 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. You don't do it like this. Firstly, you shouldn't use vtophys, you should be using busdma. Secondly, a physical page can appear in more than one virtual location. Typically your ethernet hardware will have a descriptor associated with each buffer, and you need to use the descriptor to backtrack to your control structure which references the actual virtual address you care about. > 2. What are things should I do if I want the driver to work on alpha > platform also. a) Move to 4.x b) Use the busspace and busdma interfaces -- ... every activity meets with opposition, everyone who acts has his rivals and unfortunately opponents also. But not because people want to be opponents, rather because the tasks and relationships force people to take different points of view. [Dr. Fritz Todt] To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message