Hey,
I've been trying to use SerialICE to trace through some BIOS code, but periodically QEMU stops responding. The SerialICE rom loaded onto the target motherboard's bios chip still responds to serial commands. It's not a specific instruction that causes it to stop, it seems to stop at random points when running normally and when debugging with GDB. Does anyone know why this might be happening?
I setup SerialICE following the README instructions for QEMU 0.10.4. My host system with QEMU is running Debian Linux 2.6.30-1-amd64. My target board is an ASUS P5Q-EM DO based on the Q45 Chipset with an ICH10. I'm using the intel_d945gclf.c mainboard configuration (which works fine with the newer chipset).
Thanks, Daniel Liu
Hi Daniel,
On 04.08.2009, at 21:34, Daniel Liu daliu87@gmail.com wrote:
I've been trying to use SerialICE to trace through some BIOS code, but periodically QEMU stops responding. The SerialICE rom loaded onto the target motherboard's bios chip still responds to serial commands. It's not a specific instruction that causes it to stop, it seems to stop at random points when running normally and when debugging with GDB. Does anyone know why this might be happening?
This is very odd.. The communication code in qemu's serialice.c is a bit fragile due to working around some qemu peculiarities. I have not seen this before, however it sounds a lot like qemu is waiting for data that SerialICE does not attempt to send, or that got lost.. There are a number of debugging statements in Qemu's serialice.c - maybe enabling them can shed some light on this...
Stefan
Hi Stefan,
I think I found the issue. In the function serialice.c:76 serialice_write(), if writing a character fails, the program will be stuck in the readback while loop:
write(fd, buffer + i, 1); while (read(fd, &c, 1) != 1) ;
I changed the write to keep trying until the write succeeds, which fixed the issue for now.
static int serialice_write(int fd, const void *buf, size_t nbyte) { char *buffer = (char *) buf; char c; int i;
for (i = 0; i < (int)nbyte; i++) { while (write(fd, buffer + i, 1) != 1) ; while (read(fd, &c, 1) != 1) ; if (c != buffer[i]) { printf("Readback error! %x/%x\n", c, buffer[i]); } }
return nbyte; }
-Daniel Liu