Capturing output of qemu
In order to capture output of qemu, it is needed to issue command like this:
qemu -hda rootfs.img -kernel bzImage -append "root=/dev/hda console=ttyS0" -serial stdio
This way boot messages will be redirected to host vga console, and can be copy/pasted fot googleing and debugging.
For thia to work, virtual console in kernel must be enebled (which by default is the case). Look under device drivers -> charcter devices -> virtual terminal, or grep .config for CONSOLE.
One more note, from Remote Serial Console HOWTO:
----------------------------
That means that giving command:
qemu -hda rootfs.img -kernel bzImage -append "root=/dev/hda console=tty0 console=ttyS0" -serial stdio
This will give output in both host console (ttyS0), but also in qemu vindow (tty0).
However, there is another note for this command in form mentioned howto:
Kernel messages will appear on both the first virtual terminal and the serial port. Messages from the init system and the system logger will appear only on the first serial port. This can be slightly confusing when looking at the attached monitor: the machine will appear to boot and then hang. Don't panic, the init system has started but is now printing messages to the serial port but is printing nothing to the screen. If a getty has been configured then a login: prompt will eventually appear on the attached monitor.
qemu -hda rootfs.img -kernel bzImage -append "root=/dev/hda console=ttyS0" -serial stdio
This way boot messages will be redirected to host vga console, and can be copy/pasted fot googleing and debugging.
For thia to work, virtual console in kernel must be enebled (which by default is the case). Look under device drivers -> charcter devices -> virtual terminal, or grep .config for CONSOLE.
One more note, from Remote Serial Console HOWTO:
----------------------------
The Linux kernel is
configured to select the console by passing it the
console parameter. The
console parameter can be given repeatedly, but
the parameter can only be given once for each console technology.
So console=tty0 console=lp0 console=ttyS0 is
acceptable but console=ttyS0 console=ttyS1 will
not work.
When multiple consoles are listed output is sent to all
consoles and input is taken from the last listed console. The last
console is the one Linux uses as the /dev/console device.
The syntax of the console parameter is
given in Figure 5-1.
Figure 5-1. Kernel console syntax, in EBNF
console=ttyS
console=tty
console=lp
console=ttyUSB[
That means that giving command:
qemu -hda rootfs.img -kernel bzImage -append "root=/dev/hda console=tty0 console=ttyS0" -serial stdio
This will give output in both host console (ttyS0), but also in qemu vindow (tty0).
However, there is another note for this command in form mentioned howto:
Kernel messages will appear on both the first virtual terminal and the serial port. Messages from the init system and the system logger will appear only on the first serial port. This can be slightly confusing when looking at the attached monitor: the machine will appear to boot and then hang. Don't panic, the init system has started but is now printing messages to the serial port but is printing nothing to the screen. If a getty has been configured then a login: prompt will eventually appear on the attached monitor.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home