>void uuid_probe(void)
>{
>#ifdef BX_QEMU
> uint32_t eax, ebx, ecx, edx;
>
> // check if backdoor port exists
> asm volatile ("outl %%eax, %%dx"
> : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
> : "a" (0x564d5868), "c" (0xa), "d" (0x5658));
> if (ebx == 0x564d5868) {
Has a bug.
EBX is not initialised prior to the ASM, and could contain the same
value as EAX.
If the I/O doesn't do anything (like on a real PC), it could match the
condition which says its a backdoor.
The ASM should initialise EBX to something else:
asm volatile ("outl %%eax, %%dx"
: "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
: "a" (0x564d5868), "b" (0), "c" (0xa), "d" (0x5658));