old-www/LDP/LG/issue72/forsberg.html

303 lines
16 KiB
HTML

<!--startcut ==============================================-->
<!-- *** BEGIN HTML header *** -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML><HEAD>
<title>Installing Linux on a Sun SPARC Ultra 5 LG #72</title>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#0000AF"
ALINK="#FF0000">
<!-- *** END HTML header *** -->
<CENTER>
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/lglogo.png"
WIDTH="600" HEIGHT="124" border="0"></A>
<BR>
<!-- *** BEGIN navbar *** -->
<IMG ALT="" SRC="../gx/navbar/left.jpg" WIDTH="14" HEIGHT="45" BORDER="0" ALIGN="bottom"><A HREF="field.html"><IMG ALT="[ Prev ]" SRC="../gx/navbar/prev.jpg" WIDTH="16" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="index.html"><IMG ALT="[ Table of Contents ]" SRC="../gx/navbar/toc.jpg" WIDTH="220" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><A HREF="../index.html"><IMG ALT="[ Front Page ]" SRC="../gx/navbar/frontpage.jpg" WIDTH="137" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="http://www.linuxgazette.com/cgi-bin/talkback/all.py?site=LG&article=http://www.linuxgazette.com/issue72/forsberg.html"><IMG ALT="[ Talkback ]" SRC="../gx/navbar/talkback.jpg" WIDTH="121" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><A HREF="../faq/index.html"><IMG ALT="[ FAQ ]" SRC="./../gx/navbar/faq.jpg"WIDTH="62" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="jones.html"><IMG ALT="[ Next ]" SRC="../gx/navbar/next.jpg" WIDTH="15" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><IMG ALT="" SRC="../gx/navbar/right.jpg" WIDTH="15" HEIGHT="45" ALIGN="bottom">
<!-- *** END navbar *** -->
<P>
</CENTER>
<!--endcut ============================================================-->
<H4 ALIGN="center">
"Linux Gazette...<I>making Linux just a little more fun!</I>"
</H4>
<P> <HR> <P>
<!--===================================================================-->
<center>
<H1><font color="maroon">Installing Linux on a Sun SPARC Ultra 5</font></H1>
<H4>By <a href="mailto:forsberg@tns.net">Bruce Forsberg</a></H4>
</center>
<P> <HR> <P>
<!-- END header -->
<BLOCKQUOTE>
<A HREF="misc/forsberg/file1.png">Click here for a screenshot of Linux on a Solaris desktop</A>
</BLOCKQUOTE>
<P><BIG><STRONG>B</STRONG></BIG>eing 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
(<A HREF="http://osalp.sourceforge.net">Open Source Audio Library Project</A>). 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.
<P>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.
<P>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 <A HREF="http://www.linuxdoc.org/">www.linuxdoc.org</A>. I also purchased Solaris
8 for $75 from Sun
(<A HREF="http://www.sun.com/software/solaris/binaries/get.html">www.sun.com/software/solaris/binaries/get.html</A>) 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.
<P><H3>Step 1 - Selecting the distribution</H3>
<P>The first step was to determine which distribution to use. Having used Linux
for several years on Intel processors, I have used
<A HREF="http://www.suse.com/">SuSE</A> many times and liked
it. When I found that SuSE had a SPARC distribution I decided on this. So I
headed over to <A HREF="http://www.cheapbytes.com">CheapBytes</A>, and 3 days
later I had my CD's. If you are undecided about what distribution to use
then check out the
<A HREF="http://www.ultralinux.org">www.ultralinux.org</A> web site. They have a list of currently
supported Linux distributions for Sun workstations.
<P><H3>Step 2 - Planning the installation</H3>
<P>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.
<P>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.
<P>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.
<P><H3>Step 3 - Installing the Linux software</H3>
<P>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.
<P>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:
<PRE>
modprobe audio
modprobe cs4231
</PRE>
<P>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.
<P>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.
<P>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:
<PRE>
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
</PRE>
<P>Now I mounted the mount points "mount /sun_root" and "mount /sun_home". Now
I can see my Solaris partitions from Linux.
<P><H3>Step 4 - Configuring Dual Boot</H3>
<P>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:
<PRE>
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
</PRE>
<P>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:
<PRE>
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
</PRE>
<P>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.
<P>There is another parameter that you can set in OpenBoot and it is:
<PRE>
setenv auto-boot? = false
</PRE>
<P>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".
<P><H3>Step 5 - Miscellaneous Notes</H3>
<P>The following are some miscellaneous notes I discovered dealing with Linux on SPARC.
<P>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.
<P>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.
<P>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.
<P><H3>Conclusion</H3>
<P>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.
<!-- *** BEGIN bio *** -->
<SPACER TYPE="vertical" SIZE="30">
<P>
<H4><IMG ALIGN=BOTTOM ALT="" SRC="../gx/note.gif">Bruce Forsberg</H4>
<EM>Bruce is just an average guy having fun with Linux. He is the
founder of the
<A HREF="http://osalp.sourceforge.net">Open Source Audio Library Project</A>.
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.</EM>
<!-- *** END bio *** -->
<!-- *** BEGIN copyright *** -->
<P> <hr> <!-- P -->
<H5 ALIGN=center>
Copyright &copy; 2001, Bruce Forsberg.<BR>
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 72 of <i>Linux Gazette</i>, November 2001</H5>
<!-- *** END copyright *** -->
<!--startcut ==========================================================-->
<HR><P>
<CENTER>
<!-- *** BEGIN navbar *** -->
<IMG ALT="" SRC="../gx/navbar/left.jpg" WIDTH="14" HEIGHT="45" BORDER="0" ALIGN="bottom"><A HREF="field.html"><IMG ALT="[ Prev ]" SRC="../gx/navbar/prev.jpg" WIDTH="16" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="index.html"><IMG ALT="[ Table of Contents ]" SRC="../gx/navbar/toc.jpg" WIDTH="220" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><A HREF="../index.html"><IMG ALT="[ Front Page ]" SRC="../gx/navbar/frontpage.jpg" WIDTH="137" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="http://www.linuxgazette.com/cgi-bin/talkback/all.py?site=LG&article=http://www.linuxgazette.com/issue72/forsberg.html"><IMG ALT="[ Talkback ]" SRC="../gx/navbar/talkback.jpg" WIDTH="121" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><A HREF="../faq/index.html"><IMG ALT="[ FAQ ]" SRC="./../gx/navbar/faq.jpg"WIDTH="62" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="jones.html"><IMG ALT="[ Next ]" SRC="../gx/navbar/next.jpg" WIDTH="15" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><IMG ALT="" SRC="../gx/navbar/right.jpg" WIDTH="15" HEIGHT="45" ALIGN="bottom">
<!-- *** END navbar *** -->
</CENTER>
</BODY></HTML>
<!--endcut ============================================================-->