diff -r 463bda167715 tools/ioemu/target-i386-dm/helper2.c --- a/tools/ioemu/target-i386-dm/helper2.c Wed Nov 29 12:43:11 2006 +0000 +++ b/tools/ioemu/target-i386-dm/helper2.c Wed Nov 29 14:25:16 2006 +0800 @@ -299,6 +299,10 @@ static inline void write_physical(uint64 return cpu_physical_memory_rw((target_phys_addr_t)addr, val, size, 1); } +#define DEBUG_BUF_SIZE 1024 +unsigned char debug_buf[DEBUG_BUF_SIZE]; +unsigned int debug_buf_idx = 0; + void cpu_ioreq_pio(CPUState *env, ioreq_t *req) { int i, sign; @@ -319,7 +323,16 @@ void cpu_ioreq_pio(CPUState *env, ioreq_ } } } else if (req->dir == IOREQ_WRITE) { - if (!req->data_is_ptr) { + if (req->addr == 0xe9) { + unsigned char c = (unsigned char)req->data; + debug_buf[debug_buf_idx++] = c; + if ((debug_buf_idx == (DEBUG_BUF_SIZE - 1)) || (c == '\n')) + { + debug_buf[debug_buf_idx] = 0; + fprintf(logfile, "HVM DEBUG: %s", debug_buf); + debug_buf_idx = 0; + } + } else if (!req->data_is_ptr) { do_outp(env, req->addr, req->size, req->data); } else { for (i = 0; i < req->count; i++) {