bhyve How to emulate Arm under Bhyve

I would like to make a VM for a build and compile Arm target.
I know qemm does something like this but I really only need TARGET=arm and TARGET_ARCH


So I don't really need a proper emulated environment just a compile environment.
Anything that could help?
I also noticed you must use the DWITH_FDT option flag on arm.

How can I set some of these for a emulated BBB Build VM or Pi2 Build VM using FreeBSD and bhyve.
 
So in the VM the /.cshrc file would get:
TARGET arm
TARGET_ARCH armv6

That would be enough but what about the fdt setting? How to set compiler commands permanent?
Is that /etc/make.conf ?
DWITH_FDT
WITH_FDT ???

TARGET_ARCH may have changed to armv7 now too for some boards.
 
Can I make a QEMM VM emulating an arm7 board for compiling FreeBSD? Doable/ Feasable? Slow?
 
QEMU looks quite capable but I am unfamiliar with it. Lots of setup but pure arch emulation.
So it provides its own 'hypervisor' without cpu virt extensions needed? It also provides a qemm-user-static.
Lots of pieces to understand.

I do like the suggestion of jails. That separates the build from host nicely. That should be an easy test for me.
 
Since most of my Arm build envirnoment involves setting Target and Arch couldn't I have different system users with these target environments. Each user shell has different env settings.
BBB user would set build env for that.
Hmmm. but I am pretty sure to compile you need root though. Maybe I could get doas to help.
 
Qemu-based jail does not require a lot of settings - all you need is to download the corresponding base.txz. If you go with CBSD, this is done with two commands:

Code:
pkg install -y qemu qemu-user-static

Create RISCV jail via CLI ( for dialog run: cbsd jconstruct-tui) :

Code:
cbsd jcreate jname=riscv pkg_bootstrap=0 arch=riscv emulator="qemu-riscv64-static" exec_start="/bin/qemu-riscv64-static /bin/sh /etc/rc" exec_stop="/bin/qemu-riscv64-static /bin/sh /etc/rc.shutdown" runasap=1

Create AARCH64 jail:

Code:
cbsd jcreate jname=aarch pkg_bootstrap=0 arch=aarch64 emulator="qemu-aarch64-static" exec_start="/bin/qemu-aarch64-static /bin/sh /etc/rc" exec_stop="/bin/qemu-aarch64-static /bin/sh /etc/rc.shutdown" runasap=1

Login into jail:

Code:
cbsd jlogin
 
Back
Top