如何在控制台中直接启动qemu(* ​​not * in curses或SDL)

我似乎记得能够启动qemu只有terminal模拟器输出,禁用graphics窗口。 在这里,我不是说用ncurses接口,那是一个很好的,但我希望输出直接stream入我的terminal,使剪切和粘贴更容易。

我努力了:

qemu -nographic binary.img # simply no display qemu -curses binary.img # nice text output, but not directly flowing in the terminal qemu -noframe -curses binary.img # same as above qemu -nographic -curses binary.img 

我想一个可以接受的解决方法是我可以调整诅咒控制台,以适应我使用的terminal。 现在它很烦人,因为它不适合terminal大小…

 qemu -curses binary.img SeaBIOS (version 1.7.0-20120603_194846-gandalf) iPXE (http://ipxe.org) 00:03.0 C900 PCI2.10 PnP PMM+07FC86A0+07F886A0 C900 Booting from Hard Disk... [...] 

注意显示是如何缩进12个空格的? 烦人。 🙂

老问题,但它可能仍然感兴趣的人。

短线:

 qemu -nographic -serial mon:stdio -append 'console=ttyS0' binary.img 

ttyS0在大多数PC上都有效。 这在ARM系统上会有所不同。

然后,串行端口和QEMU在您的输出上复用。 你可以用ctrl-A + C + ENTER在它们之间切换。

长答案:检查这个博客 ,这是真棒。

安装SGABIOS – ISTR,最近的Qemu版本在使用-nographic运行时自动使用它。