From owner-freebsd-hackers Thu Mar 7 14:28: 5 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from rover.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id AC69037B402 for ; Thu, 7 Mar 2002 14:27:57 -0800 (PST) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.11.3/8.11.3) with ESMTP id g27MRui95205; Thu, 7 Mar 2002 15:27:56 -0700 (MST) (envelope-from imp@village.org) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.11.6/8.11.6) with ESMTP id g27MRtL97469; Thu, 7 Mar 2002 15:27:55 -0700 (MST) (envelope-from imp@village.org) Date: Thu, 07 Mar 2002 15:27:47 -0700 (MST) Message-Id: <20020307.152747.127669206.imp@village.org> To: valery.khromov@icluk.com Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Converting physical into virtual address From: "M. Warner Losh" In-Reply-To: <009c01c1c356$93e13be0$c80ca8c0@khromovv> References: <009c01c1c356$93e13be0$c80ca8c0@khromovv> X-Mailer: Mew version 2.1 on Emacs 21.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message: <009c01c1c356$93e13be0$c80ca8c0@khromovv> "Valery N. Khromov" writes: : I'd like to develop a kernel module for FreeBSD, able to read & write : directly to VGA text-mode screen buffer. I know that this buffer is located : at 0xB8000 in physical address space. But in kernel I must address it using : kernel virtual address space. : : Thus, the question is: how can I _correctly_ convert physical address into : kernel virtual address? : : Now I use the following trick: 0xC0000000 + 0xB8000, but I want to use more : correct method. :) bus_alloc_resource() followed by bus_space_{read,write}_*. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message