# FreeBSD RPI2 install in Windows QEMU



## bsaidus (Aug 17, 2021)

I have this image file downloaded on FreeBSD ftp server ( FreeBSD-12.0-RELEASE-arm-armv7-RPI2.img ).

Can someone help me on how to install it or make it work in QEMU ( the QEMU program under windows ).
I can't find any resources or documentation about doing it.
PS. I've bought Raspberry PI4 and installed it on SD card but not working.

Thank you in advence


----------



## eternal_noob (Aug 17, 2021)

bsaidus said:


> Can someone help me on how to install it or make it work in QEMU


What have you tried, what did not work? Any error messages? Please elaborate.


bsaidus said:


> but not working.


This is no proper error message either.


----------



## bsaidus (Aug 17, 2021)

eternal_noob said:


> What have you tried, what did not work? Any error messages? Please elaborate.
> 
> This is no proper error message either.


Thanks for feedback.
So, first what I did is to use win32diskimager to write the .img file into the SD card and plug it into the Raspberry, switch it on but nothing work. ( The Raspberry that I have has a mini screen attached with HDMI )
Nothing works mean that I do not see nothing in the screen ( unlike Slackware that works well ).

Concerning the QEMU, I know that this program can imulate raspberry but did not find any document or tentative from BSD hobbiers or expert on how to make functioning FreeBSD RPI2 on it.


----------



## eternal_noob (Aug 17, 2021)

bsaidus said:


> So, first what I did is to use win32diskimager to write the .img file into the SD card


The guys at Raspberry Foundation say that:


> Raspberry Pi Imager *is our recommended* option for most users to write images to SD cards, so it is a good place to start. If you’re looking for an alternative on Windows, you can use balenaEtcher, Win32DiskImager or imgFlasher.











						Raspberry Pi Documentation - Getting started
					

The official documentation for Raspberry Pi computers and microcontrollers



					www.raspberrypi.org
				




Did you try the other imagers, most notably Raspberry Pi Imager and balenaEtcher?

Don't know about QEMU, sorry.


----------



## kpedersen (Aug 19, 2021)

bsaidus said:


> Concerning the QEMU, I know that this program can imulate raspberry but did not find any document or tentative from BSD hobbiers or expert on how to make functioning FreeBSD RPI2 on it.


I think QEMU can only emulate the Raspberry PI hardware by booting the Linux kernel directly (last time I looked at it ~5 years ago). I don't believe the same can be done for FreeBSD.

Also keep in mind, that qemu seems to be greatly memory constrained when emulating the Pi. I think you can't allocate more than 512MB. This reduces its usefulness somewhat as a build server, etc.

What I would recommend you do instead is use qemu-static and run FreeBSD in an arm64 jail instead. I tried this a while ago and it worked well:

https://forums.freebsd.org/threads/arm-or-sparc-in-freebsd-jail-on-amd64-host.65130/#post-381501

It runs impressively fast because it only uses dynamic translation for the userland programs. The kernel is still native and fast.


----------



## cmoerz (Aug 19, 2021)

In regards to getting FreeBSD to boot on your RPI4: the older FreeBSD 12 images probably won't work with an RPI 4. Have you tried any of the 13 or 14 images? If memory serves, boot procedures for RPI4 changed; you can even get it to boot from a USB device, which I can confirm, I've got a 13 based RPI4 myself. 
Booting from USB required flashing a new firmware by booting up Linux once. Don't know, if that is still a requirement. Newer hardware might already have that recent firmware installed.


----------



## bsaidus (Aug 19, 2021)

Yes, I confirm that FreeBSD 13 works fine on RPI4.
I'm wondering what image is suitable for RPI3 ! 
Thanks.


----------



## mark_j (Aug 21, 2021)

Stick to the latest release, 13 and you should be ok.
I believe RPI3 and below suffer from a poor USB stack that polls instead of interrupts. So speed might be poor compared to Linux.


----------

