Hello Gleb,
Am 01.11.2010 um 15:15 schrieb Gleb Natapov:
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 $@
Can't say much about OFW but since no one has replied yet: maybe try specifying OUTPUT_FORMAT(elf_i386) in inflate.ld or check where LD gets defined? Not sure if this code is supposed to build for both architectures or just 32-bit x86.
You may find better answers on the openfirmware list (cc'ed): http://www.openfirmware.info/mailman/listinfo/openfirmware
Andreas
../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.
-- OpenBIOS http://openbios.org/ Mailinglist: http://lists.openbios.org/mailman/listinfo Free your System - May the Forth be with you
On Sat, Nov 06, 2010 at 03:41:34PM +0100, Andreas Färber wrote:
Hello Gleb,
Am 01.11.2010 um 15:15 schrieb Gleb Natapov:
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 $@
Can't say much about OFW but since no one has replied yet: maybe try specifying OUTPUT_FORMAT(elf_i386) in inflate.ld or check where LD gets defined? Not sure if this code is supposed to build for both architectures or just 32-bit x86.
Only 32 bit I think. Specifying OUTPUT_FORMAT it not enough though. I had to add two lines: OUTPUT_ARCH(i386) OUTPUT_FORMAT(elf32-i386)
You may find better answers on the openfirmware list (cc'ed): http://www.openfirmware.info/mailman/listinfo/openfirmware
Thanks.
-- Gleb.
I checked in the changes suggested below; I hope it helps.
Mitch Bradley
On 11/6/2010 11:42 PM, Gleb Natapov wrote:
On Sat, Nov 06, 2010 at 03:41:34PM +0100, Andreas Färber wrote:
Hello Gleb,
Am 01.11.2010 um 15:15 schrieb Gleb Natapov:
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 $@
Can't say much about OFW but since no one has replied yet: maybe try specifying OUTPUT_FORMAT(elf_i386) in inflate.ld or check where LD gets defined? Not sure if this code is supposed to build for both architectures or just 32-bit x86.
Only 32 bit I think. Specifying OUTPUT_FORMAT it not enough though. I had to add two lines: OUTPUT_ARCH(i386) OUTPUT_FORMAT(elf32-i386)
You may find better answers on the openfirmware list (cc'ed): http://www.openfirmware.info/mailman/listinfo/openfirmware
Thanks.
-- Gleb.
openfirmware mailing list openfirmware@openfirmware.info https://openfirmware.info/mailman/listinfo/openfirmware
openfirmware@openfirmware.info