I'm currently experimenting with a plugin that hooks to an ioport. The idea is that 
this
plugin can modify the guest_cpu state somewhat (setting results in ax, etc - according 
to
the vbe spec, so these should be just "normal" changes to the guest).

I have an io write handler registered that looks like:

void
plugin_io_write_handler(void *data, Bit32u address, Bit32u value, unsigned io_len)
{
        // get current cpu state
        vm_get_cpu(&guest_cpu);
 
        fprintf(stderr,"vbe handler (ax=0x%x)\n",(guest_cpu.eax & 0xffff));
        
        // do something... nothing here yet 
 
        // put back modified cpu state
        vm_set_cpu(&guest_cpu);
}


However, when I execute a vbe example within the guest, this function gets called in an
"endless" loop. If I comment out the line with "vm_set_cpu" it seems to be ok. So I 
would
imagine this either being a "bug" in the vm_set_cpu, or I need to "ack" an ioport write
request somehow (in order for the callback not be called *again*). Any ideas what's 
wrong
here?
-- 
Best regards,

                 Jeroen Janssen
---
"It's got three keyboards and a hundred extra knobs, including twelve with
'?' on them."
        -- The Unseen University Organ, as designed by B. S. Johnson
           (Terry Pratchett, Men at Arms)

Reply via email to