[OpenBIOS] Cross-compiling and testing sparc64 on Mac OS X
Mark Cave-Ayland
mark.cave-ayland at siriusit.co.uk
Sun Nov 29 14:43:51 CET 2009
Andreas Färber wrote:
> Hello guys,
>
> It's awesome seeing you've made some progress towards emulating
> Solaris/sparc64!
>
> However trying myself, compiling on Mac OS X (after making sure that
> NEED_INT128_T is defined) fails with the following error:
>
> HOSTCC host/kernel/bootstrap.o
> In file included from ../include/openbios/sysinclude.h:7,
> from ../kernel/bootstrap.c:9:
> /usr/include/stdlib.h:267: error: syntax error before ‘arc4random’
> make[1]: *** [host/kernel/bootstrap.o] Error 1
>
> The return type of arc4random is u_int32_t, which is defined (in my
> case) in <ppc/types.h>. Not sure what goes wrong there. I thought it
> could be a name clash with OpenBIOS' __TYPES_H (malc would be furious!),
> but - luckily - Apple uses __TYPES_H_ for their _types.h. Anyway, not
> having these functions declared by defining _POSIX_C_SOURCE made the
> compilation proceed with only one warning:
>
> HOSTCC host/kernel/bootstrap.o
> ../kernel/bootstrap.c: In function ‘interpret_source’:
> ../kernel/bootstrap.c:529: warning: implicit declaration of function
> ‘strcasecmp’
>
> If I symlink .../share/qemu/openbios-sparc64 to
> .../obj-sparc64/openbios-builtin.elf (or copy it over) I get this at
> runtime:
>
> qemu: fatal: Trap 0x0010 while trap level (5) >= MAXTL (5), Error state
> pc: 0000000000004200 npc: 0000000000004204
> General Registers:
> %g0: 0000000000000000 %g1: 0000000000000000 %g2:
> 0000000008000000 %g3: 0000000000000000
> %g4: 0000000000000000 %g5: 0000000000000000 %g6:
> 0000000000000000 %g7: 0000000000000000
> Current Register Window:
> %o0: 00000000ffe00000 %o1: 00000000ffe01000 %o2:
> 000001fff0100000 %o3: 000001fff0000000
> %o4: 0000000000000000 %o5: 0000000000000000 %o6:
> 0000000000000000 %o7: 000001ff00000000
> %l0: 0000000007e80000 %l1: 000001ff00000000 %l2:
> 000001fff0080000 %l3: 0000000000000000
> %l4: 0000000000000000 %l5: 0000000000000000 %l6:
> 0000000000000000 %l7: 0000000000000000
> %i0: 0000000000000000 %i1: 0000000000000000 %i2:
> 0000000000000000 %i3: 0000000000000000
> %i4: 0000000000000000 %i5: 0000000000000000 %i6:
> 0000000000000000 %i7: 0000000000000000
>
> Floating Point Registers:
> %f00: 000000000.000000 000000000.000000 000000000.000000 000000000.000000
> %f04: 000000000.000000 000000000.000000 000000000.000000 000000000.000000
> %f08: 000000000.000000 000000000.000000 000000000.000000 000000000.000000
> %f12: 000000000.000000 000000000.000000 000000000.000000 000000000.000000
> %f16: 000000000.000000 000000000.000000 000000000.000000 000000000.000000
> %f20: 000000000.000000 000000000.000000 000000000.000000 000000000.000000
> %f24: 000000000.000000 000000000.000000 000000000.000000 000000000.000000
> %f28: 000000000.000000 000000000.000000 000000000.000000 000000000.000000
> pstate: 0x00000015 ccr: 0x99 asi: 0x00 tl: 5 fprs: 0
> cansave: 6 canrestore: 0 otherwin: 0 wstate 0 cleanwin 6 cwp 7
> fsr: 0x00000000
> ../qemu-solaris-sparc.command: line 3: 3289 Abort trap
> /Users/andreas/Q/latest/bin/qemu-system-sparc64 -nographic -boot d
> -cdrom /Users/andreas/Q/sol-10-u3-ga-sparc-dvd.iso
>
> This looks different from what you've posted and is identical with
> QEMU's version of openbios-sparc64. Same with or without -nographic.
>
> Any ideas?
Hmmm that's a tricky one. Does it not even get to the OpenBIOS prompt?
You need to be using a recent git master for Qemu as well as OpenBIOS
SVN, although I haven't updated my local copy for a couple of weeks.
Can you try launching a PPC Qemu instance with both the supplied
openbios-ppc and then building your own to confirm that they both
display the same behaviour?
ATB,
Mark.
--
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063
Sirius Labs: http://www.siriusit.co.uk/labs
More information about the OpenBIOS
mailing list