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
> ;
On 16/05/2019 08:09, BALARD Arnaud wrote:
> Hi Mark,
>
>
> I finally build my bios for SS20 and finish to install my solaris 7 + soft (with 2 cpu of 170Mhz).
>
> That's works great ! I just have two question if you can have a time :
>
> - I can't add more than 512M of RAM, I have qemu fatal trap when I try it.
> - My screen are limited to the TCX model, when I try to use CG3 with args -"g 1152x900" I get "stopping execution"
>
>
> Thanks you for all your answers, I would never have succeeded without your help !
Hi Arnaud,
Excellent news! I see from Wikipedia that the SS-20 would only support a maximum of
512M RAM anyhow, but it seems qemu-system-sparc doesn't detect this correctly as the
maximum address doesn't look right. For the moment I'd simply say "don't do that" and
I'll try and find out a way to have qemu-system-sparc fail on a more friendly way.
Also note that that target/sparc is not MTTNG enabled so your 2 vCPUs are currently
running on just 1 physical CPU. It's something on my TODO list to look at but fairly
low priority right now.
As for CG3 due to memory constraints in OpenBIOS you can only run it at a maximum of
1024x768 unless you have a real Sun PROM and a CG3 FCode ROM which will allow it to
run at the higher 1152x900 resolution.
ATB,
Mark.