Raspbian hangs in qemu

你。 提交于 2019-12-08 06:07:03

问题


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.

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. first boot is more or less ok. i comment the line in /etc/ld.so.preload as suggested and reboot.

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

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

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

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

    fsck died with exit status 6

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

  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.

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

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. 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".

回答1:


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.

To answer your questions:

  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.


来源:https://stackoverflow.com/questions/33727673/raspbian-hangs-in-qemu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!