Progress with qemu arm-bsd-user...

Juergen Lock nox at
Fri Jul 13 17:47:24 UTC 2012


 I know people here would like to be able to run FreeBSD/arm
target executables on x86 hosts like Linux users can using qemu
linux-user, and this is the first step:  I fixed cognet's
arm-bsd-user patches,

to run a static echo executable which he also built:

so now probably only syscall handling and fixes for threading
are still missing, the same as for the other bsd-user targets.
Adding handling code for the missing syscalls should be
mostly mechanic (the main part of this is in
and cognet thinks at least for armv6 the threading emulation can
be more or less copied from linux-user too...

 Soo, anyone wants to help? :)

 The patch against the current emulators/qemu-devel port is here:

 To run a static arm executable do like:

	qemu-arm -bsd freebsd -strace -d in_asm,out_asm,cpu arm-binaries/echo foo bar

(this can also be invoked from the port's work dir as


) - and -strace prints the sycalls and -d in_asm,out_asm,cpu logs
the target- and the translated code as well as the emulated cpu state
in /tmp/qemu.log.

 qemu also has a builtin gdbstub so you can also connect a cross gdb:

	qemu-arm -bsd freebsd -strace -d in_asm,out_asm,cpu -g 1234 arm-binaries/echo foo bar

	(gdb) target remote 127.1:1234

 As always with patching code in ports if you want to only rebuild
the changed parts instead of the whole port from scratch you can
patch away below the port's work/ dir and run:

	rm work/.build_done*

 (but don't forget to save your changes before doing make clean. :)


More information about the freebsd-emulation mailing list