Hello,
I tried to compile openfirmware for qemu like described here http://www.openfirmware.info/Building_OFW_for_QEMU. But after running make in cpu/x86/pc/emu/build on 64bit host I get linkage error: ld -T inflate.ld inflate.lo -o inflate.o ld: i386 architecture of input file `inflate.lo' is incompatible with i386:x86-64 output
After applying this patch: Index: cpu/x86/Linux/Makefile =================================================================== --- cpu/x86/Linux/Makefile (revision 1996) +++ cpu/x86/Linux/Makefile (working copy) @@ -34,7 +34,7 @@ ${CC} -c -m32 -Wall -fno-stack-protector -ffreestanding -D_FORTIFY_SOURCE=0 -DNEED_BCOPY -O3 -fpic $< -o $@
inflate.o: inflate.lo - ${LD} -T inflate.ld $< -o $@ + ${LD} -melf_i386 -T inflate.ld $< -o $@
../build/inflate.bin: inflate.o objcopy -O binary $< $@
==== compilation goes a little bit further but now it stops with: ./build emuofw.rom --- Rebuilding ohci.fc --- Cmd: ${HOSTDIR}/forth ${HOSTDIR}/../build/builder.dic ../ohci.bth
${BP}/dev/usb2/hcd/ohci/ohci.fth:25: my-w@ ?
don't know much forth so just commented every line that gave me an error:
Index: dev/usb2/hcd/ohci/ohci.fth =================================================================== --- dev/usb2/hcd/ohci/ohci.fth (revision 1996) +++ dev/usb2/hcd/ohci/ohci.fth (working copy) @@ -22,12 +22,12 @@ 0 value ohci-reg
: map-regs ( -- ) - 4 my-w@ h# 16 or 4 my-w! - 0 0 my-space h# 0200.0010 + 1000 map-in to ohci-reg +\ 4 my-w@ h# 16 or 4 my-w! +\ 0 0 my-space h# 0200.0010 + 1000 map-in to ohci-reg ;
: unmap-regs ( -- ) - ohci-reg 1000 map-out 0 to ohci-reg +\ ohci-reg 1000 map-out 0 to ohci-reg ;
: ohci-reg@ ( idx -- data ) ohci-reg + rl@ ; ======== After that compilation finally succeeded.
Produced rom image runs fine on qemu, but fails on qemu-kvm with error: BUG: kvm_dirty_pages_log_change: invalid parameters 0000000010000000-0000000010ffffff
Looking into it it seams like openfirmware configure cirrus framebuffer to be at address 0x10000000, but later it configures nic memory BAR with the same address (during device enumeration perhaps). Later it deconfigures nic again. Qemu somehow handles this fine, but qemu-kvm doesn't. This shouldn't work on real HW too FWIW.
-- Gleb.