Goal

Make NetBSD/sparc64 run on sun4v-based systems.

Status

Currently (as of 2023-10-10) the kernel boots fine using a single CPU (ignoring any additional available CPUs).
The only two systems known to boot the kernel so far are T2000 (T1 CPU) and S7-2 (S7 CPU).
* On T2000 the initial userland process (init) crashes after returning from a system call (access()) where an instruction MMU trap causes the register window to be incorrectly filled.
* On S7-S the intial userland process (init) runs fine and starts the installation program (sysinst), but hangs during the extraction of the sets.

Running

On real hardware

CD-ROM

Create an install disc from the official ISO image and issue a 'boot cdrom' command from OpenBoot,

Miniroot

If the sun4v system has more than one logical domain configured, a secondary logical domain can use the 'miniroot' image as a virtual disk to boot from.
Configuration of secondary virtual domain can be done by running e.g. Solaris 11.3/11.4 or OpenBSD as the primary logical domain.
Oracle documentation for the logical domain is here: https://docs.oracle.com/en/virtualization/oracle-vm-server-sparc/index.html
OpenBSD has some notes on using the logical domain feature here: https://undeadly.org/cgi?action=article;sid=20121214153413 and https://flak.tedunangst.com/post/OpenBSD-on-a-Sun-T5120

Network

Setup a boot environment with TFTP, DHCP and NFS as described in https://www.netbsd.org/docs/network/netboot/.
Note that the instruction might be a bit outdated, so some notes are present here: https://mail-index.netbsd.org/netbsd-docs/2020/10/29/msg000560.html and https://mail-index.netbsd.org/netbsd-docs/2020/10/31/msg000561.html.
The root filesystem served by the NFS server can be populated by extracting the sets from the sparc64/binary/sets directory.
Issue a 'boot net:dhcp' command to boot from the network.

On emulated hardware

QEMU

Can be used for basic verification of the kernel.
Information is available here: https://wiki.qemu.org/Documentation/Platforms/SPARC and http://tyom.blogspot.com/search?q=niagara.
Note that the 'niagara' is required machine type.
Use the NetBSD miniroot filesystem to replace the Solaris 10 image from the opensparc distribution https://www.oracle.com/servers/technologies/opensparc-overview.html.