Saturday, December 12, 2009

Submitted the SS-5 OBP patches upstream

Did some clean-ups and submitted a minimal patch set upstream.

I omitted the SparcStation-20 support for now, which made the patches for SparcStation-5 OBP cleaner, so there is a chance they will be accepted (my last patch was silently ignored for a month just because it was badly formatted, that's why I say "a chance", not "a good chance").

This means that if the patches will be accepted for the qemu 0.12, it will be possible to boot Solaris 2.5.1 and Solaris 2.6 kernels in the vanilla qemu with SS-5 OBP. I'll write a qemu/Solaris/sparc how-to.

No support for SS-20 (and SunOS 4.1.4 / Solaris 1.1.2) yet, as it is more buggy, and less requested. If someone thinks the support for SunOS 4.1.4 is important, feel free to write me. If you ever debugged a SunOS 4.x kernel (or have tools for doing it), please write me.


Anonymous said...

Actually i would love to have sunos 4.1.4 booting. I use a legacy compiler and about once every three-six months we loose a disk due to the age and need to scrounge around for a replacement.

atar said...

Interesting. I thought it was possible to run all the SunOS applications under Solaris 2+.

Do you have any diagnostic utilities for SunOS 4.1.4? I have an install cdrom, but it doesn't even seem to have ability to boot with 'kadb'. Does your install have the kadb?

Brent said...

I, too, think that most any SunOS 4 app should work under Solaris, even a compiler. Our legacy apps are also SunOS4, but they work fine under Solaris. Perhaps it would require more libraries than are normally supplied, though, so it could take some tinkering to get enough components into the environment for it to work?

PS Vanilla qemu still doesn't seem to see SCSI (or perhaps not any SBUS devices). Here's my current output:

qemu/sparc-softmmu/qemu-system-sparc -name r2d2 -bios ./ss5-170.bin -drive file=/internal/virt/r2d2.qcow2,if=scsi -net nic,macaddr=52:54:00:02:01:01 -nographic
Warning: vlan 0 is not connected to host network

Power-ON Reset

MB86907 POST 2.2.3 03SEP96

Probing system memory: 32 32 32 32 0 0 0 0
Config = 880000AA
0Kb ecache detected

initializing TLB
initializing cache

Allocating SRMMU Context Table
Setting SRMMU Context Register
Setting SRMMU Context Table Pointer Register
Allocating SRMMU Level 1 Table
Mapping RAM
Mapping ROM

ttya initialized
Probing Memory Bank #0 32 Megabytes
Probing Memory Bank #1 32 Megabytes
Probing Memory Bank #2 32 Megabytes
Probing Memory Bank #3 32 Megabytes
Probing Memory Bank #4 Data Access Error
ok probe-scsi
ok probe-scsi-all
ok boot disk0
Data Access Error
ok boot disk0
Initializing 128 megs of memory at addr 0Level 14 Interrupt
ok boot disk3
Initializing 128 megs of memory at addr 0Level 14 Interrupt
ok boot disk
Initializing 128 megs of memory at addr 0Level 14 Interrupt

Brent said...

I probably should have included test-all output:

Testing /obio/SUNW,fdtwo@0,400000
Testing floppy disk system. A formatted disk should be in the drive.
Selftest failed. Return code = -2977792

Brent said...

After being inspired by your Forth post from August 22, I found that "5 probe-slot" on a SS-5 qemu will make the SCSI and ethernet devices visible to OpenBoot. Show-devs and show-sbus look like they see the devices, but a probe-scsi gives me "Missing initiator id". Naturally, it still won't boot.

Maybe it's not a missing patch but a little Forth magic (perhaps similar to your August 22 post but with different addresses for SS-5?)...

atar said...

Brent, sorry, you'll need one more patch (not scsi-related though). Working on it.

atar said...

Brent, I wrote a OBP/Solaris/sparc mini how-to. To get you going: the only thing which is missing for the OBP loading is -m 256. I don't have any qcow images, so I can not test whether they are better or worse than iso. Let me know.

You can also try playing with the -cpu switch, but I'm afraid the number of sun4m CPUs recognized by a standard OBP is quite low.

The patch I mentioned before: it turned out vanilla qemu still can not boot Solaris beyond kernel. Maybe you are more lucky with the pre-installed hd images (btw, are they from SS-5? SS-10/20 ones may not necessarily be compatible with SS-5).

The problem is (at least) one poorly documented MMU mode. My hack for it is definitely bad, tonight I'll some tests on a real SS which would help to understand why does the hack perform better than the current implementation in qemu.

atar said...

Forgot to mention, test-all makes currently a little sense. The floppy is broken (and is not good documented, and no one wants to mess with it), so the very first test will always fail.

test scsi is not expected to work either: esp test registers are not implemented.

probe-scsi should show connected devices though.

atar said...


SunOS 4.1.4 can be boot the same way as Solaris 2.5.1- now. It would be interesting to know, whether a pre-installed HDD image would do better than the install CD.