> 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?
You don't. > Now I use the following trick: 0xC0000000 + 0xB8000, but I want to use more > correct method. :) The memory at 0xb8000 is owned by the VGA driver. Depending on what your module wants to do, you can either become a client of the driver (using eg. the screensaver interface) or you can look over its' shoulder and steal its' mapping yourself. There's a good chance you don't actually want/need to be in the kernel in the first place, and if that's so, you can access video memory from userspace (see the VGL library for examples). If you're trying to completely replace the VGA driver, then you will want to look at how it handles creating and then allocating resources for video memory. -- To announce that there must be no criticism of the president, or that we are to stand by the president, right or wrong, is not only unpatriotic and servile, but is morally treasonable to the American public. - Theodore Roosevelt To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message