在Qemu中运行Raspberry Pi Buildroot图像

发布于 2025-01-17 14:04:56 字数 529 浏览 2 评论 0原文

我正在尝试用BuildRoot构建RaspberryPi3的Linux图像,并在QEMU上运行。 完成完成进程后,我可以将sdcard.img文件复制到SD卡中,并在没有任何问题的情况下正确运行真正的Raspberry Pi设备上的操作系统。

但是,当我尝试使用相同的图像文件并尝试在qemu上运行时,启动失败。

  1. QEMU -SYSTEM -AARCH64 -M RASPI3 -KERNEL ZIMAGE -DTB生成的DTB -SD生成.img => Qemu窗口打开,但空白。终端上也没有。
  2. QEMU -SYSTEM -ARM -M RASPI2 -KERNEL ZIMAGE -DTB生成的DTB -SD生成.img => QEMU窗口打开。覆盆子图像出现在左上角。但是在Teminal窗户中有一个内核恐慌。 vfs安装失败
  3. 与第一步相同,但带有来自source =&gt的刚刚编译的QEMU;与第一步相同。 QEMU窗口或终端中的任何内容都没有。

我做错了吗?

I am trying to build a linux image for raspberrypi3 with buildroot and run it on qemu.
Once the make process is done i can copy the sdcard.img file into a SD card and correctly run the OS on a real raspberry pi device without any issue.

but when i try to use the same image file and try to run it on qemu the bootup fails.

  1. qemu-system-aarch64 -M raspi3 -kernel zImage -dtb generated dtb -sd generated .img
    => qemu window opens but blank. nothing on the terminal as well.
  2. qemu-system-arm -M raspi2 -kernel zImage -dtb generated dtb -sd generated .img
    => qemu window opens. raspberry image appears on top left corner. but in the teminal window there is a kernel panic. VFS mount failed
  3. same as 1st step but with a freshly compiled qemu from source => same as 1st step. nothing on the qemu window or in the terminal.

am i doing something wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

書生途 2025-01-24 14:04:57

经过几天的谷歌搜索,我找到了我的问题的答案。
我在终端命令中使用的由 buildroot make 进程构建的内核映像 zImage 与 QEMU 不兼容。
为了解决这个问题,我必须编译自己的 QEMU 兼容的树莓派内核。

我按照这个链接编译了我自己的内核。 树莓派交叉编译内核
然后,当我使用 QEMU 运行操作系统时,出现另一个内核恐慌,提示 VFS 安装失败。当我之前阅读终端输出时,它说介质上没有足够的空间。因此将 scread.img 文件扩展至 1G 并运行相同的终端命令。

现在QEMU已经完美运行了

After few days of googling around a lot i found the answer to my issue.
The Kernel image zImage I use in the terminal command which is built by the buildroot make process is not compatible with the QEMU.
To solve that I had to compile my own QEMU compatible raspberry pi kernel.

I followed this link to compile my own kernel. raspberry pi cross-compile kernel
then when I used QEMU to run a OS there was another kernel panic saying VFS mount failed. When I read the terminal outputs before that, it says not enough space on the media. So expanded the scared.img file to 1G and ran the same terminal command.

Now the QEMU is running perfectly

忆梦 2025-01-24 14:04:57

对这两个命令行使用相同的内核映像绝对是错误的。 raspi3需要64位内核,raspi2需要32位内核。

您的命令行似乎缺少“-dtb”选项的参数,并且还可能缺少传递初始 ramdisk 的“-initrd”选项,以及传递内核合适的命令行参数(包括正确的命令行参数)的“-append”选项用于根文件系统的设备。

Using the same kernel image for both these command lines is definitely wrong. raspi3 needs a 64-bit kernel, and raspi2 needs a 32-bit one.

Your command line appears to be missing the argument to the '-dtb' option, and also may be missing an '-initrd' option passing the initial ramdisk, and an '-append' option passing the kernel suitable command line arguments including the correct device to use for the root filesystem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文