Subject: Re: Location for x86emu
To: None <tech-kern@NetBSD.org>
From: Joerg Sonnenberger <joerg@britannica.bec.de>
List: tech-kern
Date: 11/30/2007 17:07:03
On Fri, Nov 30, 2007 at 08:54:29AM -0700, Tim Rightnour wrote:
> 
> On 30-Nov-2007 Joerg Sonnenberger wrote:
> > src/common could be considered as well, given that it is code that can
> > be used both in userland and kernel.
> 
> For me, it would be very useful to have in the prep bootloader.  That being
> said, I don't know of a particularly good place to put it.
> 
> How much MD glue code would be required to actually use it?

On x86 I can get away with mapping the BIOS range, the first page and
another page for stack and data. The default memory functions just
expect a 1MB VA mapping and read/write to that. I am just passing IO
requests through.

On a different platform, you would have to map the adapter ROM (needs to
be done on x86 later as well), figure out the VGA port mapping (to be
done on x86 as well) and provide real functions for the in/out
callbacks. I do not know yet, if we need to emulate e.g. the i8254, but
if we want to use vesafb or so, we certainly have to.

Joerg