Click here for a screenshot of Linux on a Solaris desktop
Being an open-source software developer, I naturally perform all my work on the Linux operating system. Anyone who does development knows the advantage of having ALL the source code available. As an example, I work on a project called the (Open Source Audio Library Project). It is a C++ class library that contains audio functionality. While doing development on my Linux laptop I was having problems with some audio sample rates. At some sample rates the audio would sound like Donald Duck and at others it would be normal. The same test would work fine on my desktop Linux machine. After extensive investigation it was determined that when I exited another operating system and booted into Linux without powering down the laptop a register on the audio chip would not get reset and would cause this problem. I found the driver in the audio code and inserted the fix into the driver and it worked. I sent the patch to Alan Cox who put it into the very next kernel release (2.2.17). If this was a problem with a proprietary OS the likelihood of this ever being fixed would be slim.
As part of my testing for my library I saw the need for three things, 1) to be able to support more OS's, 2) to be able to support big-endian CPU's, 3) and to support 64 bit computing platforms. After looking at other computers available, I determined that a computer from Sun Microsystems would be a good addition. Sun makes the most popular commercial UNIX computers and their new models use the UltraSPARC CPU's which are big-endian and 64 bits.
Sun has an entry-level computer available called the Ultra 5. A new computer would cost $2000 - $3000. This was more than I wanted to pay. So I searched Ebay and found a used Ultra 5. Used Ultra 5's now sell on Ebay for about $500 - $700. A good deal for another workstation. I bought the Ultra 5 containing a 270 Mhz UltraSPARC II processor, 64MB of memory and a 4.3 GB hard drive. If you are undecided about what kind of Sun workstation to get, then check out the SPARC-HOWTO at www.linuxdoc.org. I also purchased Solaris 8 for $75 from Sun (www.sun.com/software/solaris/binaries/get.html) and installed it. Installation went perfectly. I was able to port my software to Solaris. But knowing that some people run Linux on SPARC's meant that I needed to install Linux on the Ultra 5 as well, preferably in a dual boot configuration with Solaris 8 and Linux. The following is my experience with installing Linux on my Ultra 5.
The first step was to determine which distribution to use. Having used Linux for several years on Intel processors, I have used SuSE many times and liked it. When I found that SuSE had a SPARC distribution I decided on this. So I headed over to CheapBytes, and 3 days later I had my CD's. If you are undecided about what distribution to use then check out the www.ultralinux.org web site. They have a list of currently supported Linux distributions for Sun workstations.
The next step was to determine where to put the Linux distribution. I only had a 4.3GB hard drive installed, hardly enough to contain both Solaris and Linux. First I decided that since I had never installed Linux on SPARC I would remove the existing 4.3 GB IDE hard drive and install an old 3GB IDE hard drive to use as a test install drive. This drive came from an old Linux on Intel system. When I did this I ran into nothing but problems. Using SuSE's installer called YaST2, I was unable to partition this hard drive no matter what I did. YaST2 gives you two options, an automatic option, and a custom manual option. When using the automatic option and telling it to use the whole hard drive just returned errors that it was unable to partition the drive. Everything that I tried with the manual mode did not work either. Finally after a couple of days of trying, I decided to install Solaris on the drive first thinking that maybe the drive needs to be formatted in some way. This seemed to work. When I ran YaST2 after this and using the custom manual partitioning menu I left the SunOS Swap partition and then created a 16MB /boot partition, a 2GB / partition, and a 200MB Linux swap partition. After this the installation of the files went smooth. I found out later by surfing the Internet that when one uses a non-Solaris disk one needs to run the fdisk utility and create a Solaris disk label on the disk. It also went on to say that this label is stored in the first partition on that hard drive so the first partition can't be a Linux swap partition since it will not reserve space for this label.
Now I was ready to install the real thing. I decided to start over completely. So I purchased a new 20 GB hard drive and installed it into the Ultra 5. Next I powered up the Ultra 5 and during initialization pressed the Stop-A key sequence. This takes you to the boot PROM on the Ultra 5. I placed the install Solaris 8 CD in the CD-ROM drive and entered "boot cdrom" and away went the Solaris installation. When the install looked for the hard disk it could not find any space. Since this is not the Solaris Gazette, suffice it to say that it put me at a command prompt and I had to enter format and create a backup label on the third partition (#2) and zero out all the others and label this to the hard drive. After this I restarted the Solaris 8 install and it went fine.
For the Solaris install I created a root partition of 5GB with a 512 MB Solaris swap partition and a 2GB /export/home partition. Now I started the Linux install. I installed the first SuSE CD and rebooted the computer. When the boot started I did the Stop-A thing and typed "boot cdrom". I let YaST2 run and selected manual partition editing. I created a 512MB Linux swap partition, a 16 MB /boot partition, and the rest of the drive as the Linux / partition.
The next step is to actually install the linux software. I selected the packages I wanted and then was presented with the SILO configuration. I selected the custom SILO configuration and verified that Install SILO on partition /boot was selected. I did this rather the the MBR (Master Boot Record) since I will use OpenBoot in the PROM to select whether to boot Linux or Solaris. More on this later. By installing SILO in /boot I will be able to test different Linux kernels and boot to them. I then created a user account and entered a password for the root user. Then off went the installer installing the software, a total of 1624 packages. Everything went fine with the install.
After the install finished, I used YaST to setup the rest of the stuff one does after a Linux install. I selected the Sun Happy Meal 10/100base T interface for the network. The rest of the network sets up just like a Linux on Intel system. I then configured audio for the Ultra 5 by following the steps in the manual on the first CD-ROM. I added the following two lines to the file in /etc/init.d/boot.local:
modprobe audio modprobe cs4231
The only problem here is that the manual said the file was in /sbin not /etc. For an experienced Linux installer this was an obvious mistake in the manual but a novice might have some problem with this. I reported this to SuSE and they responded promptly, thanking me for the correction.
When I tried to run my audio application, the open call on the audio device /dev/audio just hung and never returned. After some investigation I found that KDE had an audio server running that was using the device. I went to the KDE control panel and turned off this audio server and restarted KDE, and now I have working audio on my Ultra 5.
Next I mounted the Solaris 8 disk partitions on Linux so that I could see them. The partition type that Solaris uses is called ufs. I read notes also that write capability is experimental. So I mounted both / and /home partitions from Solaris in Linux by performing the following. I performed "fdisk /dev/hda" to list the partitions that I have on my first hard drive. It turns out that I have /dev/hda1 as / and /dev/hda8 as /home. First I created mount points. I like points under /, so I did:
cd / mkdir sun_root mkdir sun_home Next I added to /etc/fstab the following lines: /dev/hda1 /sun_root ufs defaults,ro,ufstype=sun 1 0 /dev/hda8 /sun_home ufs defaults,ro,ufstype=sun 1 0
Now I mounted the mount points "mount /sun_root" and "mount /sun_home". Now I can see my Solaris partitions from Linux.
The next step is to set up booting between the two operating systems on the Ultra 5. Most of you are familiar with LILO on your Linux on Intel machine. For Linux on Solaris you will find SILO. I use SILO to boot different Linux kernels, but to boot between Solaris and Linux I use the boot PROM on the Ultra 5 called OpenBoot. The following instructions will apply to the 3.x version of OpenBoot, which should exist on all Ultra 5's. To get to the OpenBoot prompt you need to press the Stop-A key sequence. Once you are at this prompt you can type devalias, this will list all of the aliases that are defined. You should see several disk entries like:
disk /pci@1f,0/pci@1,1/ide@3/disk@0,0 disk3 /pci@1f,0/pci@1,1/ide@3/disk@3,0 disk2 /pci@1f,0/pci@1,1/ide@3/disk@2,0 disk1 /pci@1f,0/pci@1,1/ide@3/disk@1,0 disk0 /pci@1f,0/pci@1,1/ide@3/disk@0,0
All of the stuff on the right is a device entry. You can now create several aliases of your own. I created two, linux and solaris:
linux /pci@1f,0/pci@1,1/ide@3/disk@0,0:d solaris /pci@1f,0/pci@1,1/ide@3/disk@0,0:a
These are the device entries for disk0 which would be hard drive /dev/hda in a Linux on Intel box. The :letter at the right of the device entry points to the partition on that hard drive. So to boot the first partition it would be :a. To boot the forth partition you would use :d at the end. To store these entries in non-volatile ram you need to create the above entries with the nvalias command in OpenBoot. Note that if there is an alias with the entry on the right it will be replaced with the new alias.
There is another parameter that you can set in OpenBoot and it is:
setenv auto-boot? = false
This will make the computer stop at the ok prompt when powered on. This allows one to then select which OS to boot, solaris or linux. All one has to type is either "boot solaris" or "boot linux".
The following are some miscellaneous notes I discovered dealing with Linux on SPARC.
1. If you see the following messages "Unimplemented SPARC system call 69/44" from your kernel while booting then ignore them. System call 44 and system call 69 are getuid32()/geteuid32() both are not necessary on UltraSPARC.
2. Apparently, from what I have read, for Linux on UltraSPARC, the kernel is 64 bits but userland is still at 32 bits. I am not to sure what this means, but I think it means that I will not be able to compile my application as a 64 bit application.
3. The Stop-A key sequence is disabled on SuSE 7.1 and some others distributions. In SuSE it can be enabled in YaST2 by going to the misc section. I tried to enable it and when I did Stop-A the computer hung and I saw no boot prompt. So, it is probably a good idea to leave it disabled when in Linux.
Except for the initial problem of partitioning the disk everything went very
smooth. The disk problem was frustrating though. SuSE is to be commended on
a fine Linux on SPARC distribution. It is good to see this. I have seen
messages in their mail list that they are working on a SuSE 7.3 version as well.
I would also like to thank all the open source Linux programmers who have worked
on Linux on SPARC software. You have done a great job! Thank you for your
efforts. For now I have a workable solution for running both Solaris 8 and SuSE
Linux 7.1 on my Sun Microsystems Ultra 5. It is not a fast machine, being only
64MB with a 270 Mhz processor, but it does the job it was intended for,
porting software.
Bruce Forsberg
Bruce is just an average guy having fun with Linux. He is the
founder of the
Open Source Audio Library Project.
He got his start programming freeware on
windows 3.1. When he realized that all one had to do was to not
return from a message and it would hang the entire operating
system, he knew there had to be a better way. Linux was the answer.
Copyright © 2001, Bruce Forsberg.
Copying license https://www.linuxgazette.net/copying.html
Published in Issue 72 of Linux Gazette, November 2001