I encountered several problems and I'm going to describe them along with the workarounds here.
First, the devel/dev86 port I created was marked as running on i386 only. I initially did this because I wasn't sure if the software would run on amd64, but after testing it I can say that it does work. So the port needs a little tweaking, namely this line
ONLY_FOR_ARCHS= i386needs to be extended to
ONLY_FOR_ARCHS= i386 amd64or maybe even removed completely.
Second, the RomCC utility used in the coreboot build process crashes, apparently due to a change in GCC 4 as opposed to GCC 3.4 used in older versions on FreeBSD. It crashes in a function called "free_basic_block" and the workaround is this:
Index: util/romcc/romcc.c =================================================================== --- util/romcc/romcc.c (revision 3088) +++ util/romcc/romcc.c (working copy) @@ -15083,6 +15083,8 @@ static void free_basic_block(struct compile_state *state, struct block *block) { + return; + struct block_set *edge, *entry; struct block *child; if (!block) {Third, the linker on FreeBSD/amd64 does not understand the -m32 flag. So I needed a cross compiler for i386. Warner Losh has an entry in his blog that describes how to cross build FreeBSD. I don't need all of FreeBSD but only the compiler, so I use this:
$ cd /usr/src $ export TARGET=i386 $ export TARGET_ARCH=i386 $ make toolchainThis gives me an i386 cross compiler in /usr/obj/i386/usr/src/tmp/usr/bin that I need to use to compile coreboot. I did this to tell the GNU make utility to use the cross compiler:
gmake CC=/usr/obj/i386/usr/src/tmp/usr/bin/gcc
Using Qemu 0.9.0 with the required patches (see the Qemu Build Tutorial) made the problem go away and I'm now able to boot FreeBSD/i386 8-CURRENT inside Qemu, using coreboot and ADLO. I've uploaded a complete archive of the port files to the coreboot wiki, see this link.
No comments:
Post a Comment