Sunday, December 13, 2009

Solaris/sparc under qemu how-to

This document attempts to answer basic questions on how to set up qemu-system-sparc so that it can boot Solaris. The current version of this how-to is available under http://tyom.blogspot.com/2009/12/solaris-under-qemu-how-to.html. The emulation of sparc system is still being improved, so this document will probably be updated.

Disclaimer

Reading, understanding and using the Howto is by no means a guarantee for successfully finishing the task, and any mechanical failure, accident, psychological trauma or other cataclysm that may result from using the Howto is entirely your own responsibility and liability.

List of supported Solaris versions

Currently the versions 1.1.2 (SunOS 4.1.4), 2.2 (SunOS 5.2), 2.3 (SunOS 5.3), 2.4 (SunOS 5.4), 2.5.1 (SunOS 5.5.1), 2.6 (SunOS 5.6), 7 (SunOS 5.7), 8 (SunOS 5.8) and 9 (SunOS 5.9) are supported.

Kernel debugger (kadb) can be loaded for the versions 1.1.2 (from a HDD image) and 2.2 - 9 (from a HDD image or an install CD/DVD).

Solaris 10 and OpenSolaris do not support 32 bit SPARC platforms, so they can never be booted under qemu-system-sparc. (Some day they maybe will be booted under qemu-system-sparc64 though).
The versions prior 1.1.1 and 2.0-2.1 do not support SPARCstation-5 or SPARCstation-20, so they can not be booted. The version 2.2 can be booted in the SPARCstation-20 emulation mode only (the exact steps are not yet described in this howto).

The version 1.1.1 is not yet tested. Reports or/and boot disks are welcome.

List of supported Firmware versions

OpenBIOS 1.0+ can boot some Solaris versions. Please, try it first, and if doesn't work for you, send reports to the OpenBIOS mailing list.

The proprietary OpenBoot PROM (OBP) can boot all the Solaris versions available for the sun4m architecture (see the previous chapter). The SPARCstation-5 OBP versions 2.15 and 2.29 are known to work. The SPARCstation-20 revisions 2.15, 2.22 and 2.25 work only for some guest CPU models. If you have tested other OBP versions please let me know.

Compiling qemu-system-sparc

The qemu version 0.13+ is capable of booting some Solaris versions. In order to run Solaris 2.6+, a QEMU 2.5.91+ (April the 12th, 2016) is required. Indeed, some bugfixes or features are only included in the "bleeding edge", a.k.a git master. Compiling master is straightforward:

git clone git://git.qemu.org/qemu.git
mkdir -p qemu/build
cd qemu/build
../configure --target-list=sparc-softmmu
make

Launching qemu with OpenBIOS to boot from a cdrom image

As of today (svn.r1246) OpenBIOS can boot the following Solaris versions:

SunOS Release 5.7 Version Generic_106541-02
SunOS Release 5.7 Version Generic_106541-08
SunOS Release 5.8 Version Generic_108528-09 32-bit
SunOS Release 5.8 Version Generic_108528-29 32-bit
SunOS Release 5.9 Version Generic_112233-10 32-bit
SunOS Release 5.9 Version Generic_118558-34 32-bit

Launch command:
sparc-softmmu/qemu-system-sparc -M SS-5  -nographic -prom-env 'auto-boot?=false' -cdrom Solaris8.iso


The option -prom-env 'auto-boot?=false' is optional. It allows specifying Solaris boot options, like -v and/or -s and/or -b. If no boot options are required, the command line option -boot d can be used instead.

The option -nographic is handy, because the emulated default graphic card (TCX) is not compatible with Solaris X-Window system. Nevertheless it can be omitted when booting in text console (e.g. single user mode, or installation without X-Window).

If the option -prom-env 'auto-boot?=false' is used, type
 boot cdrom:d -v
at the "0 >" prompt.

The versions known to boot with OBP, but not with OpenBIOS:

SunOS Release 4.1.4 (MUNIX)
SunOS Release 5.2 Version Generic
SunOS Release 5.3 Version Generic
SunOS Release 5.4 Version Generic
SunOS Release 5.5.1 Version Generic
SunOS Release 5.6 Version Generic

Launching qemu with OBP to boot from a cdrom image

Solaris 2.6 and above:

sparc-softmmu/qemu-system-sparc -M SS-5  -bios /path/to/ss5.bin -nographic -cdrom Solaris2.6.iso

Solaris 2.5.1 and earlier:

sparc-softmmu/qemu-system-sparc -M SS-5 -startdate "2009-12-13" -bios /path/to/ss5.bin -nographic -hdb Solaris2.5.1.iso

The option -startdate "2009-12-13" is necessary for the older QEMU versions, which have the y2010 bug. It's not necessary for QEMU 1.2+.

The option -nographic is handy, because the emulated default graphic card (TCX) is not compatible with Solaris X-Window system. Nevertheless it can be omitted when booting in text console (e.g. single user mode, or installation without X-Window).

Successfully initialized OBP should print lines like this:

SPARCstation 5, No Keyboard
...
Type help for more information
ok

booting Solaris in a single user mode from a CD-ROM
at the ok prompt:

Solaris 2.6+:

boot disk2:d -vs

Solaris 2.5.1-:

boot disk1:d -vs

booting Solaris kernel debugger from a CD-ROM
at the ok prompt:

Solaris 2.6+:

boot disk2:d kadb -kdv
Solaris 2.5.1-:

boot disk1:d kadb -kdv
If you are going to debug the kernel, I recommend you to read the PANIC! UNIX System Crash Dump Analysis Handbook. The kernel debugger is a really powerful tool and the book helped me a lot to learn how to use it and shed a lot of light on Solaris internals.

booting Solaris from a HDD image
To be able to boot from a hdd image, add the following line to the /etc/system on the hard drive:
set scsi_options=0x58

Normally during the Solaris installation process the hard drive is mounted under /a, so it can be done with
# cat >> /a/etc/system
set scsi_options=0x58
^d
right after the installation. Hence it's recommended to switch off the automatic reboot  option when the installer asks for it.

If the steps above are not performed, the HDD boot fails with the error message:
cannot mount root on /iommu@0, 10000000/sbus@0, 10001000/espdma@5, 8400000/esp@5, 8800000/sd@0,0

Comments & reports are welcome. Here and at the qemu-devel mailing list.

Last updated on 11.04.2016.

/Happy hacking

354 comments:

«Oldest   ‹Older   201 – 354 of 354
Nigel Horne said...

Any clues what I have to tell it to boot? I tried all sorts of things before I posted here e.g. 'boot cdrom; boot cdrom1'

atar said...

Nigel, please read the how-to.
1. Solaris 10 doesn't support 32 bit SPARC machines.
2. boot command is
boot disk2:d

Nigel Horne said...

As noted, I tried all boot options before posting here. For example:

ok boot disk2:d
Boot device: /iommu/sbus/espdma@5,8400000/esp@5,8800000/sd@2,0:d File and args:

Can't find /openprom/client-services
ok

atar said...

But it's still a Solaris 10 media, right?

Anonymous said...

hello my friend
I will install minimal solaris 7 under qemu 0.14.1 on windows XP
and run very good (run level 3)
I have solaris7.disk qemu image now under SS5 prom.
I install with iso cdrom (boot disk2:d) and install it very well
of course i have more error but I solve it after install it.
I can share image disk if you want

Nigel Horne said...

I would like an ISO of Solaris 7 for Sparc, could you please share it? Thanks!

bitje said...

SPARCstation 5 will not boot solaris 10. You will need sparc64 to emulate the IIi.

nyet said...

Got 2.6 installed and running with latest git tree.. Boots fine in single user mode, but I had to disable S74syslogd

If I don't it just hangs at "syslog service starting".

Eventually, it spits out

Assertion failed: MUTEX_HELD(&svc_mutex), file rpc/svc_run.c, line 754

But thats it. Hung dead.

Also, occasionally I get

signal fault in critical section
signal number: 11, signal code: 1, fault address: 0xef75006c, pc: 0xef7d5cf0, sp: 0xeffff4f8
libthread panic: fault in libthread critical section (PID: 144 LWP 1)
stacktrace:
ef689908
ef691d3c
ef7d5ce4
ef7d70ac
ef7d471c
ef7d51a8
ef7d3d6c
ef7dbf88
ef7dbbc4
ef7dbcc0
ef7dbe24
21f78
1468c
1440c
0


and

Run-time error, libC:
Trying to release a lock that was not acquired in this thread
Abort - core dumped

Anonymous said...

has there been any progress on booting Solaris10 (now that qemu version 0.15 is available) ?

thanks.

atar said...

No. I currently don't have the time to merge my code upstream. Maybe for Christmas 2013...

Anonymous said...

:(
shame, 64bit and Sol10 would be really cool.

btw, how do you change the disc in cdrom?
(Ctrl-Alt-2 does not work)

Anonymous said...

I did a complete install of Solaris 9, but when booting from hard drive image, it hangs with this error:
"Starting Web Start Launcher in Command Line Mode."
?

atar said...

The official qemu version can boot Solaris 2.3+ in Single-User mode only (as written in the how-to).

atar said...

shame, 64bit and Sol10 would be really cool.

Well, since Solaris is not open anymore, giving anything for free here is not a good marketing. Free OS - free tools to run it. Commercial OS - commercial tools to run it.

btw, how do you change the disc in cdrom?(Ctrl-Alt-2 does not work)

Start qemu monitor on another port and telnet to it.

Anonymous said...

ok, at least 32bit works quite nice.
thanks atar for everything.
I solved the 'web start' problem by disabling this service from maintenance mode:

rc2.d/S96webstart

Anonymous said...

hi. is it possible today to boot solaris 10 for sprac 64 platform under qemu?

atar said...

You'll have to either modify qemu to add some missing devices, or modify Solaris 10 making it not to look for them.

Why would you need emulating Sparc Solaris 10 anyway?

Anonymous said...

we work on a multi-platform software development and it would be useful to test also over solaris sparc 64 bit OS without the need of the expensive sun sparc hardware.

Guus said...

nyet,
I also had syslogd problems with Solaris 2.6. These problems disappeared after installing 2.6_Recommended.tar.Z from ftp.lanet.lv/pub/sun-info/sun-patches/.
I reckon that 106439-13 is the actual fix but I didn't test that.
The patches may be useful for nfs and libthread (105568-26) problems as well.
You might have a problem getting the patches on the diskimage. I did that by mounting the Solaris disk on a NetBSD/Sparc qemu but I think it should be possible using the network as well.

Thayne said...

I'm trying to boot an iso for solaris 6 in qemu.

I found that using ss5.bin yields this error: qemu: could not load prom 'ss5.bin'

So I found another bios file and gave it a try like this:

qemu-system-sparc -boot d -cdrom sol6_installcd.iso -hda sparcSol2_6.qemu.img -M SS-5 -m 256 -bios openbios-sparc32 -nographic

When I do, I get this:

Configuration device id QEMU version 1 machine id 32
CPUs: 1 x FMI,MB86904
UUID: 00000000-0000-0000-0000-000000000000
Welcome to OpenBIOS v1.0 built on Sep 28 2011 20:47
Type 'help' for detailed information
Trying cdrom:d...
Not a bootable ELF image
Not a bootable a.out image
No valid state has been set by load or init-program

0 > boot disk2:d -vbs No valid state has been set by load or init-program
ok
0 >

I know this is a valid boot disk since I copied it straight from the install CD like this:
dd if=/dev/cdrom of=sol6_installcd.iso

Could this be a bios problem?

atar said...

Yes. ss5.bin is the original Sun OBP which is more stable than OpenBIOS. The answer you are looking for is in the paragraph "List of supported Firmware versions" of the how-to.

If you prefer using OpenBIOS, you can try to give the following command for booting:

boot cdrom:d -vbs

and report the progress to openbios@openbios.org

AdrianR said...

Hi - is the information here still current? Trying to boot a SPARC box with qemu in Amazon EC2. I have RedHat 5.7 64 bit, use the command:

qemu-system-sparc -M SS-5 -bios ./ss5.bin -nographic

just to see what happens, seems to start OK but gets as far as "Starting real time clock..." and hangs.

Using pre-built qemu rpm, qemu-0.14.1-2.el5.rfx.x86_64.rpm

Thanks,

atar said...

AdrianR, have you tried to wait longer? EC2 is a virtual environment itself, there might be some issues with the timer/precision emulation. Can you post the complete boot log?

Also can you try passing the
-startdate "2009-12-13"
option?

AdrianR said...

OK, well interestingly today I tried the same command and got a lot further, without any waiting - to the "Keyboard not present. Using tty for input and output", so that's good.

On the other hand, I read your how-to more carefully and now I think that what I want is not possible. I need to host Solaris 10 and you say "
Solaris 10 and OpenSolaris do not support 32 bit sparc platforms, so they can never be booted under qemu-system-sparc. (Some day they maybe will be booted under qemu-system-sparc64 though)."

So to check I have understood - Solaris 10 is now 64 bit, and will not work with qemu - true?

Brent said...

I have a complete Solaris 9 setup installed and running under qemu-1.0. The OpenBios included with qemu-1.0 worked fine, no need for a Sun OBP image, but only with SS-5. SS-10 and SS-20 hang early on in the boot.

Has anyone been able to get Solaris running under qemu as a SS-10 or SS-20? I can live with being single-processor, but it would be nice to run with more RAM than 256MB...

atar said...

Brent, does SS-20 hang in early boot under OBP? It used to work fine, I don't remember whether I needed to apply the Framebuffer patch from Bob Breuer though.

Also I think that 256m limit with SS-5/OpenBIOS is purely artificial, so you have a choice.

Anonymous said...

Where does 'Solaris2.6.iso' come from?
I have the CDs. Is it created from them? How?
I'm running RHEL 6 on x86_64.

Thank you

egleites

atar said...

Just as usual, something like

dd if=/dev/cdrom of=my_sol_image.iso

Thayne said...

I was able to install and run a Solaris 6 image from iso.
Now I'm trying to install and run a Solaris 8 image from iso.
When I booted from the install cd, it said "Copying mini-root to local disk." Then rebooted.
After reboot, I get some errors saying it cannot mount root.

I went back in and changed the /etc/system to set the scsi_options

Then tried:
boot disk0 -vb
I also tried:
boot disk0 -vs
and both give the same error.

I see in some of the posts that others have had success with Solaris 8 & 9. Is there a trick here that I'm missing?


Copying platform specific files....done.

Preparing to reboot and continue installation.
Rebooting to continue the installation.
Syncing file systems... 41 done
rebooting...
Resetting ...

So now there's this mini-root installed to my disk.

atar said...

Thayne, how did you edit the /etc/system? Are you sure you've edited the target one?
I don't remember anything special with installing Solaris 8 compared to 2.6

Thayne said...

To edit /etc/system, I booted in single user mode from the iso, mounted the disk to /a via: "mount /dev/dsk/c0t0d0s2 /a" and then used vi to edit /a/etc/system. Then I rebooted off the disk.
Note that I tried booting with and without the change to /etc/system, but I get the same result either way.

Thayne said...

By the way, here's the output with the error:
ok boot disk0
Boot device: iommu/sbus/espdma@5,8400000/esp@5,8800000/sd@0,0 File and args:
Size: 264120+54502+47926 Bytes
SunOS Release 5.8 Version Generic_108528-29 32-bit
Copyright 1983-2003 Sun Microsystems, Inc. All rights reserved.
Ethernet address = 52:54:0:12:34:56
Using default device instance data
vac: enabled in write through mode
mem = 262144K (0x10000000)
avail mem = 258363392
root nexus = SUNW,SPARCstation-5
iommu0 at root: obio 0x10000000
sbus0 at iommu0: obio 0x10001000
dma0 at sbus0: SBus slot 5 0x8400000
dma0 is /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000 /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000 (esp0): esp-options=0x46
esp0 at dma0: SBus slot 5 0x8800000 sparc ipl 4
esp0 is /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000
Cannot assemble drivers for root /iommu@0,10001000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@0,0:a
Cannot mount root on /iommu@0,10001000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@0,0:a fstype ufs

panic[cpu0]/thread=f0244020: vfs_mount_root: cannot mount root

f0243ac0 genunix:vfs_mountroot+68 (f0261800, 44000e1, 0, 44000e1, 8, 0)
%10-7: f0261800 f02644a8 00000000 00000000 00000000 f024beac f028b000 f024f400
f0243b20 genunux:main+8c (1, 4400fe0 2000, 44000e0, 81c52000, f005b8f4)
%10-7 f5901000 f0243b88 00101684 043d1f01 043d1f03 00000004 ffef0000 00000e00

atar said...

Strange. It definitely looks like a /etc/system problem. Probably, your Solaris 8 is using /etc/system from a ram-disk packed into the miniroot image. In this case, you'll have to modify the ram-disk image.

There is one more thing you can try with Solaris 8. I haven't tested it, but some versions of Solaris 8 are reported to work with OpenBIOS.

You can try using OpenBIOS (by not providing the -bios command line option if you have the current qemu version), and boot with

boot disk0:a

Bytec said...

Hello,
has anyone managed to run a solaris 8 sparc run with more than 1 CPU or more than 256 MB granted to the machine?

It seems only the Machines SS-10, SS-20 and SS-600MP seem to support these settings with qemu,
but when I try, the machine just hangs in there shortly after identifying the MAC adress.
I've used a qemu 0.15 and compiled it in the way Artyom decribed above, but only the standard settings worked for me, which resulted in a ca.107-Mhz single-core and 256 MB RAM machine.

Any ideas?

atar said...

More than 1 cpu makes less sense, at least for performance. Currently qemu can utilize only one host cpu regardless of the number of the guest cpus. I.e. if you have guest two cpus, they will both work at a half speed.

107Mhz - that's strange. How do you measure this and what is your host? On a 2.66GHz Intel cpu, Solaris tells that it sees a 1Ghz SS-5.

Bytec said...

Sorry, 170 Mhz, that was a typo.
Solaris returns

# psrinfo -v
Status of processor 0 as of: 01/13/12 16:46:07
Processor has been on-line since 01/13/12 16:45:20.
The sparc processor operates at 170 MHz,
and has a sparc floating point processor.




I started like


sparc-softmmu/qemu-system-sparc -hda /path/to/disk -nographic -net tap,vlan=0 -net nic,vlan=0 -monitor tcp:127.0.0.1:2704,server,nowait -cdrom /path/to/iso




On my host system:
cat /proc/cpuinfo |egrep "processor|model\ name|MHz"
processor : 0
model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
cpu MHz : 2400.226
processor : 1
model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
cpu MHz : 2400.226
processor : 2
model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
cpu MHz : 2400.226
processor : 3
model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
cpu MHz : 2400.226
processor : 4
model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
cpu MHz : 2400.226
processor : 5
model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
cpu MHz : 2400.226
processor : 6
model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
cpu MHz : 2400.226
processor : 7
model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
cpu MHz : 2400.226


One cpu on solaris would be OK, if it operated accordingly.

qemu-system-sparc -version
QEMU emulator version 1.0.50

atar said...

AFAIK, psrinfo just reads the corresponding bits from OBP/CPU. It's not a benchmark.

Tom said...

I have the same problem with booting Solaris after successful CD installation. Of course I added scsi option in /etc/system file but it didn't help.

ok boot disk0
Boot device: /iommu/sbus/espdma@5,8400000/esp@5,8800000/sd@0,0 File and args:
SunOS Release 5.9 Version Generic_112233-07 32-bit
Copyright 1983-2003 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
Cannot mount root on /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@0,0:a fstype ufs

panic[cpu0]/thread=f0244020: vfs_mountroot: cannot mount root

f0243ac0 genunix:vfs_mountroot+68 (44000e3, 44000e3, 0, 44000e3, f027f934, f0247c00)
%l0-7: f0277400 f0277400 f02ab2b0 f02a9170 f02a7c00 f024c05c f0277800 f027a000
f0243b20 genunix:main+98 (4400fe0, 4400fe0, 293ff49f, 44000e0, 81c52000, f005bc84)
%l0-7: 00000001 00000000 f02a65dc 00000000 00002000 f026ac00 f0260304 f0091894

skipping system dump - no dump device configured
rebooting...
Resetting ...




Tested installation of Solaris 8 and Solaris 9 with the same result.

The only Solaris version which I can run from disk file is 2.4 (http://vpsland.superglobalmegacorp.com/install/qemu/solaris24minimal.disk.gz), but in this version network is not working :(

Qemu with OpenBIOS (up to 1047) boots only from CDROM, when I try boot from disk I get:


Configuration device id QEMU version 1 machine id 32
CPUs: 1 x FMI,MB86904
UUID: 00000000-0000-0000-0000-000000000000
Welcome to OpenBIOS v1.0 built on Jan 8 2012 13:45
Type 'help' for detailed information

0 > boot disk0:a Not a bootable ELF image
Loading a.out image...
Loaded 7483136 bytes
entry point is 0x4000
bootpath: /iommu/sbus/espdma/esp/sd@0,0:a

Jumping to entry point 00004000 for type 00000005...
switching to new context:
(is ?
Unhandled Exception 0x00000007
PC = 0xffd073a4 NPC = 0xffd073a8
Stopping execution


Does someone have a working Solaris 8 or 9 disk file image?

Regards.
Tom.

atar said...

Tom, I guess under OpenBIOS it has to be "disk", not disk0:

boot disk:a

Bytec said...

Ok, it's because I'd like to make the server perform faster as I need
a replacement for a solaris machine and at the moment it's far to slow.
Is there a way to make qemu operate with either of -M "SS-10" / "SS-600MP" / "SS-20" ? As mentioned, those are the only ones that seem to support RAM > 256 MB, but they fail to start. I tried different "-cpu"-settings as well, no luck with those either...

atar said...

Yes, both SS-10 and SS-20 work fine with the corresponding proms.

Tom said...

Atar:

I used "boot disk" or "boot disk:a" - the same problem...


0 > boot disk:a Not a bootable ELF image
Loading a.out image...
Loaded 7483136 bytes
entry point is 0x4000
bootpath: /iommu/sbus/espdma/esp/sd@0,0:a

Jumping to entry point 00004000 for type 00000005...
switching to new context:
(is ?
Unhandled Exception 0x00000007
PC = 0xffd073a4 NPC = 0xffd073a8
Stopping execution

atar said...

Tom, and your disk with miniroot is plugged as hda, right?

Then, the only option I see is editing the ram-fs image.

Tom said...

Tom, and your disk with miniroot is plugged as hda, right?

Yes

Then, the only option I see is editing the ram-fs image.


Where is located ram-fs image and which tool must I use to edit and repack image?

Bytec said...

Hello Atar,

thanks, you really helped me a lot. I wasn't aware that certain machines would not start without a 'cpu'-Option. I started like this now:

sparc-softmmu/qemu-system-sparc -hda /path/to/img -nographic -net tap,vlan=0 -net nic,vlan=0 -monitor tcp:127.0.0.1:2704,server,nowait -M SS-20 -bios /path/to/bios/ss20_v2.25_rom -startdate "2009-09-05" -m 512 -boot c -smp 2 -cpu "TI SuperSparc 40" -cdrom /path/to/iso

After

boot disk2:d -v

I was able to start and install Solaris.

Unfortunatly, rebooting and starting
with

boot disk0:d -v

resulted in the "good Wrong packet length"-error
here and solaris will not come up.

Any idea what I'm doing wrong?

First I thought it is because of the
"booting Solaris from a HDD image" which
I left out unintentionally, but the error is quite different...

atar said...

Tom, it's not qemu specific. You can try searching though Solaris forums.

atar said...

Bytec, how exactly does it fail? Have you tried to boot from the CD?

SS-20 uses a slightly different disk numeration as SS-5, so booting from a SS-5 disk image won't directly work.

Bytec said...

Hi,

I tried to boot from HDD after Installation. Anyway, I just noticed that the qemu seemed to have rebooted without be noticing it:

Cannot assemble drivers for root /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@0,0:a
Cannot mount root on /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@0,0:a fstype ufs

panic[cpu0]/thread=f0244020: vfs_mountroot: cannot mount root
(...)
skipping system dump - no dump device configured
rebooting...
Resetting ...


Followed by many pages of booting messages. After reboot he fails with

Rebooting with command:
Boot device: /iommu/sbus/ledma@f,400010/le@f,c00000 File and args:
Internal loopback test -- Wrong packet length; expected 36, observed 64

So the problem is in /etc/system, as you said in you blog. Do you know whether I have to reinstall or can this be fixed differently?

Thayne said...

I figured out a workaround to my problem with the Solaris 8 install. I was poking around in some solaris 8 install procedures and noticed that from a tty terminal it is recommended to use the "Solaris 8 Software" CDs 1 and 2 instead of the "Solaris 8 Installation" CD.
So I tried using the "Software" CDs and it worked fine. I never ended up installing the packages from disk 2 though but it is running stable.
Tom,
If you have the disks labeled "Solaris 8 Software", give those a try - you can thus avoid headaches dealing with the mini root thing.

atar said...

Bytec, yes, you just need to boot into the single user mode from CD, mount your hdd under /a and add the line to /a/etc/system .

Tom said...

from a tty terminal it is recommended to use the "Solaris 8 Software" CDs 1 and 2 instead of the "Solaris 8 Installation" CD.

Yes! It works!!!
Thank you Thayne!

That is the solution for solaris installation, no more resetting during installation and no kernel panics!

I was able to install Solaris 7 and Solaris 8 in that way.

My next problem is network. I used "-net nic,vlan=0 -net user,vlan=0" options but it does not work (the same in Solaris 2.4, 7 and 8). The qemu is started with root permissions, host address is 172.16.172.121 and Solaris uses 172.16.172.129. I cannot ping any outside host (e.g. gateway 172.16.172.1) from Solaris.

atar said...

Pinging outside hosts won't work, as the user-mode networking in qemu doesn't implement this feature. Pinging gateway should work though. Your ip address is strange. By default the guest ip is 10.0.2.15 and the gateway for the guest is 10.0.2.2. Can you try this?

Tom said...

Thanks atar!

It's my fault, RTFM :). I changed an IP adress to 10.0.2.15 and gateway's to 10.0.2.2 and can do ftp to host machine.
Is there a simple way to publish some guest services (e.g. SMTP, TELNET) to be accessable from outside?

atar said...

Easy for telnet. Take a look at the redir option documentation. Also I wrote a post about ssh tunneling some time ago.

Bytec said...

Ok, that worked, thanks!
Now I'm able to start Solaris with 512 MB, more tests to follow (although I had to restart 3 times because the installer dumped core).

It seems Openbios itself does not support booting these machines by default and the '-bios' is needed explicitly: every combination I tried without "-bios" failed on me by "hanging" the qemu.
Is there a list which combinations ought to work?

Dimi said...

Hi,
Now what to do from that step ? how can I tell it to boot something ? I mean the solaris image ... ? I'm a linux newbie, so, please take it slow with me ! thank you ! Dimi.

Dimi said...

Hi,
Managed to install - the menus appeared with language and stuff - but when it comes to label I get this error :

arning: error reading backup label.
WARNING: /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@0,0 (sd0):
Error for Command: read(10) Error Level: Fatal
Requested Block: 0 Error Block: 0
Vendor: QEMU Serial Number:
Sense Key: Illegal Request
ASC: 0x21 (logical block address out of range), ASCQ: 0x0, FRU: 0x0
Illegal request during read: block 0 (0x0) (0/0/0)
ASC: 0x21 ASCQ: 0x0
Warning: error reading backup label.
Warning: no backup labels
Label failed

What to do next ?
Thanks,
Dimi.

Dimi said...

hi,

I ended up here :

One or more disks are found, but one of the
following problems exists:

> Hardware failure

> Unformatted disk.

But I have previously formatted disk0.

How can I deal with this ?
Thanks.

atar said...

How did you produce and format the image? What Solaris version are you using?

joy said...

great blog man!
im wondering if you could also share the ss20_v2.22.3.bin boot rom? like the one you used on this?

i can't get the 2.25/2.25r revisions to work on all the cpu models. i mean, i can boot in single-user mode, then install from cdrom. but then when i reboot it to finally boot from hd, qemu hangs..

i'll do the test in a sec, and then post the output here. :)

joy said...

here's my output:

./qemu-system-sparc -m 512 -hda sparc.disk -cdrom sparc.iso -bios ./ss20_v2.25_rom -net nic,vlan=1,macaddr=00:aa:00:00:aa:aa -net tap,vlan=1,ifname=tap1 -nographic -M SS-20 -cpu "TI SuperSparc 50" -boot c


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
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 e,0
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
screen not found.
Can't open input device.
Keyboard not present. Using tty for input and output.


SPARCstation 20 (1 X 390Z50), No Keyboard
ROM Rev. 2.25, 512 MB memory installed, Serial #0.
Ethernet address 0:aa:0:0:aa:aa, Host ID: 72000000.


Power-On SelfTest FAILED ... Replace MBUS0 Module

Type help for more information
ok boot disk0:
Boot device: /iommu/sbus/espdma@f,400000/esp@f,800000/sd@0,0: File and args:
SunOS Release 5.6 Version Generic_105181-05 [UNIX(R) System V Release 4.0]
Copyright (c) 1983-1997, Sun Microsystems, Inc.
configuring network interfaces:qemu: fatal: Trap 0x29 while interrupts disabled, Error state
pc: f0041284 npc: f0041284
General Registers:
%g0-7: 00000000 f025d170 40401fc2 f597e3db 00000004 fbfaeb80 00000001 f59685a0

Current Register Window:
%o0-7: ffff8000 00008000 00000f00 404010c1 f5c7b508 ffee2000 fbe1e4b8 f0041c58
%l0-7: 40801fc1 f0041cec f0041cf0 00000002 0000010f 00000002 00000007 fbe1df78
%i0-7: ffff8000 00008000 00000f00 404010c2 f5d33d70 ffee2000 fbe1e020 f0041c58

Floating Point Registers:
%f00: ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff
%f08: ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff
%f16: ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff
%f24: ffffffffffffffff ffffffffffffffff ffffffffffffffff 0000000000000000
psr: 40001fc1 (icc: ---- SPE: SP-) wim: 00000002
fsr: 00000000 y: 01c00000
Aborted


./qemu-system-sparc -version
QEMU emulator version 1.0, Copyright (c) 2003-2008 Fabrice Bellard


i've tried most of the guest cpu models but same output.
SS-5 is working fine though.

atar said...

Joy, just do the steps described in the post. As you already read there are two types of boot screen messages. Bad are marked red, and good are marked green.

atar said...

"Power-On SelfTest FAILED ... Replace MBUS0 Module" is bad.

Tom said...

Hi again!

I'm looking for a method to shutdown cleanly a guest machine (Solaris8). I tried to enter "system_powerdown" command via monitor, but Solaris ignores this signal (powerd daemon is running).
Is there a safe way to shutdown a guest?

atar said...

poweroff
(as root)

Tom said...

BTW better is "init 5", but I'd like to run qemu as a service via script with start|stop arguments. Starting is easy, qemu even saves pid in the file, but stoppping is problematic. I don't like to login as a root to guest system (security issue) and enter poweroff command. The best would be to send some signal (i.e. powerfail) to qemu which should forward it to guest system to perform a gracefull shutdown.

Tom said...

Ok. I have already managed with gracefull shutdown.
Another question: Is there a way to lower the CPU usage of quemu process? It always uses over 100% of CPU

atar said...

@Tom,

how did you implement the graceful shutdown? And btw, why "init 5" is better than "poweroff"? The shutdown process looks the same to me.

Reducing CPU consumption is tricky: SPARC v8 doesn't have a "halt" instruction which is used to stop an Intel CPU when it's not used.

I could find no documentation how CPU power management is implemented in sun4m world. If you find the documentation, we can take a look whether it can be implemented in qemu.

Tom said...

"poweroff" command just sends TERM signal to all proceses and then shutdowns the machine. When some process is not responding it simply kills it. "init 5" uses /etc/rcX.d/Kxx scripts to sequentionally stop services with them shutdown dependencies. It takes more time to shutdown, but it's more safety.

My idea for stopping qemu process is easy:

1. Run qemu with two serials "-serial telnet::6666,server,nowait -serial unix:/var/run/qemu.socket,server,nowait"
2. First serial (console - /dev/term/a) is used for guest machine management (via telnet), the second serial (/dev/term/b) is used for controlling the start/shutdown of guest.
3. Write a simple bash script:

#!/bin/bash

exec &>/dev/term/b
while read line; do
[ "$line" = "STATUS" ] && echo "OK"
[ "$line" = "STOP" ] && init 5 && break

done < /dev/term/b


Copy it to /root/bin/sysctrl.sh file on guest machine and add this line to /etc/inittab:
c2:234:once:/root/bin/sysctrl.sh

4. Now the solaris can be simply controlled via /var/run/qemu.socket. In linux I use the "socat" tool to send/receive commands via socket to guest system:
echo "STATUS"|socat STDIO UNIX-CONNECT:/var/run/qemu.socat,rcvtimeo=2,sndtimeo=2 - to check if system is ready.
echo "STOP"|socat STDIO UNIX-CONNECT:/var/run/qemu.socat,rcvtimeo=2,sndtimeo=2 - to init gracefull shutdown.

5. Qemu start script (/etc/init.d/qemu.sh) uses socat to control starting and stopping of Solaris.

Anonymous said...

I'm new to qemu so please forgive me if I am asking the obvious. I'm trying to run Solaris 10 on sparc 64 under qemu 1.0.
Should this be working? What am I doing wrong? Any help?

qemu-system-sparc64 -nographic -cdrom sol-10-u10-ga2-sparc-dvd.iso -prom-env 'auto-boot?=false'

OpenBIOS for Sparc64
Configuration device id QEMU version 1 machine id 0
kernel cmdline
CPUs: 1 x SUNW,UltraSPARC-IIi
UUID: 00000000-0000-0000-0000-000000000000
Welcome to OpenBIOS v1.0 built on Sep 28 2011 20:48
Type 'help' for detailed information

0 > boot cdrom:d -v Not a Linux kernel image
Not a bootable ELF image
Not a bootable a.out image

Loading FCode image...
Loaded 7420 bytes
entry point is 0x4000
Unhandled Exception 0x0000000000000030
PC = 0x00000000ffd19e88 NPC = 0x00000000ffd19e8c
Stopping execution

Philip Wittamore said...

Thank you for your hard work.
I have Sparc Solaris 2.5.1 running in Qemu 1.0.1 just fine for my purposes, which is generating flexlm licenses with old sparc binaries. One question, is there any way I can tell qemu to boot disk0 automatically instead of entering it manually each time? I presume it's because the nvram cannot be saved and reloaded from ss5.bin

atar said...

Thanks for sharing the experience!

The problem here is not ss5.bin (aka OBP, aka PROM) loading, but the nvram. Although QEMU uses the format derived from a later (I guess sun4v) version of OBP, it looks like it's not compatible with the other OBP versions. There are two possible solutions:

- the hard one: try to deduct which nvram format does ss5.bin use, and adjust qemu accordingly. It would allow control OBP NVRAM, just like it works now for OpenBIOS - via the -prom-env QEMU's command line parameter.

- the easy one: add ability for qemu to save/restore the NVRAM contents. I think there was a patch for this from Robert Reif a few years ago, which for some reason was not accepted into mainstream.

Michael De Armon said...

Hello. I'm not a super techie. Kinda doing this out of need, rather than interest. I have an old sparc5 still running an apt program - and I show up and I'm like "We really need to upgrade to a new system". The prgrammers are like... "Well, it will take 5 years to convert all the code to a new code that will run on new stuff". I'm like $h!t...

So the machines are 25 years old and I'm thinking they may die any second....

I did all the steps here, save for booting form a CD, which I don't have.

I have a DD image of all the partitions from the sparc 5 machine (running Solaris 1.1.2 - or SunOS 4.1.4 - whichever you wanna call it).

I have qemu. I have the bios.

Now I just need to know how to boot from the dd img's I create. Or what my next steps would be.

I've already compiled the qemu to support sparc.

Any simple extra's I could do (or at least explained like as if to a dog or a cat) would be very much appreciated.

Thanks!

Mike D

atar said...

Michael, that's easy. You need the slice number 2 - which is the complete disk.

Assuming this is the disk #0, its dump under Solaris would be produced with something like
dd if=/dev/dsk/c0t0d0s2 of=disk0.img

And then you just plug the disk0.img into qemu:

qemu-system-sparc -nographic -drive if=scsi,unit=3,file=disk0.img

Then you can boot it under qemu with

ok boot disk

I still recomend to use the single user mode for the free qemu version, because it's not stable otherwise.

Basil said...

I am trying to install Solaris 2.5.1. I am able to bring it up into single user mode and then exit out of that to the install portion of the iso image (i.e. the cd).

My questions from here (maybe not even in the scope of this blog) are:

- I am given a choice of 13 system types to install to. The obvious options to me are 8=Sun Workstation, or 12=xterm. I am assuming xterm here but am unsure.

- Once the option is selected, I go through the system identification and it starts to install but quickly stops, saying it could not label disks. How do I work around this?

Basil said...

I am trying to install Solaris 2.5.1. I am able to bring it up into single user mode and then exit out of that to the install portion of the iso image (i.e. the cd).

My questions from here (maybe not even in the scope of this blog) are:

- I am given a choice of 13 system types to install to. The obvious options to me are 8=Sun Workstation, or 12=xterm. I am assuming xterm here but am unsure.

- Once the option is selected, I go through the system identification and it starts to install but quickly stops, saying it could not label disks. How do I work around this?

Basil said...

I believe my problem is that I was treating the cd iso as the hd (no critical thinking, just copy-paste from this tutorial).

I created a disk image:

qemu-img create -f raw tempSPARC.img 650M

Then I load qemu:

qemu-system-sparc -M SS-5 -startdate "2009-12-13" -bios ss5.bin -nographic -hdb tempSPARC.img -cdrom Solaris_251.iso

It then loads and I reach the "ok" prompt, where I tried:

boot disk2:d -vs

It then looks like its trying to boot from the cd image but, it gives "data transfer overrun" errors (there is a cryptic "corrupt label - wrong magic number" message in the beginning. It then reboots. What am I doing wrong?

atar said...

@Basil,

I believe my problem is that I was treating the cd iso as the hd (no critical thinking, just copy-paste from this tutorial).

No. The tutorial says that for the versions before 2.6 you have to use iso as hd for a good reason. The Solaris ISOs prior 2.6 used 512 bytes sectors. QEMU can not handle such CDs unless you modify the code (actually it's a trivial change of a few lines, but since the idea was not accepted in the mainstream, I never tried it).

What QEMU version are you using? Some released versions has bugs in the SCSI subsystem which may cause the behaviour you describe.

Also, Neozeed described how to format a Solaris disk here.

Basil said...

I am running Qemu 1.0.1.

I'm not getting much luck formatting a disk image (see my comments on the page you listed).

Per chance, if it is a trivial fix, where in code can I make it?

Basil said...

I was able to get a properly formatted disk image and the install went ok (so far as I am aware). I made the above changes to /etc/system (the correct information was already there) and /a/etc/system.

I then started qemu:

qemu-system-sparc -M SS-5 -m 256 -nographic -startdate "2009-12-13" -bios ss5.bin -hda solaris.disk

It looks like it is trying to boot into the device when the following message gets displayed:

Boot device: /iommu/sbus/ledma@5,8400010/le@5,8c00000 File and args:
Internal loopback test -- Wrong packet length; expected 36, observed 64

Can't open boot device

Type help for more information
ok

At this point, I run "boot disk0", where the following error message gets displayed:

Boot device: /iommu/sbus/espdma@5,8400000/esp@5,8800000/sd@0,0 File and args:
SunOS Release 5.5.1 Version Generic [UNIX(R) System V Release 4.0]
Copyright (c) 1983-1996, Sun Microsystems, Inc.
WARNING: /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000 (esp0):
undetermined selection failure
WARNING: /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000 (esp0):
undetermined selection failure
WARNING: clock lost 1004 days -- CHECK AND RESET THE DATE!
Hostname: stfsun1
mount: /dev/dsk/c0t2d0s6 no such device
/sbin/swapadd: expr: not found
/sbin/swapadd: /usr/sbin/swap: not found

WARNING - /usr/sbin/fsck not found. Most likely the
mount of /usr failed or the /usr filesystem is badly
damaged. The system is being halted. Either reinstall
the system or boot with the -b option in an attempt
to recover.

syncing file systems... done
Program terminated
ok

I tried boot disk0 -b just to see what happens and it looks to hang after the "Copyright (c) 1983-1996, Sun Microsystems, Inc." line.

Has this been addressed above? It seems like the user VooDoo_UzH_ perhaps had a similar issue but I am not a Russian speaker and Google translate didn't do a good enough job for me to understand much of the context.

[As a side note, I am trying to do something similar in nature to what the user Philip Whittamore above is doing. His contact information and his blogspot account is private. If, by some miracle, he sees this, I would like to pick his brain]

atar said...

> I am running Qemu 1.0.1.

I think this is the problem. At least QEMU 1.0 had some bugs in SCSI subsystem. Please, try 1.1.0 (I didn't look what happend between 1.1.0 and 1.2.0 otherwise I'd recommend to take the latest version).

atar said...

And, btw, you don't need the option
-startdate "2009-12-13" in QEMU 1.1+.

Basil said...

After updating, I am still getting the same issue:

Type help for more information
ok boot disk0
Boot device: /iommu/sbus/espdma@5,8400000/esp@5,8800000/sd@0,0 File and args:
SunOS Release 5.5.1 Version Generic [UNIX(R) System V Release 4.0]
Copyright (c) 1983-1996, Sun Microsystems, Inc.
Hostname: stfsun1
mount: /dev/dsk/c0t2d0s6 no such device
/sbin/swapadd: expr: not found
/sbin/swapadd: /usr/sbin/swap: not found

WARNING - /usr/sbin/fsck not found. Most likely the
mount of /usr failed or the /usr filesystem is badly
damaged. The system is being halted. Either reinstall
the system or boot with the -b option in an attempt
to recover.

syncing file systems... done
Program terminated
ok


I then try to boot with the -d option:

boot disk0 -d
Resetting ...

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
Probing CPU FMI,MB86904
Probing /iommu@0,10000000/sbus@0,10001000 at 5,0 espdma esp sd st SUNW,bpp ledma le
Probing /iommu@0,10000000/sbus@0,10001000 at 4,0 SUNW,CS4231 power-management
Probing /iommu@0,10000000/sbus@0,10001000 at 1,0 Nothing there
Probing /iommu@0,10000000/sbus@0,10001000 at 2,0 Nothing there
Probing /iommu@0,10000000/sbus@0,10001000 at 3,0 Nothing there
Probing /iommu@0,10000000/sbus@0,10001000 at 0,0 Nothing there
screen not found.
Can't open input device.
Keyboard not present. Using tty for input and output.
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
Probing CPU FMI,MB86904
Probing /iommu@0,10000000/sbus@0,10001000 at 5,0 espdma esp sd st SUNW,bpp ledma le
Probing /iommu@0,10000000/sbus@0,10001000 at 4,0 SUNW,CS4231 power-management
Probing /iommu@0,10000000/sbus@0,10001000 at 1,0 Nothing there
Probing /iommu@0,10000000/sbus@0,10001000 at 2,0 Nothing there
Probing /iommu@0,10000000/sbus@0,10001000 at 3,0 Nothing there
Probing /iommu@0,10000000/sbus@0,10001000 at 0,0 Nothing there

SPARCstation 5, No Keyboard
ROM Rev. 2.15, 256 MB memory installed, Serial #0.
Ethernet address 52:54:0:12:34:56, Host ID: 80000000.



Rebooting with command: disk0 -d
Boot device: /iommu/sbus/espdma@5,8400000/esp@5,8800000/sd@0,0 File and args: -d
SunOS Release 5.5.1 Version Generic [UNIX(R) System V Release 4.0]
Copyright (c) 1983-1996, Sun Microsystems, Inc.
Hostname: stfsun1
mount: /dev/dsk/c0t2d0s6 no such device
/sbin/swapadd: expr: not found
/sbin/swapadd: /usr/sbin/swap: not found

WARNING - /usr/sbin/fsck not found. Most likely the
mount of /usr failed or the /usr filesystem is badly
damaged. The system is being halted. Either reinstall
the system or boot with the -b option in an attempt
to recover.

syncing file systems... done
Program terminated
Type help for more information
ok


Is the Solaris install screwing up here or what is going on? How can I fix this? Am I even going about booting into this correctly?

atar said...

I don't see from your last message whether you did re-install Solaris with QEMU 1.1 or used the previously installed one. If the later, please re-install using QEMU 1.1.

Basil said...

Sorry about that, I am using Qemu 1.2.0. I am about to test out 1.1.2, to see if there is anything noticeably different from what I am seeing.

I am able to boot into the disk image now, but every time I am forced to boot into the 2.5.1 iso and run fsck on my disk image. Now, I'm not a *nix guru by any stretch of the imagination (evangelist maybe) but this to me seems to indicate that some fishy things are going on when it is unmounting and exiting out of the system.

What I am doing when I close it is issuing a "halt" command from the root user within 2.5.1 and it drops back down to the bios and then I just have to manually close the terminal window. Could this be causing issues? Moreover, how does one "gracefully" close Qemu from the bios?

Or am I completely off-base?

Sean Kenn said...

I'm trying to run a Solaris 10 install ISO using qemu-1.2.0 on RHEL6.3 x86_64.
Is this not going to work because Solaris 10 and OpenSolaris do not support 32 bit sparc platforms,
so they can never be booted under qemu-system-sparc?
Is qemu-system-sparc64 available anywhere these days?

/tmp/qemu-1.2.0/sparc-softmmu/qemu-system-sparc -M SS-5 -bios /tmp/ss5.bin -nographic -cdrom /space/OS/SOL_10_1106_SPARC.iso

I get the same exact thing that Nigel Horne reported back in July 11, 2011 6:16 PM all the way down to the ok prompt.

I'm not able to boot anything though.

ok boot disk2
Boot device: /iommu/sbus/espdma@5,8400000/esp@5,8800000/sd@2,0 File and args:
The file just loaded does not appear to be executable.

ok boot disk2:d -vb
Boot device: /iommu/sbus/espdma@5,8400000/esp@5,8800000/sd@2,0:d File and args: -vb
Short disk read
The file to boot may not be present

ok boot cdrom -b
Boot device: /iommu/sbus/espdma@5,8400000/esp@5,8800000/sd@6,0:d File and args: -b

Can't open boot device

atar said...

Correct, this is not going to work because Solaris 10 and OpenSolaris do not support 32 bit sparc platforms,so they can never be booted under qemu-system-sparc.

qemu-system-sparc64 is available at the same place where qemu-system-sparc lives. But the upstream version is not able to boot [Open]Solaris. A while ago I built a prototype which would be able to do it, but couldn't find the necessary funding to finalize the project, so it's currently on hold.

Sean Kenn said...

That's too bad. Just curious...how much funding is needed for something like this? $50, a coke and a smile, or do we need to start catching people at the ATM to get this done? Or is it just a case where this dinosaur should be laid to rest and people should move on to a newer distro?

atar said...

For a private person it's cheaper to buy a used system on ebay. But a company going to migrate/virtualize an existing [obsolete] SPARC infrastructure may be interested in such project.

Basil said...

Another question, maybe you can answer:

I've got Solaris 2.5.1 up and running on QEMU 1.2.0. I want to install some software from a cd that I ripped to an iso.

I have hit a stumbling block. I have tried to pass it in either through -cdrom mount.

I believe that the cd device is /dev/sr0 (which points to /dev/dsk/c0t2d0s2). When I try to mount it via:

mount -o ro -F hsfs /dev/sr0 /mnt

I get the following message:

mount: /dev/sr0 is already mounted, /mnt is busy,
or allowable number of mount points is exceeded

Does the cdrom issue you mentioned above still apply here?

I tried to mount through passing the iso in as -hdb but with the same results. Do you have any advice on what I am doing wrong?

Michael De Armon said...

Atar,
Thank you for the help! I got booted up with the Solaris 1.1.2 (SunOS 4.1.4) DD img just great!
But now, I've been going through the network howto... It's a server I'm trying to setup with the ip of 192.168.9.90. All the other computers telnet/rlogin into it.
I can't figure out what switches to use.
It's not pingable and I can't ping host from it (which I see your postings on, but I can't seem to do it right)
Right now I'm doing:
I'm using the latest Qemu for Debian apt-get at the moment.
qemu-system-sparc -M SS-5 -m 256 -bios ./ss5.bin -nographic -drive if=scsi,unit=3,file=sd0c.img -drive if=scsi,unit=5,file=sd1c.img -net=???

Booting up is fine, but like I said, once I'm in, it doesn't ping out or can't be pinged.

Thanks in advance! You're a life saver!

Michael De Armon said...

Oh, also, is there a Linux Distro you recommend using to run Qemu on and then run SunOS 4.1.4 on?

Michael De Armon said...

so far I've been trying to setup tap per the wiki page on qemu...

= nightmare

Unfortunately it kind assumes I know what I'm doing in the first place LOL.

atar said...

Tap is one possibility. Haven't used it much, as it requires some stuff being run as root, and that's what I'm trying to avoid.

I used port forwarding ( -redir tcp:5023::23 ). It's enough for telnet and ssh. If you don't need ftp, it's easier.

I use '-net user' (it's QEMU's default). In this case your guest ip is 10.0.2.15, and your host ip (gateway) is 10.0.2.2.
You should be able to ping 10.0.2.2 from your guest, but not any further host as ICMP forwarding is not implemented. You obviously can't ping the guest from the host in this scenario.

I wrote about port forwarding via ssh here. There is also a link to a good QEMU networking tutorial.

Michael De Armon said...

Is there a way to make it mimic as though it were a real machine on the 192.168.9.xxx network? Would that require TAP?

atar said...

Yes. If you need a virtual machine on your real network, you need TAP.

Michael De Armon said...

Hey Artyom!

I got your reply via FB. I didn't quite understand about the telnet serial with the expect option.

I'm not much of a programmer =(

Here is the current command I use to boot up the Sun OS 4.1.4. It gets me up to the Sparc Prom (Sparc5 Emulation): (Without the quotes)

" qemu-system-sparc -M SS-5 -bios ./ss5.bin -nographic -m 256 -drive if=scsi,unit=3,file=sd0c.img -drive if=scsi,unit=5,file=sd1c.img -net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=/etc/qemu-ifup ; boot disk "

Then, when it's in prom, I simply type in "boot disk" and it boots right up.

There are two virtual drives.

Thanks for you help! You've saved me so much stress!!!

atar said...

I mean ... -nographic -serial telnet::4441,server,wait ...

And then use telnet with expect or Expect.pm . Alternatively there were some attempts to boot SunOS with OpenBIOS. Once it works it would automate booting naturally.

Orion Blastar said...

Hey some info for you guys:

boot cdrom0:d -vb

Instead of disk2 for the CD-ROM try cdrom0 instead.

I couldn't get the KADB or KMDB working in the latest QEMU developer release.

I got a hex editor for Linux and the solaris7svr.iso file is a binary and not encrypted so I just replaced this pattern:

0x84022010 = 0x84022004

Then I saved the ISO to a new name solaris7svrfix.iso and I am going to test it out.

I am trying to get Solaris 7 working in QEMU with Networking support to mount NFS file systems for someone who has a failing SparcStation and needs a virtual machine replacement. I am willing to submit my findings here or to the QEMU developers.

Blastar.in for more information on me and my company. My email if you want to contact me. I might be interested in buying a subscription to your QEMU SPARC code.

I speak and read and write English, no Russian or German, sorry.

atar said...

@Orion Blastar

When kadb didn't work, what was the error message? Did you use OBP or OpenBIOS?

0x84022010 shouldn't be a problem in the current QEMU versions.

Peter Bartoli said...

"The option -nographic is important for OBP, as the emulated graphic card is not supported" ... is this still the case?

atar said...

Correct. The default graphic adapter is not supported, but meanwhile, thanks to Bob and Mark, cg3 can be emulated as well. I haven't tried whether -vga cg3 would be enough for OBP, or a proprietary cg3 firmware is needed too.

Anonymous said...

/opt/qemu>./configure --target-list=sparc-softmmu
ERROR: User requested feature nptl configure was not able tofind it

/opt/qemu>more config.log

- несколько ошибок типа:
cc1: ошибка: некорректный ключ "-Wempty-body"

- потом:
/tmp/ccyxUWHI.o: In function `sfaa':
/tmp/qemu-conf-29072-32131-6242.c:3: undefined reference to `__sync_fetch_and_and_4'
/tmp/ccyxUWHI.o: In function `main':
/tmp/qemu-conf-29072-32131-6242.c:9: undefined reference to `__sync_val_compare_and_swap_4'
collect2: выполнение ld завершилось с кодом возврата 1

- и наконец:
/usr/include/linux/futex.h:96: ошибка: expected ‘)’ before ‘*’ token
/usr/include/linux/futex.h:99: ошибка: expected ‘)’ before ‘*’ token

CentOS 5.2x32, но на 5.8x64 примерно тоже самое.
Даже не представляю в какую сторону копать.

atar said...

У меня под рукой нет ни таких старых версий, ни времени с ними возиться. Надо спрашивать в списке рассылки qemu-devel.

Anonymous said...

Вы имеете в виду старых версий CentOS? Или qemu?
Тогда посоветуйте какие версии пойдут более-менее стабильно и я попробую именно на них.
Заранее благодарен!
Пётр!

atar said...

У меня CentOS 6.5. Последний раз собирал пару месяцев назад - всё работало без напильника.

Serg said...

sparc-softmmu/qemu-system-sparc -M SS-5 -bios ss5.bin -nographic -cdrom solaris8.iso

ok>boot disk2:d -vs
Boot device: /iommu/sbus/espdma@5,8400000/esp@5,8800000/sd@2,0:d File and args: -vs
Data Access Exception

yet again:
ok>boot disk2:d -vs
Data Access Exception

ok>boot cdrom
Data Access Exception

Any boot - Data Access Exception
What this?

How quit from ok?
ok> quit
silence...
ok>exit
Memory Address not Aligned
Ctrl+C
silence...

atar said...

Serg, I never saw a firmware with an "ok>" prompt. OpenBIOS has ">" and OBP has "ok". What firmware are you using?

When using OBP, you can shutdown QEMU with the "power-off" command.

It looks like the last QEMU release and the current git master are broken. For now you have to use QEMU 1.6.x.

atar said...

Ok, Mark fixed the bug in OpenBIOS. Until the new binaries are committed into the git, one need to build OpenBIOS and put the file "QEMU,tcx.bin" in the directory specified by qemu-system-sparc "-L" command option.

Oscar Belmar said...

Hi..
Im looking for a Solaris 2.5.1 ISO images, cause I lost an old Entreprise 3500 and I need to recover it. Could you share those ISO with me?
Thanks.
OSCAR

Anonymous said...

hello atar!

could you post a qemu setup that is known to work with installing solaris 9 under sparc?

for example, the bios, qemu version etc? i've been struggling with this for some days. from reading your blog, it seems that some have had success installing solaris 9 under qemu, but the details are lacking.

thank you!

atar said...

@Oscar: have you found the install media?

atar said...

@Anonymous - it should work with the current git, and probably the last stable too (1.7.1).

What exactly doesn't work for you if you do it as described above?

Anonymous said...

hi atar,

thanks for the response, this is the latest setup i've been attempting to install solaris 9 sparc on. i've tried a variety of other setups too. this is with the very latest qemu.

./qemu-system-sparc -bios ss20_v2.25_rom -M SS-20 -smp 2 -cpu "TI SuperSparc 40" -nographic -boot d -hda 4g.disk -m 256 -cdrom sol-9-u8-ga-sparc-dvd.iso -serial telnet:0.0.0.0:3000,server

this boots to the installer, but a few steps into the installation, it will hang.

right now, i'm simply trying to find a "configuration" that will allow me to install solaris 9 sparc under qemu. any suggestions?

thank you very much.

atar said...

Well, the most obvious suggestion, would be trying to install it exactly as described in the how-to above. Particularly the '-smp X' option in your setup may cause troubles. Also, unless you are developing smp software, this option would do no good even if it worked: it simulates multiple virtual CPUs on a single physical one.

Anonymous said...

hi atar,

i've finally successfully installed solaris 9 under qemu 2.0.0rc0 emulating the SS20 and using the sun ss20 prom.

i've also been able to implement slirp networking, however, attempts to implement TAP are still failing.

do you know if TAP networking is confirmed to be working under the sparc emulator?

my second question, i've tested a cad application, and it's completed successfully and approximates the performance of the legacy system, however, i was wondering if you have any suggestions to "speed things up", for example smp processing, or is there a confirmed working emulated sparc model that may perform better than the ss20.

thank you very much, your blog was a huge help for me to get to this point.

atar said...

I didn't test TAP-networking myself, but there were reports that it was working. Also I'd expect it to be independent from the platform being emulated. So unless it's broken for all the emulated platforms, it should be there.

Concerning performance, I think that ss20 is really the top model QEMU can emulate. Maybe playng with -cpu can speed things up a bit, but don't expect a miracle happening.

Concerning SMP: QEMU is using one host CPU to emulate all guest CPUs. This means that you can have one fast guest CPU, or two guest CPUs, each performing slightly less than 50% of that, or 4 CPUs, each performing like 25% of a single CPU speed. So, until QEMU supports utilizing multiple host CPUs, using guest SMP only slows things down.

Out of curiosity, what CAD are you running?

Anonymous said...

cadence qplace was the application tested last weekend.

thank you atar.

atar said...

One more idea concerning the performance: a profiler shows that QEMU spends ~30% time in the TCG code optimizer. Maybe disabling the TCG optimizer would speed things up: it depends on the balance between a performance penalty running unoptimized code, and time spend on the optimization.

I haven't tried it though. Just an idea which is relatively easy to test.

Anonymous said...

thanks, i'll give that a try and post the results.

Anonymous said...

hmmm, i don't see any evident way to disable TCG for sparc emulation. am i missing something obvious?

thank you!

atar said...

TCG is the emulation. Why would you want to disable it?

Are you running a sparc guest on a sparc host?

Anonymous said...

actually, the TCG optimization, you mention above it's possible to disable.

i'm a sparc guest under intel hardware.

thank you.

Anonymous said...

does not work with latest qemu.

atar said...

Oh, TCG optimisation, not TCG itself. It should be possible to disable it by commenting out

#define USE_TCG_OPTIMIZATIONS

in tcg/tcg.c.

atar said...

@ Anonymous with not working qemu,

what exactly doesn't work? I've just tried today's git and it boots Solaris 9 exactly as described.

Anonymous said...

i'll try this today and let you know the results. thanks atar.

"Oh, TCG optimisation, not TCG itself. It should be possible to disable it by commenting out

#define USE_TCG_OPTIMIZATIONS

in tcg/tcg.c."

Anonymous said...

atar,

i'm seeing around a 5% performance boost disabling tcg optimization.

thanks for the pointer.

aron.

atar said...

Wow! Aron, thank you very much for the report! Frankly speaking I haven't expected that much of performance boost. What was your benchmark? Doing something in cadence?
BTW, I don't remember if I mentioned that building QEMU with --disable-qom-cast-debug option brings another couple of % to the performance. In my case is was something like 10% on I/O operations. YMMV though.

Dean Masters said...

Hello Artyom, I got a question for you:
I've been following your post for booting Solaris-sparc on Qemu for a week now. I went from downloading Qemu 2.1.2, compiling it getting it to execute the 'sparc-softmmu/qemu-system-sparc' command. Thanx for the SS5.bin file.

Anyway I've hit a road block. I'm trying to boot/install Solaris 9 to a virtual disk made using the 'qemu-img create' command.

I followed everything you posted as much as I could and ended up using OBP and not OpenBios.

Here's my command that I used:
sparc-soft/qemu-system-sparc -M SS-5 -bios /home/user/qemu/ss5.bin -cdrom SolarisTest/sol9v1.iso -hda solaris3.img -boot d -m 256

It boots up and I have to enter the 'boot disk2:d -v' command. ( I tried 'boot disk2:d -vs' but I couldn't get far)

I proceed with the GUI installation but I get an error with the hard drive. The 'begin install script' terminates when it has to initialize the hard drive.

So I tried to use the format command and format the disk so installation can proceed.

This is where I'm stuck.

Please help.

atar said...

Yes, as it's written in the how-to, Solaris 9 is not fully supported in the upstream qemu yet.

I had no time for this project lately, but it's possible there would be an opportunity next year.

If you just need the Solaris 9 kernel, it should be able to boot it with -vb option (see the how-to).

Dean Masters said...

Thank you for the reply.

If Solaris 9 is not fully supported what about Solaris 8?

I got the chance to try Solaris 8 using the same procedure as I described in my previous post.
However, the same thing happened. I received the same errors and the same option to format the disk.
But I was not successful. Once again, the 'begin install script' terminates when it has to initialize the hard drive.

Is this supposed to happen with Solaris 8?

Sean Callahan said...

I've been working to get Solaris 8 running on an emulated Enterprise 250, but it fails following the format/reboot. The host machine is a Dell Optiplex 760 (Core2Duo) running Xubuntu v14.10 Desktop, QEMU version 2.1.0 (Debian 2.1+dfsg-4ubuntu6), OpenBIOS v1.1 (downloaded from Github), Solaris 8 install media 2/02. Below is my latest attempt for 32-bit install.

Since the Enterprise 250 is a 64-bit machine, I experimented with qemu-system-sparc64/openbios_sparc64, specifying "TI UltraSparc II" as the cpu and 512 of swap. However, the 32-bit versions get further through the install. Any suggestions?

$ qemu-img create -f qcow2 solaris.disk 36G
...
$ qemu-system-sparc -m 256 -hda solaris.disk -cdrom /dev/sr0 -bios openbios-sparc32 -nographic -prom-env 'auto-boot?=false'
Configuration device id QEMU version 1 machine id 32
...
CPUs: 1 x FMI,MB86904
UUID: 00000000-0000-0000-0000-000000000000
Welcome to OpenBIOS v1.1 built on Nov 3 2014 20:17
Type 'help' for detailed information

0 > boot cdrom:d -vs
Not a bootable ELF image
...
Jumping to entry point 00004000 for type 00000005...
switching to new context:
Size: 259712+54162+47510 Bytes
SunOS Release 5.8 Version Generic_108528-13 32-bit
Copyright 1983-2001 Sun Microsystems, Inc. All rights reserved.
...
NOTICE: audiocs: couldn't set value (940 0x00 0x88)
audio may not work correctly until it is stopped and restartedaudiocs0 at sbus0: SBus slot 4 0xc000000 SBus level 5 sparc ipl 9
audiocs0 is /iommu@0,10000000/sbus@0,10001000/SUNW,CS4231@4,c000000
...

INIT: SINGLE USER MODE
# drvconfig
inst_sync failed for /etc/path_to_inst.84: Read-only file system
drvconfig: WARNING: failed to update /etc/path_to_inst
# disks
disks: mkdir failed for /dev 0x1ed: Read-only file system
# format
Searching for disks...WARNING: /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@0,0 (sd0):
corrupt label - wrong magic number

Vendor 'QEMU', product 'QEMU', 75497472 512 byte blocks
done

AVAILABLE DISK SELECTIONS:
0. c0t0d0
/iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@0,0
Specify disk (enter its number): 0

AVAILABLE DRIVE TYPES:
...
18. other
Specify disk type (enter its number): 18
Enter number of data cylinders: 24620
...
Enter number of heads: 27
...
Enter number of data sectors/track: 107
...
Enter disk type name (remember quotes): Qemu36GB
selecting c0t0d0
[disk formatted]
...
format> label
Ready to label disk, continue? y

WARNING: /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@0,0 (sd0):
corrupt label - wrong magic number

Vendor 'QEMU', product 'QEMU', 75497472 512 byte blocks

format> label
Ready to label disk, continue? y

format> q
# reboot
syncing file systems... done
rebooting...
rebooting ()
...
Welcome to OpenBIOS v1.1 built on Nov 3 2014 20:17
Type 'help' for detailed information

0 > boot cdrom:d
...
Jumping to entry point 00004000 for type 00000005...
switching to new context:
-
panic[cpu0]/thread=f0244020: page_free

f0243900 unix:page_free+2bc (f029b140, 1, f0251140, 1, 1, 0)
%l0-7: f029b140 f00683f0 f005b0b0 00000020 00000040 00000040 00000007 ffd2695c
f02439a8 unix:add_physmem+58 (f029b100, 2, 1, f029b140, 0, 2000)
%l0-7: 04400cc4 f00566d0 f00566d4 f0249400 00004000 ffdec000 0001bc6a ffd2695c
f0243a08 unix:kphysm_init+15c (f0253170, f5903060, ea84, 2, f029b000, 2)
%l0-7: 0000ea82 f029b180 00000000 00000000 00000000 00000001 00000007 ffd2695c
f0243a68 unix:startup+558 (f024fc00, f0248800, fbd00000, f5900000, f0646000, fbd00000)
%l0-7: 00002000 f5904000 0eedc000 00000024 f0680000 00000420 f027b000 f024f400
f0243b20 genunix:main+4 (4400fe0, 4400fe0, 2000, 44000e0, 1000000, f005b774)
%l0-7: f5901000 f0243b88 f0081c94 00000002 00000004 00000000 0008d82c 00000000

skipping system dump - no dump device configured
rebooting...

Sean Callahan said...

Although the system panic'ed, I attempted to resume the install by issuing the following:

$ qemu-system-sparc -m 256 -hda solaris.disk -cdrom /dev/sr0 -bios openbios-sparc32 -nographic -prom-env 'auto-boot?=false'
...
> boot cdrom:d -v

The install reaches the language menu, prompts you to format a swap slice, copies the mini-root and platform-specific files, and reboots, but kernel panics again at the same spot.

Sean Callahan said...

Cloned the qemu repo from git.qemu.org, configured, built, recreated the cqow using the newly built qemu-img, and re-launched the install using the sparc-softmmu version of qemu-system-sparc. The install seg-faulted and displayed the error message "ERROR: The Solaris Distribution, :a does not exist. Exiting to shell."

atar said...

Interesting. Are you saying there is a regression in the current qemu git? Does it always crash at the same place?

atar said...

I think you are right. I tried the current version and it is not so stable for me as well. Bisecting is a lot of work because last time I used it more than two years ago.

atar said...

@Sean,

can you please check if you get further if you add -vga cg3 after -nographic . This might sound like a contradictory options, but they are not: the graphic adapter is always there, regardless of -nographic.

Dennis said...

Hi,
I have a question about the current status of running solaris 8. I partly managed to install solaris 8 with qemu 2.1.92 and OpenBIOS. Short summary: I added the scsi option to the etc/system after the installation procedure copies the 'mini_root' (I think this is copied to the swap partion). At the first boot of the disk (boot disk0:b, again I think this is the swap partition) CDE starts sucessfully but the installation process stucks because the java process have 100% cpu usage. Maybe the reason for this is that I'm starting qemu with graphic support and into multiuser mode? Therefore my question is, if it is possible to get solaris 8 running with graphic support and multiuser mode.

atar said...

To be honest, I don't know. I don't use graphic emulation. Do you have a specific application which needs a local graphic card?

Dennis said...

Hmm, I can't proceed even if I start it with -nographic.

./qemu-system-sparc -L . -hda ~/tmp/sparc/hda.img -m 128 -cdrom ~/tmp/sparc/sol-8-u7-install-sparc.iso -prom-env 'auto-boot?=false' -nographic

1.) boot disk0:b
All I get is:

Jumping to entry point 00004000 for type 00000005...
switching to new context:
SunOS Release 5.8 Version Generic_108528-13 32-bit
Copyright 1983-2001 Sun Microsystems, Inc. All rights reserved.
Configuring /dev and /devices
NOTICE: audiocs0:Couldn't set value (../../sun/io/audio/sada/drv/audiocs/audio_4231.c, Line #1738 0x00 0x88)
audiocs0:audio may not work correctly until it is stopped and restarted
Using RPC Bootparams for network configuration information.
Skipping interface le0
Searching for configuration file(s)...
syslog service starting.
Running in command line mode

Then nothing happens and I don't have a shell promt.

2.) boot disk0:b -vs
It boots into the mini_root. I get a prompt but the installation process doesn't proceed.

...
pseudo-device: fcp0
fcp0 is /pseudo/fcp@0
Using RPC Bootparams for network configuration information.
Skipping interface le0

INIT: SINGLE USER MODE
#

If I enter 'disk0_install' he couldn't find this command nor does it work to call /sbin/disk0_install (because nothing happens after that)

3.) boot disk0:b -vb
After booting I get a prompt, but it's the same as on single usermode, I can't proceed further.


On a comment, Tom (January 18, 2012 at 11:12 AM) mentioned that he could sucessfully install solaris 7 and 8 with "Solaris 8 Software" CDs 1 and 2 instead of the "Solaris 8 Installation" CD. I have only one iso called sol-8-u7-install-sparc.iso. I think this is the solaris 8 installation CD. Could this be the problem? Or did I something wrong?
Any suggestions would be perfect.

Sean Callahan said...

Atar, referencing your recommendation made on the 14th, I tried adding -vga cg3 after -nographic using the latest release v2.2.0-rc3 and it doesn't appear to make any difference. I'm working through bisecting, starting with v0.13.0, which you reference at the top of your blog as as working. Any additional details (e.g. exact version, host OS) would be great.

atar said...

I think the upstream QEMU can only boot Solaris in a single user mode. I'll see if I can publish my patches in 2015. It looks like I may have a customer who may sponsor this work.

Sean Callahan said...

Having a sponsor would be great. Trying v0.13.0 moments ago, it hangs retrieving network configuration information.

$ qemu/sparc-softmmu/qemu-system-sparc -m 256 -hda solaris.disk -cdrom /dev/sr0 -nographic -prom-env 'auto-boot?=false' -bios ./openbios-sparc32
...
Welcome to OpenBIOS v1.1 built on Nov 3 2014 20:17
Type 'help' for detailed information

0 > boot cdrom:d -vs
Loading a.out image...
...
SunOS Release 5.8 Version Generic_108528-13 32-bit
Copyright 1983-2001 Sun Microsystems, Inc. All rights reserved.
...
lofi0 is /pseudo/lofi@0
pseudo-device: fcp0
fcp0 is /pseudo/fcp@0
Using RPC Bootparams for network configuration information.
\

atar said...

With 0.13 and Solaris 8 you may be hitting the Solaris "le" network driver bug. Try to boot with kadb as described here: http://tyom.blogspot.de/2010/10/bug-in-all-solaris-versions-after-57.html

There was a workaround built into QEMU le emulation, but it happened after 0.13. Don't remember when.

Sean Callahan said...

Earlier today, I tried the patch mentioned above but the address didn't line up with the add operation that was expected. Search forward and backward from leinit+0x645, I couldn't find it either. Instead, removed the le device prior to boot. That got me past the RPC Bootparams hang, only to encounter the same panic as my Nov 11th post. Any recommendations?

atar said...

I was able to reproduce your problem.
It seems that rebooting doesn't work properly under OpenBIOS. Try to restart QEMU between reboots.

Joe said...

I now have a mostly-working Solaris 6 emaultion working, with great thanks to the valuable information in this blog, brezular.com, and the QEMU/Solaris 4.14 wikibook.

setup detail;
QEMU (present git snapshot, reports --version 2.2.92)
-M SS-20, openboot/proprietary prom

# uname -a
SunOS j973emu0 5.6 Generic_105181-33 sun4m sparc SUNW,SPARCstation-20

I continue to have this problem, which I have found others posted on both blogs, but have not seen a resolution yet.

# /etc/init.d/init.dmi start
Run-time error, libC:
Trying to release a lock that was not acquired in this thread
(repeat above 1x)
Abort - core dumped

as well as:
Assertion failed: MUTEX_HELD(&svc_mutex), file rpc/svc_run.c, line 766

which prints to the console periodically when "dmispd" is running.

Anyone have a potential lead on resolving these issues, especially the "Run-time error, libC". That error prevents using several of ancient programs for which I set this up.

atar said...

@Joe yeah, the upstream QEMU has some functionality missing. I fixed these issues for some customers, but they are not eager to share them.

Joe said...

@atar, thanks for the response on the libC problem I have with qemu-system-sparc (32b) and Solaris 2.6. It sounds like you have an understanding of the underlying problem. Can you elaborate any further on what is missing, without breaking contracts?

I don't have an appreciation for why you cannot patch in upstream, is it IP constraints placed on you by these customers, or is it a matter of you being paid for your time? Really it may not be worth your time to even try to explain that to me. I posted a bug on launchpad for the issue, though I am not very confident that will help anything.


The programs I want to run are compiled 32-bit, though the original host was an ultra (64b). I don't imagine I could expect any better success running qemu-system-sparc64? I've read only scant info on using qemu-system-sparc64 with Solaris. It looks like openbios is the only BIOS option there. I haven't been able to make that boot even the cdrom kernel yet (again Sol 2.6).

Also, other O/S versions could probably work for my purposes, such as Solaris 2.7 or Solaris 8, but I haven't experimented with them so far. But I might if you think I am more likely to have success.

Anonymous said...

We have an old (no longer supported) application that was licensed with FLEXlm to a SparcStation 2. This machine is no longer alive, so I thought I might emulate it with QEMU.

While I was able to spoof the last 3 bytes of the hostid, because the machine was a SS2 the first byte still doesn't match (SS5, which QEMU emulates, is 80 whereas the old SS2 was 55). I tried manually changing the hostid to 55 but it won't even boot, I presume because the emulated hardware doesn't match the machine id.

I know this is an old post, but.. in the event that someone is still monitoring this thread, does anyone have any idea how to get around this?

atar said...

Well, the problem is that SS2 is a sun4c machine (and sun4c is not emulated by QEMU) whereas SS5 is sun4m machine.

Can you tell more details what happens when it doesn't boot? Have you tried booting with OpenBIOS?

Anonymous said...

If I try to boot with OBP (ss5.bin) and the machine id set to 0x55, I get a Data access exception right away.

Trying to boot with OpenBIOS and the machine id left alone (set to 0x80), I also get an access exception:

SunOS Release 4.1.4 (GENERIC) #2: Fri Oct 14 11:09:47 PDT 1994
Copyright (c) 1983-1993, Sun Microsystems, Inc.
cpu = SUNW,SPARCstation-5
mod0 = FMI,MB86904 (mid = 0)
mem = 16252K (0xfdf000)
avail mem = 12472320
BAD TRAP: cpu=0 type=9 rp=fd008d84 addr=f0fdc000 mmu_fsr=226 rw=1
MMU sfsr=226: Invalid Address on supv data fetch at level 2
regs at fd008d84:
psr=4800cc4 pc=f0007bec npc=f014325c
y: 640000 g1: 1 g2: 8000000 g3: a00
g4: c00 g5: 200 g6: 0 g7: 60000000
o0: 7374656d o1: f02acddc o2: 6e632e0d o3: 1
o4: 80 o5: 0 sp: fd008dd0 ra: 2aaf1
pid -1, `': Data access exception
kernel read fault at addr=0xf0fdc000, pme=0x0
MMU sfsr=226: Invalid Address on supv data fetch at level 2
rp=0xfd008d84, pc=0xf0007bec, sp=0xfd008dd0, psr=0x4800cc4, context=0x0
g1-g7: 1, 8000000, a00, c00, 200, 0, 60000000
Begin traceback... sp = fd008dd0
Called from f0139b34, fp=fd008e38, args=f0fdcc00 fff00000 2000 3 1000 1000
Called from f0038634, fp=fd008ef8, args=f03d8bf0 be6 10000000 fff fdd 320
Called from f00053f8, fp=fd008f58, args=fd008fb4 8 3 80003 80003 fd009b84
Called from 403f0c, fp=0, args=4000 3ffd60 1 71348 4000 0
End traceback...

atar said...

Looks like you are trying to install Solaris for Intel machines on a SPARC machine. For Intel Solaris you'd rather need qemu-system-x86_64.

«Oldest ‹Older   201 – 354 of 354   Newer› Newest»