systemqemubochs

how get the qemu reboot reason like bochs


I wrote a simple os which constituted by mbr.bin、loader.bin and kernel.bin. here is my main.c which is used for creating kernel.bin

#include "print.h" 
void main(void) 
{
     put_str("I am kernel\n");
     while(1);
}

here is my bochsrc file:

# 机器内存: 32MB
megs: 32

# 启动方式
boot: disk

# 关闭鼠标
mouse: enabled=0

# 硬盘设置 
ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
ata0-master: type=disk, path="image/hd60M.img", mode=flat, cylinders=121, heads=16, spt=63


when I use bochs to run the image/hd60M.img everything works well,but when I used qemu-system-i386 ./image/hd60M.img command, the qemu jump into kernel and show "I am kernel" too, but after that the qemu reboot without logs, I want to get the qemu reboot reason, if it's in bochs,bochs will show the reboot reason automatically.

so, how get the qemu reboot reason, thanks a lot!


Solution

  • QEMU doesn't generally give that kind of guest-debugging information: it is aimed more at running correct guest code quickly than at diagnosing errors in incorrect guest code.

    The debugging facilities we do provide are: