Sunday 16 May 2021

SunOS 4.1.4 for SPARC on QEMU (sun4m) - System Information

SunOS 4.1.4

Sun Microsystems used the name SunOS (Wikipedia) for its BSD (Wikipedia) based UNIX operating system starting with the Motorola 68000 powered Sun-1 (Wikipedia) launched in 1982 through the Sun-2, Sun-3 and Sun-4 based workstations and servers up to the final SunOS release (SunOS 4.1.4) in 1998. With the release of the System V release 4 based Solaris 2.x in 1992, SunOS versions from 4.1.1 were re-branded as Solaris 1.x while retaining their BSD flavor.

Since SunOS 4 and Solaris 2+ are a bit different I'll look at them separately, to see how they handle and report on running under QEMU.

By default the 32-bit SPARC system emulation in QEMU creates a Sun SPARCstation 5 system (Wikipedia):

  • Buses: Mbus & Sbus
  • CPU: microSPARC II
  • RAM: 128 MB (max. 256 MB)
  • SCSI controller: Sun esp (Emulex SCSI Processor)
  • Network controller: Sun LANCE (based on AMD Lance)
  • Graphics: Sun TCX

So using the commands from the generic and SunOS system information posts let's see what's what.

uname

Operating system name, version and system architecture.

sun4qemu# uname -a
SunOS sun4qemu 4.1.4 2 sun4m

So we have SunOS version 4.1.4 release 2 on an Mbus Sun-4 (SPARC) system named "sun4qemu". That confirms the system to be as expected.

showrev

Alternative view of operating system release information giving a little more detail.

# showrev -a
***************  showrev version 1.15  *****************
* Hostname: "sun4qemu"
* Hostid: "80123456"
* Kernel Arch: "sun4m"
* Application Arch: "sun4"
* Kernel Revision:
  4.1.4 (GENERIC) #2: Fri Oct 14 11:09:47 PDT 1994
* Release: 4.1.4
* OpenWindows: OW
* SunView:
	/usr/lib/libsuntool	:0.54
	/usr/lib/libsunwindow	:0.55
	/usr/lib/libpixrect	:2.14
	/usr/lib/libdl		:1.0
	/usr/lib/libc		:1.9
* Patch:
  No patch information found.
*******************************************************

A little bit more meat here with a more readable version of the operating system information. This also tells us a bit about the available windowing systems in this case the OpenWindows and SunView versions.

Worth noting that the SunView windowing system was dropped from Solaris in Solaris 2.3, so earlier releases are required to run SunView based applications.

devinfo

A report of device information using a tree structure to show relationships.

sun4qemu# devinfo
Node 'SUNW,SPARCstation-5', unit #0 (no driver)
	Node 'packages', unit #0 (no driver)
	Node 'options', unit #0 (no driver)
	Node 'aliases', unit #0 (no driver)
	Node 'openprom', unit #0 (no driver)
	Node 'iommu', unit #0
		Node 'sbus', unit #0
			Node 'espdma', unit #0
				Node 'esp', unit #0
					Node 'sd', unit #3
			Node 'SUNW,bpp', unit #0 (no driver)
			Node 'ledma', unit #0
				Node 'le', unit #0
			Node 'SUNW,CS4231', unit #0
			Node 'power-management', unit #0 (no driver)
			Node 'SUNW,tcx', unit #0
	Node 'obio', unit #0
		Node 'zs', unit #0
		Node 'zs', unit #1
		Node 'eeprom', unit #0 (no driver)
		Node 'slavioconfig', unit #0 (no driver)
		Node 'auxio', unit #0 (no driver)
		Node 'counter', unit #0 (no driver)
		Node 'interrupt', unit #0 (no driver)
		Node 'power', unit #0 (no driver)
		Node 'SUNW,fdtwo', unit #0
	Node 'memory', unit #0 (no driver)
	Node 'virtual-memory', unit #0 (no driver)
	Node 'FMI,MB86904', unit #0 (no driver)

The tree structure reflects the relationships between the various devices:

  • System: SUNW,SPARCstation-5
  • SCSI controller: esp
  • Parallel port controller: SUNW,bpp
  • Ethernet device: le
  • Audio device: SUNW,CS4231
  • Display controller: SUNW,tcx
  • Floppy controller: SUNW,fdtwo
  • CPU: FMI,MB86904

I'm guessing that some of the "no driver" messages are due to miss-matches between the hardware described by the system and the emulation of those devices, of course most are likely cases where a driver is not required.

In any case the device tree looks to match up with our expectations for the emulated system.

dmesg

System log messages

sun4qemu# dmesg
May 14 13:04
VAC ENABLED
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 = 261836K (0xffb3000)
avail mem = 253947904
entering uniprocessor mode
Ethernet address = 52:54:0:12:34:56
espdma0 at  SBus slot 5 0x8400000
esp0 at  SBus slot 5 0x8800000 pri 4 (onboard)
sd3:    non-CCS device found at target 0 lun 0 on esp0
sd3 at esp0 target 0 lun 0
sd3: <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
Warning! System Clock freq out of range!
ledma0 at  SBus slot 5 0x8400010
le0 at  SBus slot 5 0x8c00000 pri 6 (onboard)
SUNW,CS42310 at  SBus slot 4 0xc000000 pri 9 (sbus level 5)
SUNW,tcx0 at  SBus slot 3 0x800000 and  SBus slot 3 0x2000000 and  SBus slot 3 0x4000000 and  SBus slot 3 0x6000000 and  SBus slot 3 0xa000000 and  SBus slot 3 0xc000000 and  SBus slot 3 0xe000000 and  SBus slot 3 0x701000 and  SBus slot 3 0x200000 and  SBus slot 3 0x300000 and  SBus slot 3 0x0 and  SBus slot 3 0x240000 and  SBus slot 3 0x280000 pri 9 (sbus level 5)
tcx0: revision 0, screen 1024x768
zs0 at  SBus slot 5 0x1100000 pri 12 (onboard)
zs1 at  SBus slot 5 0x1000000 pri 12 (onboard)
SUNW,fdtwo0 at  SBus slot 5 0x1400000 pri 11 (onboard)
fdintr: nobody sleeping
root on sd3a fstype 4.2
swap on sd3b fstype spec size 98800K
dump on sd3b fstype spec size 98788K
le0: AUI Ethernet

Lost of stuff in here including the reporting of the system type and the various devices. There is also a warning "Warning! System Clock freq out of range!" which is likely related to the emulation being a bit faster than real SPARCstation 5 hardware. Otherwise this looks consistent with the expected hardware, so it looks to be going great.

Sun OpenBoot PROM

The system firmware (OpenBoot) also provides some information about the system. Here a binary dump of the firmware from a real SPARCstation 5 is used rather than the QEMU supplied OpenBIOS firmware. While OpenBIOS supports the show-devs command the other commands are hardware specific and are not implemented on OpenBIOS.

Note the 'ok' is the firmware prompt.

show-devs

Show devices on the system.

ok show-devs
/FMI,MB86904
/virtual-memory@0,0
/memory@0,0
/obio
/iommu@0,10000000
/openprom
/aliases
/options
/packages
/obio/SUNW,fdtwo@0,400000
/obio/power@0,910000
/obio/interrupt@0,e00000
/obio/counter@0,d00000
/obio/auxio@0,900000
/obio/slavioconfig@0,800000
/obio/eeprom@0,200000
/obio/zs@0,0
/obio/zs@0,100000
/iommu@0,10000000/sbus@0,10001000
/iommu@0,10000000/sbus@0,10001000/SUNW,tcx@3,800000
/iommu@0,10000000/sbus@0,10001000/power-management@4,a000000
/iommu@0,10000000/sbus@0,10001000/SUNW,CS4231@4,c000000
/iommu@0,10000000/sbus@0,10001000/ledma@5,8400010
/iommu@0,10000000/sbus@0,10001000/SUNW,bpp@5,c800000
/iommu@0,10000000/sbus@0,10001000/espdma@5,8400000
/iommu@0,10000000/sbus@0,10001000/ledma@5,8400010/le@5,8c00000
/iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000
/iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/st
/iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd
/packages/obp-tftp
/packages/deblocker
/packages/disk-label

Notable items are:

  • CPU: FMI,MB86904
  • floppy controller: SUNW,fdtwo
  • display device: SUNW,tcx
  • audio device: SUNW,CS4231
  • ethernet device and interface: ledma
  • bidirectional parallel port device: SUNW,bpp
  • SCSI controller, interface & disks: espdma

As for the SunOS devinfo command, the tree structure represents the relationships between the devices and the system buses.

cpu-info

CPU information

ok cpu-info
CPU FMI,MB86904 Rev. 2.3 : 529.0 Mhz 
SBus (Divide By 2)       : 764.5 Mhz 
DRAM Refresh Setting     : 7 
DRAM Speed Setting       : 0 

The emulation is showing its performance here, the real SPARCstation 5 didn't ship with processor or Sbus showing these kinds of speeds. According the various internet sources the Sbus speed should be clocked at between 16 and 25 MHz, which may explain the "Warning! System Clock freq out of range!" message reported in the dmesg output. The warning doesn't appear when using OpenBIOS suggesting that it handles these figures slightly differently, most likely by changing the Sbus divider to keep it within the expected frequency range.

module-info

Processor module information.

ok module-info
CPU FMI,MB86904 Rev. 2.3 : 529.0 Mhz 
SBus (Divide By 2)       : 764.5 Mhz 

Similar to cpu-info, the details of the processor and Sbus are reported. For the SPARCstation 5 there is only one processor so the information is a bit redundant with that reported by cpu-info. For systems with multiple processor modules (e.g. SPARCstation 10 or SPARCstation 20), a bit more information about the bus speeds and the installed modules would be reported.

Thoughts

The 32-bit SPARC based SPARCstation 5 emulation in QEMU appears to be pretty robust and gives better performance than the real hardware. It even supports the graphic system allowing the windowing systems to be used with an emulated keyboard and mouse.

Apparently things aren't quite as good with the other 32-bit SPARC systems emulated, with issues appearing when attempting to use graphics or multi-processor support on those systems. However single processor headless systems appear to be fine, and the issues are being worked on.

Sources

  • Reference Manual Pages for SunOS 4.1.2 [PDF]
  • SPARC-HOWTO
  • OpenBoot™ 4.x Command Reference Manual [PDF]
  • Sun OpenBoot PROM Quick Reference Card [PDF]

QEMU Command

For those interested, the emulated system, using Sun OpenBoot, was started using the command:

$ qemu-system-sparc -machine 'SS-5' -bios ss5.bin -m size=256M -drive file=hda_ss5_sunos.qcow2,bus=0,unit=0,media=disk -net nic -net user -name 'SunOS 4.1.4 on SPARCstation 5'

Once the OpenBoot firmware has started the system on disk was started with:

ok boot disk0

Since the target operating system is SunOS using the Sun OpenBoot firmware maximises compatibility. The QEMU supplied OpenBIOS can be used instead.


No comments: