From owner-freebsd-hackers@FreeBSD.ORG Wed Mar 30 19:27:13 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5D61F16A4CE for ; Wed, 30 Mar 2005 19:27:13 +0000 (GMT) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id A815343D53 for ; Wed, 30 Mar 2005 19:27:10 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from [192.168.254.21] (rat.samsco.home [192.168.254.21]) (authenticated bits=0) by pooker.samsco.org (8.13.1/8.13.1) with ESMTP id j2UJV0Nk011877; Wed, 30 Mar 2005 12:31:00 -0700 (MST) (envelope-from scottl@samsco.org) Message-ID: <424AFD12.7070505@samsco.org> Date: Wed, 30 Mar 2005 12:25:06 -0700 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.7.5) Gecko/20050321 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Rajesh Ghanekar References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=3.8 tests=ALL_TRUSTED autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on pooker.samsco.org cc: freebsd-hackers@freebsd.org Subject: Re: physical address to virtual address conversion X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2005 19:27:13 -0000 Rajesh Ghanekar wrote: > Hi, > > I am trying to convert a physical memory location (address 0x000F0000) > to virtual memory address in kernel module with pmap_map() / pmap_enter(). > Whenever i call these two functions, system hangs. Is this a proper > way for conversion? > > The same physical address can be accessed from the userspace by opening > /dev/mem. The code which does the memory mapping to /dev/mem at kernel > level is in ./sys/i386/i386/mem.c as mmrw() which also uses pmap_enter(). > > kernel = FreeBSD 4.10 > > - Rajesh > pmap_mapdev() is probably what you want. However, what exactly are you trying to do? Why do you need access to a specific physical location? Scott