Saturday, July 3, 2010

Fixed another bug in the slavio timer emulation

Trying to get NeXTStep/sparc to boot without any success, I got back to the old bug which seemed to be related: some versions of OBP hang at boot waiting for the timer interrupts.

Somehow I got poisoned by the motto of the qemu developers: OBP doesn't work because the initial set-up is wrong. On the real hardware no one would expect BIOS to work if the machine doesn't pass the power-on self test (POST). But then I it came to me that exactly this motto prevented other people to get OBP working under qemu-system-sparc.

So, I went on and asked Mitch, if he thought whether his creation - OBP - was buggy and relied on the [probably missing] POST initialization. Mitch said that he's pretty much sure that the OBP would do the right thing in this case, so I took another look at the qemu timer code, and fixed the bug.

The bug turned out to be unrelated to the NeXTStep boot problem. On the other hand the fix provides the alternatives to SPARCStation-5 emulation. Now it's possible to get SPARCStation-10 firmware to work, which gives 512m to the guest.

Here come some boot logs with the OBP from SPARCStation-10 and LX.

LX:
MMU Context Table Reg Test  
     ERROR : Address = 00000100, exp = 005a5a50, obs = 005a5a40, xor = 00000010
     U-NUMBER : Suspect Tsunami Module

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
Starting real time clock...
Incorrect configuration checksum;
Setting NVRAM parameters to default values.
Setting diag-switch? NVRAM parameter to true
Probing /iommu@0,10000000/sbus@0,10001000 at 4,0  espdma esp sd st SUNW,bpp ledma le
Probing /iommu@0,10000000/sbus@0,10001000 at 0,0  Nothing there
Probing /iommu@0,10000000/sbus@0,10001000 at 1,0  Nothing there
Probing /iommu@0,10000000/sbus@0,10001000 at 2,0  qemu,device-stub mmcodec
Probing /iommu@0,10000000/sbus@0,10001000 at 3,0  cgsix Data Access Error
Type  help  for more information
ok

So, the obvious problem here is that qemu doesn't have cgsix which must be onboard.

SS-10:

 D-Cache RAM Write/Read Test
     ERROR : Address = 00000000,  exp[63:32] = ffffffff, obs[63:32] = 00000000, xor[63:32] = ffffffff
     U-NUMBER : Suspect Viking Module, MBus Slot 0

ttya initialized
Cpu #0 TI,TMS390Z50
Cpu #1 Nothing there
Cpu #2 Nothing there
Cpu #3 Nothing there
Probing Memory Bank #0 64 Megabytes of DRAM
Probing Memory Bank #1 64 Megabytes of DRAM
Probing Memory Bank #2 64 Megabytes of DRAM
Probing Memory Bank #3 64 Megabytes of DRAM
Probing Memory Bank #4 64 Megabytes of DRAM
Probing Memory Bank #5 64 Megabytes of DRAM
Probing Memory Bank #6 64 Megabytes of DRAM
Probing Memory Bank #7 64 Megabytes of DRAM
Starting real time clock...
Incorrect configuration checksum;
Setting NVRAM parameters to default values.
Setting diag-switch? NVRAM parameter to true
Probing /iommu@f,e0000000/sbus@f,e0001000 at f,0  espdma esp sd st ledma le SUNW,bpp
Probing /iommu@f,e0000000/sbus@f,e0001000 at 0,0  Nothing there
Probing /iommu@f,e0000000/sbus@f,e0001000 at 1,0  Nothing there
Probing /iommu@f,e0000000/sbus@f,e0001000 at 2,0  Nothing there
Probing /iommu@f,e0000000/sbus@f,e0001000 at 3,0  Nothing there

SPARCstation 10 (1 X 390Z50), No Keyboard
ROM Rev. 2.10, 512 MB memory installed, Serial #0.
Ethernet address 52:54:0:12:34:56, Host ID: 72000000.


Power-On SelfTest FAILED ... Replace MBUS0 Module

                                                                     
Type  help  for more information
ok

3 comments:

Unknown said...

Probe doesn't show anything for me at all. It has a data access error. I'm using the 12.1 version of Qemu ,which comes with a built in sparc suppot, but I've used their default one as well.

I also have the boot cdrom for SunOS 4.1.4 but it won't read it (dd an image of it with bs=512 & bs=512000 with no luck) It just wont' read it. It can't find the disks!

Our machines at work at 20 years old... we need to Virtualize it to save our company

Unknown said...

I'm assuning I am not using the command right to make it read.

qemu-system-sparc -m 256 -nographic -hda /path_to_img.qcow2 -hdb /path_to_cd_iso -boot d

ok boot disk1:h -vs

Loads RAM

Data Access Error

Here is a full print out:

root@test:/home/vm/Sparc5# qemu-system-sparc -m 256 -nographic -bios ./ss5.bin -hda img.qcow2 -hdb 1.1.2.iso -boot d

Power-ON Reset

$$$$$ WARNING: No Keyboard Detected! $$$$$
MMU Context Table Reg Test
MMU Context Register Test
MMU TLB Replace Ctrl Reg Tst
MMU Sync Fault Stat Reg Test
MMU Sync Fault Addr Reg Test
MMU TLB RAM NTA Pattern Test
ERROR : Address= 000000fc, exp= 07ffffdc, obs= 00000000, xor= 07ffffdc
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 32 Megabytes
Probing Memory Bank #5 32 Megabytes
Probing Memory Bank #6 32 Megabytes
Probing Memory Bank #7 32 Megabytes
Incorrect configuration checksum;
Setting NVRAM parameters to default values.
Setting diag-switch? NVRAM parameter to true
Probing CPU FMI,MB86904
Probing /iommu@0,10000000/sbus@0,10001000 at 5,0 espdma esp Data Access Error
Type help for more information
ok probe
Probing /Memory Address not Aligned
ok probe-all
Probing /iommu@0,10000000/sbus@0,10001000 at 5,0 espdma esp Data Access Error
ok

atar said...

The version 0.12 is way too old. Otherwise, have you looked into the howto?