简体   繁体   English

在OSX上模拟Raspberry Pi

[英]Emulating Raspberry Pi on OSX

After looking for the solution I realized that this could only be done by using QEMU. 寻找解决方案后,我意识到这只能通过使用QEMU来完成。

  • I downloaded the kernel: 我下载了内核:

https://codeload.github.com/dhruvvyas90/qemu-rpi-kernel/zip/master https://codeload.github.com/dhruvvyas90/qemu-rpi-kernel/zip/master

  • And the Raspbian image: 和Raspbian图片:

https://www.raspberrypi.org/downloads/raspbian/ https://www.raspberrypi.org/downloads/raspbian/

  • Installed QEMU after installing it dependencies 安装QEMU依赖项后安装

Then run qemu with following parameters 然后使用以下参数运行qemu

 qemu-system-arm \
  -cpu arm1176 \
  -m 256 \
  -M versatilepb \
  -no-reboot \
  -serial stdio \
  -append "root=/dev/sda2 panic=1 rootfstype=ext2 rw init=/bin/bash earlyprintk loglevel=8 console=ttyAMA0,115200" \
  -kernel /kernel/kernel-qemu-4.1.13-jessie \
  -drive file=/img/raspbian.img,index=0,media=disk,format=raw

I get the following errors 我收到以下错误

EXT4-fs (sda2): bad geometry: block count 944128 exceeds size of device (944127 blocks)
EXT4-fs (sda2): bad geometry: block count 944128 exceeds size of device (944127 blocks)
List of all partitions:
0100            4096 ram0  (driver?)
0101            4096 ram1  (driver?)
0102            4096 ram2  (driver?)
0103            4096 ram3  (driver?)
0104            4096 ram4  (driver?)
0105            4096 ram5  (driver?)
0106            4096 ram6  (driver?)
0107            4096 ram7  (driver?)
0108            4096 ram8  (driver?)
0109            4096 ram9  (driver?)
010a            4096 ram10  (driver?)
010b            4096 ram11  (driver?)
010c            4096 ram12  (driver?)
010d            4096 ram13  (driver?)
010e            4096 ram14  (driver?)
010f            4096 ram15  (driver?)
0800         3842047 sda  driver: sd
  0801           61440 sda1 ea0e7380-01
  0802         3776511 sda2 ea0e7380-02
0b00         1048575 sr0  driver: sr
1f00           65536 mtdblock0  (driver?)
No filesystem could mount root, tried:  ext4
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,2)

I googled a bit about this issue and nobody seems to care, or even give a workaround on this solution as it seems like OSX cant work with ext4 partitions. 我在这个问题上搜索了一下,似乎没人在乎,甚至没有提供解决方法,因为OSX似乎无法与ext4分区一起使用。

To access ExtFS partitions on Mac OS X (or simply MacOS), you will need additional software. 要访问Mac OS X(或简称为MacOS)上的ExtFS分区,您将需要其他软件。 I personally use Paragon Software's version ( https://www.paragon-software.com/home/extfs-mac/ ), however there are most likely some free ones out there. 我个人使用的是Paragon Software的版本( https://www.paragon-software.com/home/extfs-mac/ ),但是很可能有一些免费的版本。

You will need to boot into safe mode, modify the system, and reboot into normal mode. 您将需要引导到安全模式,修改系统,然后重新引导到正常模式。

I've found a free method of mounting ExtFS partitions/drives (and possibly NTFS) for free. 我发现了一种免费的方法来免费安装ExtFS分区/驱动器(可能还有NTFS)。

OSXFuse or MacFuse is an open source project that provides filesystem support for almost all macs (10.5+). OSXFuse或MacFuse是一个开源项目,为几乎所有的mac(10.5+)提供文件系统支持。 It was last updated in 2016. Site https://osxfuse.github.io/ 它的最新更新时间为2016年。网站https://osxfuse.github.io/

You may need to disable SIP, to do so simply hold COMMAND+R when you boot. 您可能需要禁用SIP,只需在启动时按住COMMAND + R即可。 One the recovery menu appears, select "Terminal" from the Tools menu. 出现一个恢复菜单,从“工具”菜单中选择“终端”。 In the terminal window, type "csrutil disable". 在终端窗口中,键入“ csrutil disable”。 Reboot from the apple menu, and install whatever program you wish. 从Apple菜单重新启动,然后安装所需的任何程序。 Disabling SIP has potential of being dangerous, so I do not reccomend doing so. 禁用SIP有潜在的危险,因此我不建议您这样做。 However, there are exceptions where it is needed. 但是,有一些例外。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM