Documentation/Platforms/SPARC: Difference between revisions

From QEMU
 
(56 intermediate revisions by 3 users not shown)
Line 1: Line 1:
__FORCETOC__
__FORCETOC__
Welcome to the SPARC homepage. This page contains news and resources for users looking to emulate sun4m or sun4u systems under QEMU.
Welcome to the SPARC homepage. This page contains news and resources for users looking to emulate sun4m, sun4u or sun4v systems under QEMU.


== Status ==
== Status ==


The table below gives the status of the SPARC machines available in QEMU and is correct as of QEMU 2.5:
The table below gives the status of the SPARC machines available in QEMU and is correct as of the latest release:


{| class="wikitable"
{| class="wikitable"
Line 18: Line 18:
|sun4v
|sun4v
|Incomplete, unsupported
|Incomplete, unsupported
|-
|niagara
|Complete, supported
|}
|}


Line 29: Line 32:


By default QEMU will build both the <code><nowiki>qemu-system-sparc</nowiki></code> and <code><nowiki>qemu-system-sparc64</nowiki></code> system emulators unless QEMU has been configured with a specific target list. If you are looking to build just the SPARC system emulators from source yourself, then pass the options <code><nowiki>--target-list="sparc-softmmu sparc64-softmmu"</nowiki></code> to QEMU's configure script.
By default QEMU will build both the <code><nowiki>qemu-system-sparc</nowiki></code> and <code><nowiki>qemu-system-sparc64</nowiki></code> system emulators unless QEMU has been configured with a specific target list. If you are looking to build just the SPARC system emulators from source yourself, then pass the options <code><nowiki>--target-list="sparc-softmmu sparc64-softmmu"</nowiki></code> to QEMU's configure script.
== Getting started ==
The most common ways to start <code><nowiki>qemu-system-sparc</nowiki></code> and <code><nowiki>qemu-system-sparc64</nowiki></code> are shown below:
* sun4m with HD and CD (boot from CD)
<pre>
qemu-system-sparc \
  -drive file=hd.qcow2,if=scsi,bus=0,unit=0,media=disk \
  -drive file=cdrom.iso,format=raw,if=scsi,bus=0,unit=2,media=cdrom,readonly=on \
  -boot d
</pre>
* sun4m with HD only
<pre>
qemu-system-sparc \
  -drive file=hd.qcow2,if=scsi,bus=0,unit=0,media=disk
</pre>
* sun4u with HD and CD (boot from CD)
<pre>
qemu-system-sparc64 \
  -drive file=hd.qcow2,if=ide,bus=0,unit=0 \
  -drive file=cdrom.iso,format=raw,if=ide,bus=1,unit=0,media=cdrom,readonly=on \
  -boot d
</pre>
* sun4u with HD only
<pre>
qemu-system-sparc64 \
  -drive file=hd.qcow2,if=ide,bus=0,unit=0
</pre>
* sun4u with virtio HD and CD (boot from CD, requires QEMU >= 3.1)
<pre>
qemu-system-sparc64 \
  -drive file=hd.qcow2,if=none,id=hd \
  -drive file=cdrom.iso,format=raw,if=ide,bus=1,unit=0,media=cdrom,readonly=on \
  -device virtio-blk-pci,bus=pciB,drive=hd
  -boot d
</pre>
* sun4u with virtio HD (requires QEMU >= 3.1)
<pre>
qemu-system-sparc64 \
  -drive file=hd.qcow2,if=none,id=hd \
  -device virtio-blk-pci,bus=pciB,drive=hd,bootindex=0
</pre>
== Changes to sun4u machine from 2.11 onwards ==
In order to improve the compatibility of QEMU's sun4u machine, there have been
a number of changes that have been made during the 2.11 development cycle which
in some cases will require changes to the command line to start
qemu-system-sparc64.
=== Default network card changed from ne2k_pci to sunhme (Happy Meal Ethernet) ===
Many OSs either don't have drivers for other network cards, don't build other
network cards for SPARC architecture or even have faulty drivers because they
have never been tested on big-endian machines. Implementing the real onboard
sunhme enables networking for just about every OS.
'''Example:''' using ne2k_pci (the previous default) as for QEMU <= 2.10:
<pre>
qemu-system-sparc64 -net nic,model=ne2k_pci -net user
</pre>
=== All PCI devices are attached behind one of the simba PCI bridges ===
Previous versions of QEMU attached all PCI devices to the sabre PCI bus which
does not match the PCI topology of a real Ultra 5. On a real Ultra 5 all PCI
devices are attached behind the two simba bridges; in-built devices are
attached to bus A whilst bus B has 4 free PCI slots for use.
In order to support this topology QEMU included some hacks to enable PCI devices
to be connected directly to the sabre PCI bus and re-work the interrupt routing.
Typically this is visible during Linux boot as a set of warnings about overlapping
PCI window ranges, and it is up to the OS to attempt to resolve the clashes
itself.
By correctly modelling these bridges, the PCI topology and interrupt routing
are now implemented correctly as per the available documentation which removes
all visible guest OS warnings in my tests and allows these hacks to be removed.
'''IMPORTANT:''' as it is now impossible to plug PCI devices into the sabre PCI bus then it
is necessary to make a slight change to the command line used to plug additional
PCI devices into QEMU.
* Example: adding a virtio block device
<pre>
qemu-system-sparc64 -drive id=hd,if=none,file=hd.qcow2 -device virtio-blk-pci,bus=pciB,drive=hd
</pre>
Note that the important part of the -device parameter is the '''bus=pciB''' which
ensures that the virtio-blk-pci device is plugged into the correct simba bus.
If by accident this is omitted (as typically when using QEMU <= 2.10) then QEMU
will exit with a message similar to the following:
<pre>
qemu-system-sparc64: -device virtio-blk-pci,drive=hd: PCI: no slot/function available for virtio-blk-pci, all in use or reserved
</pre>


== Compatibility ==
== Compatibility ==


The tables below show the results of testing various SPARC and SPARC64 guests in QEMU in the latest release (2.6):
The tables below show the results of testing various SPARC and SPARC64 guests in QEMU in the latest release:


'''SPARC32:'''
'''SPARC32:'''
Line 42: Line 157:
!Status
!Status
!Notes
!Notes
|-
|sun4m
|Aurora Linux 1.0 (Ansel)
|aurora-1.0-sparc-disc1.iso
|Working
|Requires -vga cg3 for graphics (default TCX adapter not supported)
|-
|sun4m
|Aurora Linux 2.0 (Kashmir FC3)
|aurora-2.0-sparc-DVD.iso
|Working
| -
|-
|sun4m
|Bobware 10.2
|bobware-10.2.rc7-disk1.iso
|Working
|Requires -vga cg3 for graphics (default TCX adapter not supported)
|-
|sun4m
|Debian Sarge
|debian-31r1a-sparc-businesscard.iso
|Working
|Requires -vga cg3 for graphics (default TCX adapter not supported)
|-
|sun4m
|Debian Etch
|debian-40r4a-sparc-netinst.iso
|Working
| -
|-
|sun4m
|Mandrake 7.1 (Hydrogen)
|Mandrake71-inst.sparc.iso
|Working
|Requires -vga cg3 for graphics (default TCX adapter not supported)<br>DHCP autoconfiguration fails. Shutdown freezes at unloading cs4231 kernel module.
|-
|sun4m
|MirOS #10semel
|MIR80316.ISO
|Broken
|Panic: NMI
|-
|sun4m
|NetBSD 6.1.3
|NetBSD-6.1.3-sparc.iso
|Working
| -
|-
|sun4m
|NetBSD 7.99.1 (7.0 pre-release)
|NetBSD-7.99.1-sparc.iso
|Working
|Works fine, although intermittent ESP DMA errors appear on the console.
|-
|sun4m
|NetBSD 7.1
|NetBSD-7.1-sparc.iso
|Working
| -
|-
|sun4m
|NextSTEP 3.3
|?
|Partially working
|Tends to hang during disk access, possible ESP emulation bug or interrupt delay required. Some success has been reported using a non-SMP host kernel suggesting a buggy interrupt race in the NS guest drivers.
|-
|-
|sun4m
|sun4m
Line 50: Line 231:
|-
|-
|sun4m
|sun4m
|Solaris 1.1.2
|OpenBSD 5.2
|?
|install52.iso
|Working
|Working
| -
| -
|-
|-
|sun4m
|sun4m
|Solaris 8 32-bit
|OpenBSD 5.8
|?
|install58.iso
|Working
|Working
| -
|Requires -nographic to boot
|-
|-
|sun4m
|sun4m
|NextSTEP 3.3
|OpenSTEP 4.2
|?
|?
|Partially working
|Partially working
Line 68: Line 249:
|-
|-
|sun4m
|sun4m
|NetBSD 7.99.1 (7.0 pre-release)
|RedHat 6.2 (Zoot)
|NetBSD-7.99.1-sparc.iso
|redhat-6.2-sparc.iso
|Working
|Requires -vga cg3 for graphics (default TCX adapter not supported)
|-
|sun4m
|Solaris 1.1.2
|?
|Working
|Working
|Works fine, although intermittent ESP DMA errors appear on the console.
| -
|-
|-
|sun4m
|sun4m
|NetBSD 6.1.3
|Solaris 2.6
|NetBSD-6.1.3-sparc.iso
|?
|Working
|Working
| -
| -
|-
|-
|sun4m
|sun4m
|OpenBSD 5.2
|Solaris 7 32-bit
|install52.iso
|?
|Working
|Working
| -
| -
|-
|-
|sun4m
|sun4m
|Debian Etch
|Solaris 8 32-bit
|debian-40r4a-sparc-netinst.iso
|?
|Working
|Working
| -
| -
|-
|-
|sun4m
|sun4m
|Debian Sarge
|Splack 8.0
|debian-31r1a-sparc-businesscard.iso
|splack-24oct2k3.iso
|Working
|Working
|Requires -vga cg3 for graphics (default TCX adapter not supported)
|Requires -vga cg3 for graphics (default TCX adapter not supported)
Line 108: Line 295:
|-
|-
|sun4u
|sun4u
|OpenADK (modern Linux kernel)
|Debian Wheezy
|http://www.openadk.org
|debian-7.8.0-sparc-netinst.iso
|Working
| Requires -nographic in order to boot
|-
|sun4u
|Debian Stretch
|[https://people.debian.org/~glaubitz/debian-cd/ debian-9.0-sparc64-NETINST-1.iso]
|Working
| Requires -nographic in order to boot
|-
|sun4u
|FreeBSD 10.3
|FreeBSD-10.3-RELEASE-sparc64-disc1.iso
|Working
| Requires -nographic in order to boot. Due to a restriction in reading the psycho device properties, kernels < 10.3 panic on boot. A [https://reviews.freebsd.org/D2791 fix] for this has been merged into both 10.3 and the up-and-coming 11.0 release.
|-
|sun4u
|HelenOS 0.7.0
|[http://www.helenos.org/releases/HelenOS-0.7.0-sparc64-ultra.iso HelenOS-0.7.0-sparc64-ultra.iso]
|Working
|Working
| -
| '''QEMU < 2.11:'''<br/>Requires -nographic -prom-env boot-args="console=devices/\\hw\\pci0\\00:03.0\\com1\\a" to boot.<br/>
'''QEMU >= 2.11:'''<br/>Requires -nographic -prom-env boot-args="console=devices/\\hw\\pci0\\01:01.0\\com1\\a" to boot.<br/>
|-
|sun4u
|Milax 0.3.2 (OpenSolaris)
|milax032sparc.iso
|Broken
| Requires -nographic to boot. Reaches userspace console then freezes.
|-
|-
|sun4u
|sun4u
Line 120: Line 332:
|-
|-
|sun4u
|sun4u
|Milax 0.3.2 (OpenSolaris)
|OpenADK (modern Linux kernel)
|milax032sparc.iso
|http://www.openadk.org
|Broken
|Working
| Requires -nographic to boot. Fails in later part of kernel initialisation.
| -
|-
|-
|sun4u
|sun4u
Line 131: Line 343:
| Requires -nographic to boot. Due to hard-coded device tree paths for the cmd646-ide device, the root device must be entered on boot.
| Requires -nographic to boot. Due to hard-coded device tree paths for the cmd646-ide device, the root device must be entered on boot.
|-
|-
|sun4u
|}
|HelenOS 0.5.0
 
|HelenOS-0.5.0-sparc64-ultra.iso
{| class="wikitable"
|Broken
!Machine
| OS boots, however due to undetected keyboard device is unusable.
!OS
!Image
!Status
!Notes
|-
|-
|sun4u
|niagara
|FreeBSD 10.3
|HelenOS 0.7.0
|FreeBSD-10.3-RELEASE-sparc64-disc1.iso
|[http://www.helenos.org/releases/HelenOS-0.7.0-sparc64-niagara.iso HelenOS-0.7.0-sparc64-niagara.iso]
|Working
|Working
| Requires -nographic in order to boot. Due to a restriction in reading the [https://reviews.freebsd.org/D2791 psycho] device properties, kernels < 10.3 panic on boot. A fix for this has been merged into both 10.3 and the up-and-coming 11.0 release.
| Tested with the command line:
<blockquote>qemu-system-sparc64 -M niagara -m 256 -L /usr/local/opensparc/image/ -drive file=hdisk.img,index=0,media=disk,format=raw -drive if=pflash,readonly=on,file=HelenOS-0.7.0-sparc64-niagara.iso -nographic</blockquote>
|-
|-
|sun4u
|niagara
|Debian Wheezy
|OpenSPARC T1 Solaris 10 image
|debian-7.8.0-sparc-netinst.iso
|[http://download.oracle.com/technetwork/systems/opensparc/OpenSPARCT1_Arch.1.5.tar.bz2 OpenSPARCT1_Arch.1.5.tar.bz2]
|Working
|Working
| Requires -nographic in order to boot
| Tested with the command line:
<blockquote>qemu-system-sparc64 -M niagara -L /path-to/S10image/ -nographic -m 256 -drive if=pflash,readonly=on,file=/S10image/disk.s10hw2</blockquote>
|}
|}


Line 158: Line 375:
!Machine
!Machine
!Feature
!Feature
|-
|9.0
|sun4m
|Fix ASI_USERTXT access which caused the Solaris kernel to panic when using mdb/gdb/adb within the guest
|-
|8.2
|*
|Convert SPARC instruction decoder to use decodetree
|-
|8.1
|sun4v
|Fix block device error when trying to boot niagara machine
|-
|8.1
|sun4m
|Allow keyboard language DIP switches to be set via the -global escc.chnA-sunkbd-layout option
|-
|8.1
|*
|Update target/sparc to use tcg_gen_lookup_and_goto_ptr() for improved performance
|-
|6.2
|sun4m
|Fix for booting sun4m machines with more than 1 CPU
|-
|5.2
|sun4u
|Fix for sabre PCI IRQs being lost due to memory overflow
|-
|5.2
|sun4m
|Fix panic when booting NetBSD with the TCX framebuffer [https://bugs.launchpad.net/qemu/+bug/1892540 (LP:1892540)]
|-
|5.1
|sun4u
|Fix booting of SPARC64 kernels directly from the command line via -kernel and booting from virtio-blk-pci devices
|-
|4.2
|sun4u
|Implementation of sun4u MMU IE (Invert Endian) bit (Tony Nguyen)
|-
|4.1
|sun4u
|Fix console when running with -vga none, sunhme fixes when running on a TAP network interface
|-
|4.1
|sun4m
|Fix console when running with -vga none
|-
|4.0
|sun4m
|Fix Solaris boot on SS-10/SS-20 machines with OpenBIOS (OpenBIOS)
|-
|3.1
|sun4u
|Add support for boot from virtio-blk-pci block devices (QEMU/OpenBIOS)
|-
|3.0
|sun4u
|Add icount support
|-
|2.12
|*
|Add "power-off" command to OpenBIOS (including implementing power device and SUNW,power-off CIF service for sun4u)
|-
|2.12
|sun4u
|Convert APB, IOMMU and ebus devices to use QOM/qdev, add trace-events support, split out sun4u-iommu into a separate device, split apb.c into separate Simba and Sabre devices
|-
|2.11
|sun4u
|Include Simba PCI bridges in sun4u PCI topology
|-
|2.11
|sun4u
|Add support for Sun Happy Meal Ethernet NIC and make it the default for the sun4u machine
|-
|2.11
|sun4m
|Rework sun4m DMA/IOMMU to use QEMU's DMA/IOMMU APIs rather than using existing legacy code
|-
|2.10
|sun4m
|Fix for panic when booting 32-bit Solaris 2.6 (OpenBIOS)
|-
|2.10
|sun4m
|Fix for Solaris terminal console colors (OpenBIOS)
|-
|2.9
|niagara
|Complete rewrite from Artyom now able to boot OpenSPARC reference [http://download.oracle.com/technetwork/systems/opensparc/OpenSPARCT1_Arch.1.5.tar.bz2 image] (see the docs at https://qemu.weilnetz.de/doc/qemu-doc.html#Sparc64-System-emulator for more info)
|-
|
|sun4m
|Fix for SS-20 regression with original PROM [https://bugs.launchpad.net/qemu/+bug/1622547 bug].
|-
|2.8
|*
|More TCG improvements from Richard.
|-
|2.7
|sun4m
|Updated ldstub fix for latest TCG improvements and updated OpenBIOS boot path fix Solaris 9 boot [https://bugs.launchpad.net/qemu/+bug/1588328 regression]
|-
|-
|2.6
|2.6
Line 226: Line 547:
OpenBIOS is the Open Firmware implementation used by QEMU for SPARC32/SPARC64 (and indeed also for PPC)
OpenBIOS is the Open Firmware implementation used by QEMU for SPARC32/SPARC64 (and indeed also for PPC)


* Fun with virtualisation - http://virtuallyfun.superglobalmegacorp.com/
* Fun with virtualisation - https://virtuallyfun.com/


Neozeed's fun with virtualisation blog has several useful articles on booting various OSs (including SPARC) under QEMU.
Neozeed's fun with virtualisation blog has several useful articles on booting various OSs (including SPARC) under QEMU.


* MVoloshin's 4pda page for Limbo SPARC emulator (Russian) - http://4pda.ru/forum/index.php?showtopic=840418
The forum page contains several screen shots and links to the associated QEMU SPARC disk images.


== Pictures ==
[[File:solaris-install-overview.png|400px|Solaris installer overview]]<span style="margin:20px;"></span>
[[File:solaris-terminal.png|400px|Solaris terminal program]]<br><br>
[[File:solaris-install-progress.png|400px|Solaris installer progress]]<span style="margin:20px;"></span>
[[File:solaris-desktop.png|400px|Solaris desktop]]<br><br>
== Contact ==
== Contact ==


Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

Latest revision as of 21:25, 29 April 2024

Welcome to the SPARC homepage. This page contains news and resources for users looking to emulate sun4m, sun4u or sun4v systems under QEMU.

Status

The table below gives the status of the SPARC machines available in QEMU and is correct as of the latest release:

Machine Status
sun4m Complete, supported
sun4u Beta, supported
sun4v Incomplete, unsupported
niagara Complete, supported

Installation

Debian/RedHat packages

Users should install the qemu-system-sparc package in order the use the SPARC system emulators provided by their distribution.

Building from source

By default QEMU will build both the qemu-system-sparc and qemu-system-sparc64 system emulators unless QEMU has been configured with a specific target list. If you are looking to build just the SPARC system emulators from source yourself, then pass the options --target-list="sparc-softmmu sparc64-softmmu" to QEMU's configure script.

Getting started

The most common ways to start qemu-system-sparc and qemu-system-sparc64 are shown below:

  • sun4m with HD and CD (boot from CD)
qemu-system-sparc \
  -drive file=hd.qcow2,if=scsi,bus=0,unit=0,media=disk \
  -drive file=cdrom.iso,format=raw,if=scsi,bus=0,unit=2,media=cdrom,readonly=on \
  -boot d
  • sun4m with HD only
qemu-system-sparc \
  -drive file=hd.qcow2,if=scsi,bus=0,unit=0,media=disk
  • sun4u with HD and CD (boot from CD)
qemu-system-sparc64 \
  -drive file=hd.qcow2,if=ide,bus=0,unit=0 \
  -drive file=cdrom.iso,format=raw,if=ide,bus=1,unit=0,media=cdrom,readonly=on \
  -boot d
  • sun4u with HD only
qemu-system-sparc64 \
  -drive file=hd.qcow2,if=ide,bus=0,unit=0
  • sun4u with virtio HD and CD (boot from CD, requires QEMU >= 3.1)
qemu-system-sparc64 \
  -drive file=hd.qcow2,if=none,id=hd \
  -drive file=cdrom.iso,format=raw,if=ide,bus=1,unit=0,media=cdrom,readonly=on \
  -device virtio-blk-pci,bus=pciB,drive=hd
  -boot d
  • sun4u with virtio HD (requires QEMU >= 3.1)
qemu-system-sparc64 \
  -drive file=hd.qcow2,if=none,id=hd \
  -device virtio-blk-pci,bus=pciB,drive=hd,bootindex=0

Changes to sun4u machine from 2.11 onwards

In order to improve the compatibility of QEMU's sun4u machine, there have been a number of changes that have been made during the 2.11 development cycle which in some cases will require changes to the command line to start qemu-system-sparc64.

Default network card changed from ne2k_pci to sunhme (Happy Meal Ethernet)

Many OSs either don't have drivers for other network cards, don't build other network cards for SPARC architecture or even have faulty drivers because they have never been tested on big-endian machines. Implementing the real onboard sunhme enables networking for just about every OS.

Example: using ne2k_pci (the previous default) as for QEMU <= 2.10:

qemu-system-sparc64 -net nic,model=ne2k_pci -net user

All PCI devices are attached behind one of the simba PCI bridges

Previous versions of QEMU attached all PCI devices to the sabre PCI bus which does not match the PCI topology of a real Ultra 5. On a real Ultra 5 all PCI devices are attached behind the two simba bridges; in-built devices are attached to bus A whilst bus B has 4 free PCI slots for use.

In order to support this topology QEMU included some hacks to enable PCI devices to be connected directly to the sabre PCI bus and re-work the interrupt routing. Typically this is visible during Linux boot as a set of warnings about overlapping PCI window ranges, and it is up to the OS to attempt to resolve the clashes itself.

By correctly modelling these bridges, the PCI topology and interrupt routing are now implemented correctly as per the available documentation which removes all visible guest OS warnings in my tests and allows these hacks to be removed.

IMPORTANT: as it is now impossible to plug PCI devices into the sabre PCI bus then it is necessary to make a slight change to the command line used to plug additional PCI devices into QEMU.

  • Example: adding a virtio block device
qemu-system-sparc64 -drive id=hd,if=none,file=hd.qcow2 -device virtio-blk-pci,bus=pciB,drive=hd

Note that the important part of the -device parameter is the bus=pciB which ensures that the virtio-blk-pci device is plugged into the correct simba bus.

If by accident this is omitted (as typically when using QEMU <= 2.10) then QEMU will exit with a message similar to the following:

qemu-system-sparc64: -device virtio-blk-pci,drive=hd: PCI: no slot/function available for virtio-blk-pci, all in use or reserved


Compatibility

The tables below show the results of testing various SPARC and SPARC64 guests in QEMU in the latest release:

SPARC32:

Machine OS Image Status Notes
sun4m Aurora Linux 1.0 (Ansel) aurora-1.0-sparc-disc1.iso Working Requires -vga cg3 for graphics (default TCX adapter not supported)
sun4m Aurora Linux 2.0 (Kashmir FC3) aurora-2.0-sparc-DVD.iso Working -
sun4m Bobware 10.2 bobware-10.2.rc7-disk1.iso Working Requires -vga cg3 for graphics (default TCX adapter not supported)
sun4m Debian Sarge debian-31r1a-sparc-businesscard.iso Working Requires -vga cg3 for graphics (default TCX adapter not supported)
sun4m Debian Etch debian-40r4a-sparc-netinst.iso Working -
sun4m Mandrake 7.1 (Hydrogen) Mandrake71-inst.sparc.iso Working Requires -vga cg3 for graphics (default TCX adapter not supported)
DHCP autoconfiguration fails. Shutdown freezes at unloading cs4231 kernel module.
sun4m MirOS #10semel MIR80316.ISO Broken Panic: NMI
sun4m NetBSD 6.1.3 NetBSD-6.1.3-sparc.iso Working -
sun4m NetBSD 7.99.1 (7.0 pre-release) NetBSD-7.99.1-sparc.iso Working Works fine, although intermittent ESP DMA errors appear on the console.
sun4m NetBSD 7.1 NetBSD-7.1-sparc.iso Working -
sun4m NextSTEP 3.3 ? Partially working Tends to hang during disk access, possible ESP emulation bug or interrupt delay required. Some success has been reported using a non-SMP host kernel suggesting a buggy interrupt race in the NS guest drivers.
sun4m OpenADK (modern Linux kernel) http://www.openadk.org Working -
sun4m OpenBSD 5.2 install52.iso Working -
sun4m OpenBSD 5.8 install58.iso Working Requires -nographic to boot
sun4m OpenSTEP 4.2 ? Partially working Tends to hang during disk access, possible ESP emulation bug or interrupt delay required. Some success has been reported using a non-SMP host kernel suggesting a buggy interrupt race in the NS guest drivers.
sun4m RedHat 6.2 (Zoot) redhat-6.2-sparc.iso Working Requires -vga cg3 for graphics (default TCX adapter not supported)
sun4m Solaris 1.1.2 ? Working -
sun4m Solaris 2.6 ? Working -
sun4m Solaris 7 32-bit ? Working -
sun4m Solaris 8 32-bit ? Working -
sun4m Splack 8.0 splack-24oct2k3.iso Working Requires -vga cg3 for graphics (default TCX adapter not supported)

SPARC64:

Machine OS Image Status Notes
sun4u Debian Wheezy debian-7.8.0-sparc-netinst.iso Working Requires -nographic in order to boot
sun4u Debian Stretch debian-9.0-sparc64-NETINST-1.iso Working Requires -nographic in order to boot
sun4u FreeBSD 10.3 FreeBSD-10.3-RELEASE-sparc64-disc1.iso Working Requires -nographic in order to boot. Due to a restriction in reading the psycho device properties, kernels < 10.3 panic on boot. A fix for this has been merged into both 10.3 and the up-and-coming 11.0 release.
sun4u HelenOS 0.7.0 HelenOS-0.7.0-sparc64-ultra.iso Working QEMU < 2.11:
Requires -nographic -prom-env boot-args="console=devices/\\hw\\pci0\\00:03.0\\com1\\a" to boot.

QEMU >= 2.11:
Requires -nographic -prom-env boot-args="console=devices/\\hw\\pci0\\01:01.0\\com1\\a" to boot.

sun4u Milax 0.3.2 (OpenSolaris) milax032sparc.iso Broken Requires -nographic to boot. Reaches userspace console then freezes.
sun4u NetBSD 7.0 NetBSD-7.0-sparc64.iso Working -
sun4u OpenADK (modern Linux kernel) http://www.openadk.org Working -
sun4u OpenBSD 5.5 install55.iso Working Requires -nographic to boot. Due to hard-coded device tree paths for the cmd646-ide device, the root device must be entered on boot.
Machine OS Image Status Notes
niagara HelenOS 0.7.0 HelenOS-0.7.0-sparc64-niagara.iso Working Tested with the command line:

qemu-system-sparc64 -M niagara -m 256 -L /usr/local/opensparc/image/ -drive file=hdisk.img,index=0,media=disk,format=raw -drive if=pflash,readonly=on,file=HelenOS-0.7.0-sparc64-niagara.iso -nographic

niagara OpenSPARC T1 Solaris 10 image OpenSPARCT1_Arch.1.5.tar.bz2 Working Tested with the command line:

qemu-system-sparc64 -M niagara -L /path-to/S10image/ -nographic -m 256 -drive if=pflash,readonly=on,file=/S10image/disk.s10hw2

Timeline

SPARC emulation is gradually improving over time and newer versions of QEMU will run significantly better than older ones. For more detailed information, check your QEMU version against the table below:

Version Machine Feature
9.0 sun4m Fix ASI_USERTXT access which caused the Solaris kernel to panic when using mdb/gdb/adb within the guest
8.2 * Convert SPARC instruction decoder to use decodetree
8.1 sun4v Fix block device error when trying to boot niagara machine
8.1 sun4m Allow keyboard language DIP switches to be set via the -global escc.chnA-sunkbd-layout option
8.1 * Update target/sparc to use tcg_gen_lookup_and_goto_ptr() for improved performance
6.2 sun4m Fix for booting sun4m machines with more than 1 CPU
5.2 sun4u Fix for sabre PCI IRQs being lost due to memory overflow
5.2 sun4m Fix panic when booting NetBSD with the TCX framebuffer (LP:1892540)
5.1 sun4u Fix booting of SPARC64 kernels directly from the command line via -kernel and booting from virtio-blk-pci devices
4.2 sun4u Implementation of sun4u MMU IE (Invert Endian) bit (Tony Nguyen)
4.1 sun4u Fix console when running with -vga none, sunhme fixes when running on a TAP network interface
4.1 sun4m Fix console when running with -vga none
4.0 sun4m Fix Solaris boot on SS-10/SS-20 machines with OpenBIOS (OpenBIOS)
3.1 sun4u Add support for boot from virtio-blk-pci block devices (QEMU/OpenBIOS)
3.0 sun4u Add icount support
2.12 * Add "power-off" command to OpenBIOS (including implementing power device and SUNW,power-off CIF service for sun4u)
2.12 sun4u Convert APB, IOMMU and ebus devices to use QOM/qdev, add trace-events support, split out sun4u-iommu into a separate device, split apb.c into separate Simba and Sabre devices
2.11 sun4u Include Simba PCI bridges in sun4u PCI topology
2.11 sun4u Add support for Sun Happy Meal Ethernet NIC and make it the default for the sun4u machine
2.11 sun4m Rework sun4m DMA/IOMMU to use QEMU's DMA/IOMMU APIs rather than using existing legacy code
2.10 sun4m Fix for panic when booting 32-bit Solaris 2.6 (OpenBIOS)
2.10 sun4m Fix for Solaris terminal console colors (OpenBIOS)
2.9 niagara Complete rewrite from Artyom now able to boot OpenSPARC reference image (see the docs at https://qemu.weilnetz.de/doc/qemu-doc.html#Sparc64-System-emulator for more info)
sun4m Fix for SS-20 regression with original PROM bug.
2.8 * More TCG improvements from Richard.
2.7 sun4m Updated ldstub fix for latest TCG improvements and updated OpenBIOS boot path fix Solaris 9 boot regression
2.6 sun4m Fix for ldstub instruction resolves several 32-bit Solaris bugs (MUTEX_HELD hang, libC error, Java WebStart segfault)
2.6 sun4u FreeBSD 10.3+ can now run under qemu-system-sparc64 in -nographic mode
2.5 sun4u Fixes in OpenBIOS fix EBus enumeration under FreeBSD sparc64 in -nographic mode
2.5 * Significantly improved TCG performance for software TLB systems (including SPARC)
2.3 sun4m Fix Solaris 1.1.2 boot in OpenBIOS and multi-user mode in Solaris 9
sun4u Fix m48t59 MMIO access to allow guests to read the NVRAM clock correctly
2.2 sun4u Add ability to boot NetBSD sparc64 and OpenBSD sparc64 in -nographic mode
2.1 sun4u Fixes for APB PCI bridge and added IOMMU implementation
2.0 sun4m Add cg3 framebuffer implementation primarily to support older Solaris versions
1.7 sun4m Add TCX FCode ROM for framebuffer (allows TCX adapter to boot Sun PROM in graphics mode)

Useful links

This page details how to set up a basic Debian SPARC image in QEMU.

Artyom has contributed several patches to improve SPARC emulation under QEMU and has lot of related information, particularly for users trying to run Solaris images under emulation. Some of the content is a little out of date (OpenBIOS should work with practically all Solaris versions now) but the FAQ is very helpful indeed.

Torbjörn uses QEMU to build and test the GNU GMP libraries on various platforms, and while the information is a little out of date, there are some useful configurations listed on the page.

This page contains a description of how to take an SS-20 Solaris image from a physical machine and run it under QEMU.

Olivier Danet has implemented a sun4m machine in an FPGA which is capable of booting many SPARC32 OSs, and as a consequence has provided several patches to fix bugs in SPARC32 emulation (and also OpenBIOS)

OpenBIOS is the Open Firmware implementation used by QEMU for SPARC32/SPARC64 (and indeed also for PPC)

Neozeed's fun with virtualisation blog has several useful articles on booting various OSs (including SPARC) under QEMU.

The forum page contains several screen shots and links to the associated QEMU SPARC disk images.

Pictures

Solaris installer overview Solaris terminal program

Solaris installer progress Solaris desktop

Contact

Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>