将QEMU窗口输出重定向到运行qemu的终端 [英] redirect QEMU window output to terminal running qemu

查看:1829
本文介绍了将QEMU窗口输出重定向到运行qemu的终端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用qemu调试linux内核的引导顺序,
我正在运行的命令是:

  qemu -serial stdio -kernel<内核路径> -hda<到rootfs的路径> -appendroot = / dev / sda terminal = ttyS0

在引导期间,所有内核消息都打印到QEMU窗口。
只有当引导完成后,我得到我的提示回到终端我运行QEMU。



现在我可以开始使用我正在运行的内核终端并在QEMU窗口中看到输出。



如何将所有消息(包括引导消息)都收到我的终端,而不是QEMU窗口(因为我不能

解决方案


  1. 删除 -serial stdio 参数

  2. 添加 -nographic 参数

  3. 并更改内核参数 terminal = ttyS0 console = ttyS0 。这应该是诀窍。

qemu -nographic -kernel ./bzImage -hda ./image.hda -append root = / dev / sda console = ttyS0



您可能需要检查我用于内核开发的脚本: https://github.com/arapov/wrap-qemukvm (这不是很生产,但你可以找到有用的 qemu cli 参数)


Im trying to debug the boot sequence of a linux kernel with qemu, the command i'm running is:

  qemu -serial stdio -kernel <path to kernel> -hda <path to rootfs> -append "root=/dev/sda terminal = ttyS0"

During boot all the kernel messages are printed to the QEMU window. Only when the boot has finished i get my prompt back to the terminal i ran QEMU in.

Now i can start using the kernel terminal I'm running and seeing the output in the terminal and not in QEMU window.

How do i get all messages including the boot messages to my terminal and not to QEMU window (because i cant scroll up in that window..) ?

解决方案

  1. remove -serial stdio parameter
  2. add -nographic parameter
  3. and change the kernel parameter terminal = ttyS0 to console=ttyS0. This should do the trick.

qemu -nographic -kernel ./bzImage -hda ./image.hda -append root=/dev/sda console=ttyS0

You may want to check the script I use for kernel development: https://github.com/arapov/wrap-qemukvm (it's not very "production", but you can find useful qemu cli parameters there)

这篇关于将QEMU窗口输出重定向到运行qemu的终端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆