SunOS for sun2 installation

HOME
COMPUTERS
HACKERS

This is a step by step instruction to install SunOS for the sun2 architecture on a virtual disk. This can then be used to run SunOS in an emulator, or to run it on real hardware, either by copying the virtual disk to a real one, or by emulating a real disk using a SCSI2SD adapter.

These instructions were made January 2019 by Walter Belgers. Thanks to those who have helped me with all their experiments, knowledge and insight.

A full one hour walkthrough video is available here: https://youtu.be/Ga3547LZmBk

These instructions use the Sun emulator called tme. Since its inception, there have been people making changes and improvements. I got a mail from Sigurbjörn pointing out that at https://github.com/sigurbjornl/emulator-sun-2 you will find a fork of sun-emulator2 that should work better than the original tme, also including networking for instance.

Step 1: install a (virtual) server

  • Go to the FreeBSD website and download the latest "boot" ISO file for amd64.
  • Make a virtual PC with default settings or take a real PC and boot from the CD. Choose <Install>.
  • Install FreeBSD. You can choose default values everywhere, except these:
    • Select to install "[*] ports".
    • Set up networking to be able to transfer the virtual drive at the end.
    • Create a local user with a password. Invite the user to group "wheel". Let's call the user "walter". (You can use another name.)
  • After reboot, log in as walter and become root with su.
  • Install Xorg, a window manager (I use xfce4) and a browser (I use chromium).
    • pkg install xorg
    • pkg install xfce4
    • pkg install chromium
    • echo 'dbus_enable="YES"' >> /etc/rc.conf
    • service dbus start
  • Suspend the root shell, or log out and log in as walter and type:
    • echo ". /usr/local/etc/xdg/xfce4/xinitrc" > ~/.xinitrc
    • startx
  • You are now in a graphical environment. Next up is installing tme and patching it. Install it as follows (as root):
    • cd /usr/ports/emulators/tme
    • make
  • This will build all kinds of dependencies, for which many setup questions are asked. Press enter to get the default, for all of them.
  • Once the make process has ended, install the patches and make tme again:
    • cd /usr/ports/emulators/tme/work
    • fetch http://www.heeltoe.com/download/sun2/diffs-20111125
    • patch < diffs-20111125
    • make clean
    • make install

Setting up tme

  • Log in as walter and create a working directory and set up tme:
    • cd
    • mkdir tme
    • cd tme
    • fetch https://people.csail.mit.edu/fredette/tme/sun2-multi-rev-R.bin
    • cp /usr/ports/emulators/tme/work/tme-0.8/machine/sun2/SUN2-MULTIBUS MY-SUN2
    • cp /usr/ports/emulators/tme/work/tme-0.8/machine/sun/my-sun-macros.txt .
    • tme-sun-idprom 2/120 8:0:20:12:34:56 > my-sun2-idprom.bin
    • dd if=/dev/zero of=micropolis1355.img bs=1 count=1 seek=150994943
  • You can use another name than MY-SUN2 for the main configuation file, but we will use MY-SUN2 in the remainder. You can use another MAC address than 8:0:20:12:34:45 if you like.
  • The Micropolis has 1024 cylinders, 8 heads (=tracks per cylinder), 36 sectors per track, 512 bytes per sector, so a total of 150994944 bytes. Use one less for the seek parameter in the dd command. You can choose another disk, but the Micropolis is a known disk for SunOS 3.2 easing labelling. Do not use disks that have 256 byte sectors, as tme will not work well with them.
  • Edit MY-SUN2:
    • You can increase RAM from 4MB to 7MB if you like (7 is the maximum) by editing the line starting "ram0".
    • Change the disk image filename to micropolis1355.img in the line starting "disk0"
    • Uncomment the last line to automatically power up the system.
  • Fetch and unpack the tape files, e.g.:
    • fetch http://www.heeltoe.com/download/sun2/sunos_3.2_sun2.tar.gz
    • tar xvf sunos_3.2_sun2.tar.gz
    • mv sunos_3.2_sun2 3.2

Installing SunOS 3.2

  • Start tme with "tmesh MY-SUN2"
  • In the tmesh window, attach tape 1 by entering "command tape0 load 3.2/tape1/01 3.2/tape1/02 3.2/tape1/03 3.2/tape1/04 3.2/tape1/05 3.2/tape1/06 3.2/tape1/07 3.2/tape1/08 3.2/tape1/09 3.2/tape1/10
  • In the Sun window, type the following:
    • b st()
    • b st(0,0,3)
    • 4 [choose Emulex]
    • 80000 [controller address]
    • 0 [target]
    • 0 [unit]
    • 0 [Micropolis 1355]
    • label
    • q
    • st(0,0,4)
    • st(0,0,5) [From]
    • sd(0,0,1) [To]
    • sd(0,0,1)vmunix -as
    • sd0* [boot device]
    • newfs /dev/rsd0a
    • newfs /dev/rsd0g
  • Now is a good moment to copy the file micropolis1355.img in case you want to install another SunOS version. This comes in especially handy when that SunOS laoder does not know the geometry of this disk, such as SunOS 2.0 (which will happily run from a Micropolis 1355).
    • cd /dev
    • ./MAKEDEV st0
    • mount /dev/sd0a /a
    • cd /a
    • mt -f /dev/nrst0 rew
    • mt -f /dev/nrst0 fsf 6
    • tar xvpf /dev/nrst0
    • mt -f /dev/nrst0 rew
    • mt -f /dev/nrst0 fsf 7
    • tar xvpf /dev/nrst0
    • mt -f /dev/nrst0 rew
    • mt -f /dev/nrst0 fsf 8
    • tar xvpf /dev/nrst0
    • cd /a/dev
    • ./MAKEDEV std
    • ./MAKEDEV ttys
    • ./MAKEDEV sd0
    • ./MAKEDEV st0
    • cat > /a/etc/fstab
      /dev/sd0a / 4.2 rw,noquota 1 1
      /dev/sd0g /usr 4.2 rw,noquota 1 2
      ^D
    • mv /a/etc/ypbind /a/etc/ypbind.orig
  • In the tmesh, change tapes:
    • command tape0 unload
    • command tape0 load 3.2/tape2/03 3.2/tape2/04 3.2/tape2/05 3.2/tape2/06
  • In the Sun window, type the following:
    • mount /dev/sd0g /a/usr
    • cd /a/usr
    • mt -f /dev/nrst0 rew
    • tar xvpf /dev/nrst0
    • mt -f /dev/nrst0 rew
    • mt -f /dev/nrst0 fsf 1
    • tar xvpf /dev/nrst0
    • mt -f /dev/nrst0 rew
    • mt -f /dev/nrst0 fsf 2
    • tar xvpf /dev/nrst0
    • mt -f /dev/nrst0 rew
    • mt -f /dev/nrst0 fsf 3
    • tar xvpf /dev/nrst0
  • In the tmesh, change tapes:
    • command tape0 unload
    • command tape0 load 3.2/tape3/03 3.2/tape3/04 3.2/tape3/05 3.2/tape3/06 3.2/tape3/07 3.2/tape3/08 3.2/tape3/09 3.2/tape3/10 3.2/tape3/11 3.2/tape3/12 3.2/tape3/13
  • In the Sun window, type the following (or script it):
    • mt -f /dev/nrst0 rew
    • tar xvpf /dev/nrst0
    • mt -f /dev/nrst0 rew
    • mt -f /dev/nrst0 fsf 1
    • tar xvpf /dev/nrst0
    • mt -f /dev/nrst0 rew
    • mt -f /dev/nrst0 fsf 2
    • tar xvpf /dev/nrst0
    • mt -f /dev/nrst0 rew
    • mt -f /dev/nrst0 fsf 3
    • tar xvpf /dev/nrst0
    • mt -f /dev/nrst0 rew
    • mt -f /dev/nrst0 fsf 4
    • tar xvpf /dev/nrst0
    • mt -f /dev/nrst0 rew
    • mt -f /dev/nrst0 fsf 5
    • tar xvpf /dev/nrst0
    • mt -f /dev/nrst0 rew
    • mt -f /dev/nrst0 fsf 6
    • tar xvpf /dev/nrst0
    • mt -f /dev/nrst0 rew
    • mt -f /dev/nrst0 fsf 7
    • tar xvpf /dev/nrst0
    • mt -f /dev/nrst0 rew
    • mt -f /dev/nrst0 fsf 8
    • tar xvpf /dev/nrst0
    • mt -f /dev/nrst0 rew
    • mt -f /dev/nrst0 fsf 9
    • tar xvpf /dev/nrst0
    • mt -f /dev/nrst0 rew
    • mt -f /dev/nrst0 fsf 10
    • tar xvpf /dev/nrst0
    • mt -f /dev/nrst0 rew
    • mt -f /dev/nrst0 fsf 11
    • tar xvpf /dev/nrst0
  • In the tmesh, change tapes:
    • command tape0 unload
    • command tape0 load 3.2/tape4/03 3.2/tape3/04 3.2/tape3/05 3.2/tape3/06 3.2/tape3/07
  • In the Sun window, type the following (or script it):
    • mt -f /dev/nrst0 rew
    • tar xvpf /dev/nrst0
    • mt -f /dev/nrst0 rew
    • mt -f /dev/nrst0 fsf 1
    • tar xvpf /dev/nrst0
    • mt -f /dev/nrst0 rew
    • mt -f /dev/nrst0 fsf 2
    • tar xvpf /dev/nrst0
    • mt -f /dev/nrst0 rew
    • mt -f /dev/nrst0 fsf 3
    • tar xvpf /dev/nrst0
    • mt -f /dev/nrst0 rew
    • mt -f /dev/nrst0 fsf 4
    • tar xvpf /dev/nrst0
    • cd /
    • umount /a/usr
    • umount /a
  • Quit tmesh by pressing ^C. Start again with "tmesh MY-SUN2"
  • In the Sun emulator, log in as root (no password needed).
  • Create the missing devices:
    • cd /dev
    • cat > fixdev
      for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
      do
      mknod ttyp$i c 20 $i
      mknod ptyp$i c 21 $i
      mknod win$i c 15 $i
      done
      for i in 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
      do
      mknod win$i c 15 $i
      done
      ^D
    • sh fixdev
    • chmod 666 ptyp* ttyp* win*
    • rm fixdev
  • Your system is now fully operational. You can start a graphical interface with the command "suntools".

Installing other OSes

Now you can use the existing working SunOS 3.2 installation to boot, and then extract tape archives from other releases to a second disk. I have had problems loading MUNIX from tape for some versions, but just booting a full 3.2 systems gives you all the tools you need to tranfer the tape contents to an empty disk (image). The file system format (4.2) works for SunOS 1.1, 2.0, 3.2 and 4.0.3 I found out.

For this, change MY-SUN2 as follows:

sd0 at scsibus0: tme/scsi/disk id 0 type tme-scsi-1
disk0 at sd0: tme/host/postix/disk file micropolis1355.img
sd1 at scsibus0: tme/scsi/disk id 0 type tme-scsi-1
disk1 at sd1: tme/host/postix/disk file micropolis1355-empty.img

Here, micropolis1355.img is the disk with the 3.2 install. The file micropolis1355-empty.img is a copy of the disk that was labelled and newfs'd. It will be available under SunOS 3.2 as sd2. You might have to do a "cd /dev; ./MAKEDEV sd2" to make the appropriate devices.

The rest of the procedure is the same: untar the tarballes from the tapes to / or /usr (look at the contents to determine where it goes). Make the devices in /dev. Create an /etc/fstab and rename /etc/ypbind if it exists.

For SunOS 1.1, the fstab file has a different syntax and should read:
sd0a:/:rw:1:1
sd0g:/:rw:1:2

Using the disk image on real hardware

If you have a real disk that is at least as big as the Micropolis 1355, you can use the dd tool to copy the virtual disk on it. Then, you have a physical bootable SunOS disk for the sun2 architecture. If your disk is bigger than 150MB, the extra space will not be used.

If you buy a SCSI2SD device, you can dd the virtual disk to an SD card. Set the SCSI Host Speed to "Slow" and turn on "Enable Unit Attention".

A full set of disk images with SunOS 1.1, 2.0, 3.2 and 4.0.3 that I made on virtual Micropolis 1355 drives is available for download.

You can also watch this YouTube movie about the Sun 2/120 with a real Micropolis drive, created according to the instructions here, and this movie about putting a DES chip in a Sun 2/120.

References:

Best Viewed With Any Browser

©1995-2024 Walter Belgers