As a newbee in this space I got qemu-system-sparc[64] running on a linux machine.
Trying to find out how qemu and openbios work together I'm currently looking into building openbios-sparc64.
This goes with mixed success as https://www.openfirmware.info/OpenBIOS has nice description on how to build openbios, but there's a missing link as to how to harvest the openbios-sparc64 from this.
My build of openbios is done on an Ultra60(Sparc) machine that runs:
Linux ultra60 4.19.0-2-sparc64 #1 Debian 4.19.16-1 (2019-01-17) sparc64 GNU/Linux
with gcc --version
gcc (Debian 8.3.0-2) 8.3.0
It seems like the file openbios/obj-sparc64/openbios-builtin.elf may be the candidate to become openbios-sparc64??
When giving this a try, and moving openbios-builtin.elf to my x86 qemu machine, it crashes spectacularly with:
qemu: fatal: Trap 0x0064 while trap level (5) >= MAXTL (5), Error state
pc: 0000000000004c80 npc: 0000000000004c84
%g0-3: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
%g4-7: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
%o0-3: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
%o4-7: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
%l0-3: 00000000fff001e0 000001ff00000000 000001fff0080000 0000000000000000
%l4-7: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
%i0-3: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
%i4-7: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
%f00: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
%f08: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
%f16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
%f24: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
%f32: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
%f40: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
%f48: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
%f56: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
pstate: 00000414 ccr: 44 (icc: -Z-- xcc: -Z--) asi: 00 tl: 5 pil: 0 gl: 2
tbr: 0000000000000000 hpstate: 0000000000000000 htba: 0000000000000000
cansave: 6 canrestore: 0 otherwin: 0 wstate: 0 cleanwin: 6 cwp: 7
fsr: 0000000000000000 y: 0000000000000000 fprs: 0000000000000000
On x86: Booting qemu with the provided openbios-sparc64 rom works flawless.
On the Ultra60: Running ./openbios-unix openbios-sparc64.dict seems to behave as expected:
Output device screen not found.
Input device keyboard not found.
Output device screen not found.
Type 'help' for detailed information
[unix] Booting default not supported.
Trying disk...
No valid state has been set by load or init-program
0 > help
To get openbios build, I had to make a small change in Makefile.target:
#CFLAGS+= -Werror
CFLAGS+= -Wno-error
To "fix":
Building OpenBIOS for sparc64
Building...
/usr/bin/xsltproc
error:
CC target/arch/unix/unix.o
CC target/arch/unix/boot.o
/sources/openbios/arch/unix/boot.c:101:6: error: redundant redeclaration of 'forth_fw_cfg_read_file' [-Werror=redundant-decls]
void forth_fw_cfg_read_file(void);
^~~~~~~~~~~~~~~~~~~~~~
In file included from ./target/include/asm/io.h:8,
from /sources/openbios/include/kernel/kernel.h:22,
from /sources/openbios/include/libopenbios/bindings.h:21,
from /sources/openbios/arch/unix/boot.c:6:
/sources/openbios/include/arch/common/fw_cfg.h:104:6: note: previous declaration of 'forth_fw_cfg_read_file' was here
void forth_fw_cfg_read_file(void);
^~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Any pointers or suggestions to continue this journey are appreciated.
Ok, I made those changes to openbios, here is the output.
> On May 8, 2018, at 6:50 AM, Joe van Tunen <joevt(a)shaw.ca> wrote:
>
> : (debug-feval) ( fcode# -- fcode# )
> \ Address
> fcode-stream 1 - . here u. ." : "
>
> \ Indicate if word is compiled
> state @ 0<> if
> ." (compile) "
> then
> dup fcode>xt cell - lfa2name type
> dup ." [ 0x" . ." ]" cr
> ;