Progress with qemu arm-bsd-user...

Juergen Lock nox at jelal.kn-bremen.de
Fri Jul 13 17:47:24 UTC 2012


Hi!

 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,

	http://www.ci0.org/qemu-bapt.tar.gz

to run a static echo executable which he also built:

	http://www.ci0.org/arm-binaries-2nox.tar.gz

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
/usr/ports/emulators/qemu-devel/work/qemu-*/bsd-user/syscall.c),
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:

	http://people.freebsd.org/~nox/tmp/qemu-devel-1.1.1-arm-bsd-user-001.patch

 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

	work/qemu-1.1.1/arm-bsd-user/qemu-arm

) - 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*
	make

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

 Thanx!
	Juergen


More information about the freebsd-emulation mailing list