>> -int emulate_in(void);
>> -int emulate_out(void);
>> +int emulate_in_imm8(guest_context_t *,int);
>> +int emulate_in_dx(guest_context_t *,int);
>> +int emulate_out_imm8(guest_context_t *,int);
>> +int emulate_out_dx(guest_context_t *,int);
>
>Why split this up?  The DX register can be read while decoding
>just as well; this would simplify the kernel/user interface a bit.
>I'd suggest 'emulate_[in|out](context, port, op_size)' or so.
Yes, I'll clean it up when I added the other I/O instructions.
I just sent the patch that someone (Kevin?) has a base for the
I/O plugin from Bochs (or DOSEMU or so...) and because I don't
know whether I've enough time to get it ready this week.

Other stuff: our main() grows and grows, also functionality.
Therefore I suggest a reorganization of the code. A FreeMWare
base should provide some defined functionality that is used
by interfaces (graphical user interfaces, debugger...). Still
it's no problem, but I see rudiments of becoming worse...
The base is mostly our current user.c, the user interfaces
the plugins. The base would do inits and finis. The ui's would
use functions provided by base such as open vm, start vm, stop vm,
close vm, get data from vm, set data in vm and so on. These
primitives form the interface of the base, and any user interfaces
can be set on top. Comments?

Next time I'll add emulation of the other IO instructions, emu of
invd, wbinvd, invlpg and hlt, do some performance measurements
and... reorg code, if nobody raises protest.

jens

Reply via email to