Your own SPARCStation 5 workstation, with QEmu and Solaris, PART 1 - Setting up the emulator

Overview

Many years ago UI and UX were still in their diapers. Disk storage was frugal and expensive. A 100MB harddisk was considered huge, and it was as expensive as the whole rest of the computer system. The only systems that had developers who were exploring the corners of UI and UX were the Amiga and the Atari ST, and those systems were near to being obsolete. Let alone being considered for serious work. PCs had Windows 3.1 or Windows 95, which were graphical user interfaces, but drab as a mud fence.

Around this time, CD-ROM entered the scene. And all of a sudden, there it was: cheap storage, removable, with the stellar size of 650MB and even more! Realistic graphics, photos, video, it became available to developers almost overnight! And everyone wanted a piece of it!

Philips and Sony (who invented the CD) decided that if there is such an amount of storage, there should also be something that can make use of it. And the CD-i console was born. A great system, with great graphical potential, and huge storage space (and let's be honest: also suffering from a few serious caveats that ended it's life quite soon).

And that's when I entered the scene and became a CD-i programmer. We explored the edges of UI and UX (and of copyrights), made many mistakes and many discoveries, and together layed parts of the foundation of the modern-day User Experience that we all know.

A few years after, still a long time ago from now, Sony killed the CD-i with their PlayStation. And I had to move to greener pastures. But I still have my CD-i 605 professional development player from that time. And lately I was wondering if I could get it up and running again, and if I might even still write some software for it.

At the time we used Sun SparcStation IPC's for authoring the CD-i titles. So the first thing I did was to search Google for 'sparcstation emulator'. The first hit was 'QEMU - Sparc32 System Emulator'. And I had found my rabbit hole.

In this blog, I will recite the journey of creating an emulated Sun SparcStation 5 with QEMU and Solaris 2.6. Solaris 2.6 was the last Sun OS I used, so it made sense to go for that.

Setting up QEMU and Solaris

For this step, you will need:

  • A computer system, either Windows, Linux or Mac. I am using a MacBook Pro M2 Max, which is quite similar to Linux. On Windows, there are probably a few differences in the details.
  • A recent version of QEMU, I am using version 9.1.0.
  • A Solaris 2.6 boot disk.
 

Step 1 - Getting QEMU and Solaris

QEMU

 On a Mac, the easiest way is to use Homebrew to install QEMU.

brew install qemu

On Linux (Debian/Ubuntu), you can use apt-get.

apt-get install qemu-system

QEMU is an open-source project, so you can also choose to download the source code and build it. Just have a look on the qemu.org website.

Solaris

A Solaris 2.6 bootdisk image can be found on WinWorld. Download the 'Sun Solaris 2.6.598 [Sun SPARC]' image. After downloading and unpacking, you should end up with the following file.

solaris_2.6_598_sparc.iso

There are a few similar tutorials like this one on the web, and I used them to good effect.

  • There's a turorial on AdaFruit

    https://learn.adafruit.com/build-your-own-sparc-with-qemu-and-solaris?view=all


  • Also a tutorial on Brezular's Blog

    https://brezular.com/2012/02/17/installation-solaris-2-6-sparc-on-qemu-part2-solaris-installation/
 

Step 2 - Creating a disk image

The blogs differ from opinion on what's a usable size for the disk image. But we all have huge disk space compared to 1998, and I will follow Brezular's recommendation of 36GB. And by using his recommendation, I don't have to do the math anymore either ;).

Create the image like so.

qemu-img create -f qcow2 Solaris26.qcow2 36G

Result:

And with that, we are ready to start configuring the emulator!

 

Step 3 - Configuring the emulator

Start QEMU

Installation happens in QEMU, so we start QEMU using the following parameters:

qemu-system-sparc \
    -M SS-5 \
    -m 256 \
    -nic user,hostfwd=tcp:127.0.0.1:5555-:22 \
    -drive file=
Solaris26.qcow2,bus=0,unit=0,media=disk \
    -drive file=
solaris_2.6_598_sparc.iso,bus=0,unit=2,media=cdrom,readonly=on

The parameters mean the following:

  • -M SS-5
    This specifies the machine. In our case a SparcStation 5.
  • -m 256
    The amount of ram memory that we want. 256MB is enough for everyone.
  • -nic user,hostfwd=tcp:127.0.0.1:5555-:22
    This will be explained in more detail later, but it is to forward the SSH port 22 of the QEMU guest machine (the SparcStation) to the local machine's IP port 5555, enabling us to SSH into the emulated machine from our computer later.
  • -drive file=Solaris26.qcow2,bus=0,unit=0,media=disk
    This specifies the disk drive. It will become /dev/hda.
  • -drive file=solaris_2.6_598_sparc.iso,bus=0,unit=2,media=cdrom,readonly=on
    This specifies a cdrom drive, which has the Solaris 2.6 boot disk inserted.

The emulator will now start in the OpenBIOS bootloader.

Note: it is possible to pass an actual Sun BIOS to QEMU. You can find a few here. However, I ran into the problem that the BIOS kept trying to boot from the network, instead of show me the OK prompt, whatever I tried. With OpenBIOS I had no issue at all. I recommend to just forget about using a real Sun BIOS. And I'm also not sure about the copyright situation.

First boot

The first time we boot, we want to boot into a single-user mode prompt. For that, we type:

# boot cdrom:d -vs

The -v option stands for 'verbose', the -s option (or combined: -vs) stands for 'single-user'.

After some processing we reach the # prompt, we are now in the 'sh' shell..

Now we have to enter a few things to prepare the harddisk.

# drvconfig

This applies permissions and ownership to the drive(s).

# disks

This creates /dev entries for all attached disks.

Formatting

The disk needs to be formatted and 'labeled' before it can be used. Solaris only has the parameters of a few types of harddisk built-in, so during the formatting procedure we will have to specify the parameters maually.

The formatting procedure starts with this command.

# format

Solaris asks us which disk we want to format. Choose disk 0.

Solaris now presents us with a list of hard drives that it knows. But we will choose '16. other', because we want to enter our own parameters.

The next steps will ask for the disk parameters. We will give our disk the following parameters, for all other parameters we accept the defaults:

  • Disk type: 16
  • Number of data cylinders: 24620
  • Number of heads: 27
  • Number of data sectors/track: 107
  • Disk type name: Qemu36GB
Formatting will finishes quickly, and we must now 'label' the disk. This writes the disk parameters to the disk so that it can be read by the boot loader later.

When the disk is labeled, we can quit the format utility with the 'quit' command, and can reboot the system with the 'reboot' command. The disk is now prepared, and we can start the installation procedure.

We now have our virtual Sun SparcStation 5 workstation running on our computer!

In part 2, we will install Solaris 2.6 on it.

Comments

Popular posts from this blog

Your own SPARCStation 5 workstation, with QEmu and Solaris, PART 2 - Installing Solaris 2.6