gpt4 book ai didi

macos - 如何在 OSX 上使用 Qemu 启动 Raspberry Pi SD 卡

转载 作者:行者123 更新时间:2023-12-05 06:57:11 25 4
gpt4 key购买 nike

我有一个 Raspberry Pi 出现故障,我想尝试在我的 OSX 笔记本电脑上调试它,以确定问题是否与硬件、SD 卡或软件有关。

我已经从 pi 中取出 SD 卡并将其安装到我的 OSX 机器上,并复制了文件 kernel7.imgbcm2709-rpi-2-b.dtb/boot 分区到 OSX 硬盘。

然后我卸载了 bootRECOVERY 分区,然后尝试启动模拟器:

sudo qemu-system-arm \
-machine raspi2 \
-no-reboot \
-dtb ./bcm2709-rpi-2-b.dtb \
-kernel ./kernel7.img \
-drive file=/dev/disk2,format=raw

这给了我输出:

**qemu-system-arm: Invalid SD card size: 29.7 GiB SD card size has to be a power of 2, e.g. 32 GiB. You can resize disk images with 'qemu-img resize <imagefile> <new-size>' (note that this will lose data if you make the image smaller than it currently is).**

有什么办法可以解决这个问题吗?

最佳答案

不要试图像那样将原始磁盘设备直接传递给 QEMU。而是将磁盘上的内容复制到普通文件(例如使用 dd),然后确保该文件的大小正确,并告诉 QEMU 使用该文件。

(将 SD 卡的内容复制到您的硬盘也将检查 SD 卡是否仍然可读且没有错误...)

关于macos - 如何在 OSX 上使用 Qemu 启动 Raspberry Pi SD 卡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64948360/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com