Emulating a Sun.

A week ago, after completing the installation of a Raspberry Pi into an old Sun CDROM drive external enclosure, I posted a picture of the enclosure on Facebook. The response from an old friend was, “Can you run SunView on it?”

20130825-193902.jpg

Of course, a Raspberry Pi is no Sun Workstation so, the answer was, not directly. However, I immediately did a Google search for Sun emulators and was very surprised to find that someone had actually written one. And so my project for the next week was born.

After downloading the source to TME (The Machine Emulator) and installing all the development libraries I tried to build the blighter. Unfortuately this was not as simple as you may have thought as the configure script had a bug which only showed itself if not on a x86 machine. This and the build system’s requirement for an ancient version of the libltdl module loading library for libtool took me nearly three days to work through. Still, I did now have a binary to play with.

It was then time to try it out. Somewhat sillily I followed some instructions I found on the Internet. These instructions included how to create a disk image file and then how to configure it from within the “tape” booted kernel’s format command. Following these instructions caused the emulator to Bus Error and crash when it tried to write to the virtual disk for the first time. I wasted a day trying to debug this… but it turned out that the instructions were wrong!

Having gone back to basics and used the size and parameters from a Seagate ST1480N disk, used in the SPARCstation 2, I was able to format, partition and install the miniroot. I thought this was the end of my problems… until I tried to install the OS.

The “suninstall” program just refused to be able to seek to the correct tape file for the installation files even though mt(1) worked perfectly. Puzzling. Another number of hours trying to find why this wasn’t working and I find that the VM config file needed parameters removing from the tape drive definition as the default only worked with NetBSD as the OS and not SunOS. :-/

Everything seemed good. After a couple of hours I had a working VM on the Pi and it didn’t even seem that slow. So, I logged in and started SunView. Woohoo! Task complete, almost. The mouse emulation didn’t work properly. I thought that maybe it was due to the VM running too slowly to read the input correctly. Still, I could a least post “task complete” as I did have SunView running, which is what Richard had asked.

20130825-194105.jpg

It now took me another day or so of debugging to determine that the Mouse Systems mouse emulation was broken when encoding the movement delta values. The original code seems to require the compiler to pretend that hex values are signed integers when assigning to unsigned 8 bit integers. Well, dodgy!

Having fixed that bug all now works, if rather slowly.

Given the interest on Google+ and Twitter about this emulation I’ve spent today creating an automatic download, configure and build script with an easy to use prototype VM creation system for an emulated Sun3 running SunOS 4.1.1, which you can download here.

Openindiana: How could the developers go so wrong?

Well, today I’ve been playing with OpenIndiana, the OpenSolaris derivative created after Oracle killed off its ancestor.

Well, to say that I was rather disappointed would be an understatement. It’s rather obvious that the developers of the distribution are not system administrators of integrated networked environments otherwise they would not have made such stupid design decisions.

Anyway, here’s the story of my day:

I downloaded the live DVD desktop version initially as I assumed that this would, when installed, effectively replicate a Solaris desktop environment. Seeing as Solaris in this configuration is capable of being a fully functional server as well I assumed that this would be the case for Openindiana.

So, I created a virtual machine under VirtualBox on the Mac, booted the DVD image and started the install. I was surprised about how little interaction there was during the install process as all it asked about was how to partition the disk and to create a root password and a new user. After the install things went down hill.

Now, it seems that the Openindiana bods are trying to ape Linux. When you boot up you get a GDM login screen, but can’t log in as root. So, you log in as the user you created, not too much of a problem, except that you now can’t start any of the configuration applications, they fail silently after you type the root password. You can’t sudo commands as it says that you don’t have permission…

Finally, I managed to get past this roadblock by trying ‘su –‘ which then asked me to change the root password! Once this was done I could actually run the configuration utilities. Not that it got me very much further, as there seems to be no way to set a static IP address out of the box.

I decided to trash that version and download the server version DVD. Maybe that would be better? Surely it would, it’s designed to be a server…

I booted the DVD image and the text installer started, very similar to the old Solaris installer to begin with, except all it asked about again was the disk partitioning, root password/user creation and networking, giving only the options for no networking or automatic network configuration. There was no manual network configuration! What?!!!! This is a server install!

Also missing from the installer was any way of setting up network authentication services or modifying what was installed. The installer had been lobotomised.

Once the OS had installed and booted up there were some more nasty surprises. Again, you couldn’t set a static IP address and any changes to the networking were silently reverted. It was only with some Googling that I managed to hunt down the culprit, the network/physical:nwam service, which is the default configuration. WHY?!!! This is a SERVER not a laptop!

Once this was fixed I managed to at least get a static IP address set up but it’s far more convoluted than with Solaris 10 or before.

Other strangeness in the design… All the X installation is there, except for the X server. Eh? What’s the point of that?

By default the GUI package manager isn’t installed. Once you do, however, it’s set up by default not to see any not installed packages, which is confusing. If you know where to look you can change this but it’s a stupid default.

Getting NFS client stuff working was a challenge as well. When you manually run mount everything seems to work out of the box. NFS filesystems mount fine and everything looks dandy. So, you put some mounts into /etc/vfstab and ‘mount -a‘ works as expected. Reboot, however, and nothing happens! This is due to the fact that most of the NFS client services are not turned on by default but magically work if you run mount. Turning on the nfs/client:default service doesn’t enable the other services it requires, however, but you don’t see this until a reboot. Stupid! It should work the same way at all times. If it works magically on the command line it should work at boot as well and vice versa. Unpredictability on a server is a killer.

On the bright side, at least the kernel is enterprise grade.