本文介绍了Raspbian挂在qemu中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用已编译的内核( https://github.com/dhruvvyas90/qemu-rpi-kernel ).我的最终目标是在仿真中启动我的python脚本.

i'm running raspbian (2015-05-05-raspbian-wheezy.img) in qemu using compiled kernel (https://github.com/dhruvvyas90/qemu-rpi-kernel) on ubuntu 14.04. my final goal is to launch my python script within the emulation.

我正在遵循 http://www.unixmen.com/emulation上的手册-raspbian-using-qemu/,尽管许多其他建议都提出了非常相似的操作顺序.我正在尝试的事情和遇到的问题:

i'm following manual from http://www.unixmen.com/emulating-raspbian-using-qemu/, though many others suggest very similar sequence of actions.things i'm trying and issues i'm experiencing:

  1. 第一次启动或多或少都可以.我按照建议对/etc/ld.so.preload中的行进行了注释,然后重新启动.

  1. first boot is more or less ok. i comment the line in /etc/ld.so.preload as suggested and reboot.

在第二次启动时(在我删除init =/bin/bash之后),我得到了所有后续启动

on second boot (after i remove init=/bin/bash) and all subsequent boots i get

错误../libkmod/libkmod.c:554 kmod_search_moddep:无法打开moddep文件'/lib/modules/3.10.25/modules.dep.bin'

ERROR ../libkmod/libkmod.c:554 kmod_search_moddep: could not open moddep file '/lib/modules/3.10.25/modules.dep.bin'

一些谷歌搜索建议运行"sudo rpi-update".它没有帮助,在启动过程中出现相同的消息.

some googling suggested to run "sudo rpi-update". it didn't help, same message during boot.

  1. 在第二次启动时(在我删除init =/bin/bash之后),我得到了所有后续启动

  1. on second boot (after i remove init=/bin/bash) and all subsequent boots i get

fsck死亡,退出状态为6

fsck died with exit status 6

按照建议查看"/var/log/fsck/checkfs"表明那里不存在某些位置,但没有说出哪个位置

looking into "/var/log/fsck/checkfs" as suggested tells that some location is not there, but it doesn't say which one

  1. 运行"startx"会从1生成错误消息.最终会加载UI,但是桌面上只有"wastebasket"图标.屏幕上方还闪烁着一条很粗的白色条纹,就像它一直在尝试加载标签页一样,但是每次都失败.此后,qemu窗口停止响应进一步的交互.

  1. running "startx" produces error message from 1. it loads the UI eventually, but desktop only has "wastebasket" icon. there is also a thick white stripe on top of the screen blinking, like it keeps trying to load a tab but fails everytime. qemu window stops to respond to further interaction after this.

运行"sudo apt-get升级"会安装一些软件包,但是重新启动后我什至无法进入UI-只是用鼠标光标进入空白屏幕.

running "sudo apt-get upgrade" installs some packages, but after reboot i can't even get to UI - just blank screen with mouse cursor.

我对如何在低级配置linux不太有经验.我知道我可能在做些完全愚蠢的事情.所以,我的问题是:

i'm not very experienced with how linux is configured at low level. i understand that i might be doing something completely stoopid.so, my questions are:

  1. 我该如何调试?我无法弄清楚qemu的设置来写日志.我真的不想退回到gdb,因为我不是在调试qemu本身,只是想获得有关事件的通知.
  2. ctrl键似乎在qemu窗口中不起作用.
  3. 没有复制粘贴.否则我看不到如何打开它.
  4. 我想念什么吗?从我看到的所有手册中看来,这应该顺畅得多.像它应该正常工作".
  1. how do i debug? i couldn't figure out the settings for qemu to write logs. i really don't want to fallback to gdb, as i'm not debugging qemu itself, just want to get notification on it's events.
  2. ctrl key doesn't seem to work inside qemu window.
  3. no copy-paste available. or i can't see how to turn it on.
  4. am i missing something? from all the manuals i have seen it seems like this should go much much smoother. like it should "just work".

推荐答案

自您发布以来,很多事情发生了变化.最重要的是,现在使用Andrew Baumann GitHub存储库,您可以构建启动最近Raspbian的QEMU.我在这里.说明简单明了.实施需要完善,但迄今为止最好的工作是编译.

Since your post many things changed. The most important things is that now using Andrew Baumann GitHub repo you can build QEMU that boots recent Raspbian. I described my experience woth this code here. Instructions are straight forward. Implementation needs polishing but it best compilation of work so far.

回答您的问题:

  1. QEMU具有GDB的 -s -S 选项.第一个选项设置gdb服务器挂钩,第二个设置freez CPU,因此您可以连接调试器.这不适用于QEMU调试,而不适用于来宾系统调试.默认的QEMU日志记录是stderr,因此,如果发生有价值的事情,您将在终端中看到它.您可以通过取消注释源代码中的各种 * DEBUG _ 语句来提高QEMU的详细程度.还请检查QEMU的 -d -D 命令行标志的帮助.
  2. 不确定我能帮上什么忙.我只能说我的QEMU版本 2.5.50 对捕获光标后从GUI退出的 Ctrl + Alt 有反应,所以看起来QEMU理解Ctrl 键.我假设QEMU不会捕获您的特殊键组合,因为您的窗口管理器会在传递给QEMU之前捕获它.
  3. 这对我也不起作用,但是我发现在此区域中已完成了一些工作.不确定如何启用和使用该功能.
  4. 仿真任何硬件都非常复杂,需要大量工作.所有模拟目标都限于某些最重要的功能.BCM2835/BCM2836 (Raspberry Pi/Raspberry Pi 2) SoC 仍未被主线 QEMU 接受,因此 just work 不适用于这些平台.
  1. QEMU have -s and -S options for GDB. First option setup gdb server hook and second freez CPU, so you can connect debugger. This is not for QEMU debugging this for guest system debugging. Default QEMU logging is to stderr, so if something valuable happen you will see it in terminal. You can raise QEMU verbosity by uncommenting various *DEBUG_ statements in source code. Also check help for -d and -D command line flags of QEMU.
  2. Not sure I can help with this. Only thing that I can say is that my QEMU version 2.5.50 reacts to Ctrl+Alt which exits from GUI after capturing cursor, so it looks like QEMU understand Ctrl key. I assume that QEMU do not capture your special keys combination because your window manager do it before passing to QEMU.
  3. This also not work for me, but I see some work was done in this area. Not sure how to enable and use that feature.
  4. Emulating any hardware is very complex and requires a lot of work. All emulated targets are limited to some most important features. BCM2835/BCM2836 (Raspberry Pi/Raspberry Pi 2) SoC are still not accepted by mainline QEMU, so just work will not apply to those platforms.

这篇关于Raspbian挂在qemu中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-23 21:51