On Mon, 18 Dec 2000, Aaron Optimizer Digulla wrote:
> On Mon, Dec 18, 2000 at 01:35:58PM +0100, John B�ckstrand wrote:
>
> > > Well, can't we simply use the MMU to mark pages where MMIO can happen
> > > and then use the page fault to process them ? This way, we don't
> > > need to care about checking addresses. We only check them when a
> > > fault happens.
> > IIRC, thats very slow. an interrupt+processing per memory access
> > isnt very fast. btw, isnt it done like this today?
> >
> > and didnt the dosemu guy talk about this? I think he said that
> > doing it by PG:ing was slow...
>
> Well, it has the big advantage that you can simply run the code
> unmodified until it crashes. When it crashes, you know that you
> must do something and you can then start to dismantle and examine
> it.
>
Not exactly crashes, but traps access. After that you could choose to
switch to emulation mode, which is more efficient for MMIO. You're
emulating few 100's of instructions, then switching back to "normal"
execution. It should speed up things considerably, because the device
controlling code usually is located in relatively small loops/subs. I
think the idea of Bart was really good, especially for emulation of VGA,
though I don't know if that would be also very benificial for emulation of
more advanced video hardware, in case it's real hardware probably yes, but
I've thought that Kevin and Ramon choosed to emulate video through
high-level interface calls rather than raw hardware.. Anyway, I think
things like JIT are very useful anyway, especially for portability. x86
will not stay forever. I thought it would be great to have something like
FX32 but open-source and portable to various platforms... bochs could
become.
Uhus