In the process of planning system testing for one of my clients I found that
someone from Microsoft published patches with
to QEMU mailing list. I thought it is very interesting, because if it is
possible to setup emulated Raspberry Pi many use cases can be tested faster and
in more automatic way. For example checking how application behave when running
on more then one device at once, testing massive deployment process, stress
testing and finally speed up debug-fix-test process.
So it looks like making RPi 2 working in emulated environment can add a lot of
value to some products. In email Andrew mention
github repo, which I would like to try in this
Get QEMU and compile
git clone https://github.com/0xabu/qemu.git -b raspi
git submodule update --init dtc
sudo make install
Prepare to boot
QEMU requires kernel and device tree file to be given as parameters, because of
that we have to extract those pieces from existing Raspbian image.
Get kernel and device tree
[23:35:23] pietrushnic:rpi2_qemu $ sudo /sbin/fdisk -lu 2015-11-21-raspbian-jessie.img
Disk 2015-11-21-raspbian-jessie.img: 3.7 GiB, 3934257152 bytes, 7684096 sectors
Units: sectors of 1 * 512=512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xea0e7380
Device Boot Start End Sectors Size Id Type
2015-11-21-raspbian-jessie.img1 8192131071122880 60M c W95 FAT32 (LBA)
2015-11-21-raspbian-jessie.img2 13107276840957553024 3.6G 83 Linux
Check start of W95 FAT32 (LBA) partition. It is 8192. Sector size is 512.
So calculate offset in bytes 8192 * 512 = 4194304.
There are many problem with existing setup, but from my experience this is best
approach and code that I saw during last years. Also it looks like this code is
backed by huge corporation so it looks like they see value in providing this
code to wide community. Rapid delivery of those patches probably would not be
possible without previous work to which Andrew point in his email. It would be
great to see community engagement in this effort.
Founder of 3mdeb, a passionate advocate for open-source firmware solutions, driven by a belief in transparency, innovation, and trustworthiness. Every day is a new opportunity to embody the company's vision, emphasizing user liberty, simplicity, and privacy. Beyond business, a casual chess and bridge player, finding peace in nature and nourishment in theology, philosophy, and psychology. A person striving to foster a healthy community, grounded in collaboration and shared growth, while nurturing a lifelong curiosity and a desire to deeply understand the world.