Running TME on Linux Subsystem for Windows (v1?)

I know in all the trade news everyone is excited that the newest Linux Subsystem for Windows will provide a native kernel. I would imagine it’s going to run along the lines of containers which means using the Hyper-V stuff. So good bye VMWare?

Anyways I want to run SunOS 2.0 which means no graphics are needed, but what I do need is a pty. I’m a n00b so I don’t know how to generate them myself, but I did see that I can piggyback on a ssh session. So first you need to enable & run sshd, which instructions are here, Although with Ubuntu 18.02 LTS there is further steps listed here. If everything is okay, you can SSH into your Windows machine, getting the Linux subsystem.

Some notes on building:

First let’s get the emulator and patches for SunOS 2

wget http://people.csail.mit.edu/fredette/tme/tme-0.8.tar.gz
tar -zxvf tme-0.8.tar.gz
wget http://www.heeltoe.com/download/sun2/diffs-20111125
cd tme-0.8
patch -p1 < ../diffs-20111125

Using GCC 5 or 7 (probably everything post version 3, the -Werror will cause building TME to error out.

I just removed the following block from configure

if test "x$enable_warnings" = "xyes" -a "x$GCC" = "xyes"; then
  CFLAGS="${CFLAGS-} -Wundef -Wall -Werror"
  CXXFLAGS="${CXXFLAGS-} -W"
fi

Now you can run configure & make. I follow the general wisdom, which involves disabling shared libraries. Otherwise you can play with the dynamic linker. Yuck.

sh configure --disable-shared
make

It doesn’t like to build in parallel, so be prepared to wait.

And yes, building fb-xlat-auto.c & fb.c does take a long while. Also make sure to have bison & flex installed.

Using Debian 9/GCC 6.3.0 I do get a bomb compiling module.c

module.c: In function 'tme_module_init':
module.c:93:3: error: 'lt_preloaded_symbols' undeclared (first use in this function)
   LTDL_SET_PRELOADED_SYMBOLS();

In this case I just copy the definition from libltdl/ltdl.h and put it into module.c It’ll complain about it being a duplicate, but it’ll compile. I don’t understand that either.

Now we need to set the variable LTDL_LIBRARY_PATH to pickup the config for each hardware component.

export LTDL_LIBRARY_PATH=$HOME/tme-0.8

Ok and now let’s get ready to install SunOS 2.0

$ mkdir sunos2
cd
cd sunos2/
wget https://web.archive.org/web/20060720001131/http://www.soupwizard.com/sun2/sunos/sunos_2.0_sun2.tar.gz
tar -zxvf sunos_2.0_sun2.tar.gz
mv sunos-2.0-sun2/tape1 .
wget http://people.csail.mit.edu/fredette/tme/sun2-multi-rev-R.bin
perl $HOME/tme-0.8/machine/sun/tme-sun-idprom 2/120 8:0:20:02:02:02 &gt; my-sun2-idprom.bin

Now we can configure the emulator. One thing to take note of is what pts device has been created once you SSH’d into Windows.

$ ls -l /dev/pts/
total 0
crw--w---- 1 jsteve tty  136, 0 May 13 15:08 0
c--------- 1 root   root   5, 2 May 13 10:47 ptmx

So in this case it’s /dev/pts/0 for me, as I’m the first (and only) thing connected.

Now you need to edit the config. This is the one that I’m using:

mainbus0: tme/machine/sun2 multibus my-sun2-idprom.bin
cpu0 at mainbus0: tme/ic/m68010
obio0 at mainbus0 obio: tme/generic/bus size 8MB
obmem0 at mainbus0 obmem: tme/generic/bus size 16MB
ram0 at obmem0 addr 0x0: tme/host/posix/memory ram 4MB
rom0 at obmem0 addr 0xef0000: tme/host/posix/memory rom sun2-multi-rev-R.bin
rom0 at obmem0 addr 0xef8000
clock0 at obio0 addr 0x2800: tme/machine/sun2/clock
tod0 at obio0 addr 0x3800: tme/machine/sun2/tod
zs0 at obio0 addr 0x2000 ipl 6: tme/machine/sun2/zs
mbio0 at mainbus0 mbio: tme/generic/bus size 8MB
mbmem0: tme/generic/bus size 8MB
mainbus0 mbmem at mbmem0 addr 0x00000
sc0 at mbmem0 addr 0x80000 ipl 2: tme/bus/multibus/sun-sc
scsibus0 at sc0: tme/scsi/bus
console0 at zs0 channel A: tme/host/posix/serial device /dev/pts/0 break-carats
sd0 at scsibus0: tme/scsi/disk id 0 type acb4000
disk0 at sd0: tme/host/posix/disk file my-sun2-disk.img
st0 at scsibus0: tme/scsi/tape id 4 type emulex-mt02
tape0 at st0: tme/host/posix/tape
command tape0 load tape1/01  tape1/02  tape1/03  tape1/04  tape1/05 tape1/06  tape1/07  tape1/08  tape1/09  tape1/10
command mainbus0 power up

Now we are almost ready! Create a 1GB disk image with dd:

dd if=/dev/zero of=my-sun2-disk.img bs=1M count=1024

Now we are ready to go. From the ssh connection just type in ‘cat > /dev/pts/0’ and now everything we type in will be on the console. Now from a normal bash session type in ‘$HOME/tme-0.8/tmesh/tmesh SUN2-MULTIBUS’ If everything goes well the bootpromp text will pop up on your SSH session.

SUN-2/120 on Windows!

And if everything has gone right, we are now at the firmware prompt, ready to install SunOS 2.0!

Instructions from retrocomputinggeek.com gives a pretty good walk through of configuring a 1GB disk, and the installation. Although as a hint use the -as flags when booting SunOS for the install. And after booting the miniroot, follow the instructions on heeltoe regarding doing the 1st tape of the install.

>b st()
Boot: st(0,0,0)
Boot: sd(0,0,1)vmunix -as
Size: 368640+57344+66652 bytes
Sun UNIX 4.2 Release 2.0 (GENERIC) #1: Mon May 20 15:32:06 PDT 1985
Copyright (c) 1985 by Sun Microsystems, Inc.
mem = 4096K (0x400000)
avail mem = 3575808
Ethernet address = 8:0:20:2:2:2
sc0 at mbmem 80000 pri 2
sd0 at sc0 slave 0
sd0: <TME1G cyl 14700 alt 2 hd 7 sec 15>
sd1 at sc0 slave 1
st0 at sc0 slave 32
zs0 at virtual eec800 pri 3
pi0 at virtual ee2000
root device? sd0*
using 100 buffers containing 366592 bytes of main memory
#

After that it’s a matter of working out which tar file goes where. Is there even an install process? I just untarred the rest of the tapes in the /usr directory.

For the impatient, tme-0.8-linux-x86_64_bin.tar.gz and
tme-0.8-SunOS-2.0.tar.gz. As always read the 404 page.

Author: neozeed

I live in SE Asia, doing generic work, enjoying my life & family

8 thoughts on “Running TME on Linux Subsystem for Windows (v1?)”

  1. WSL1, while lacking some linux features, it still nice for build and running some linux programs for lazy person like me :p . I even able to build and running FSV via Vcxsrv display (like as shown as “It’s Unix System” in Jurasic Park) and watching my projects in 3D. I’m expect WSL2 will running Wine in my Windows laptop to run old programs since old WSL only able to run 64-bit programs.

  2. Another cool hosting platform is WLS for:
    ersatz11, es40, simh, gxemul (removed from LTS since 12.04 :'( ), aranym, dosbox, dosemu, pce-ibmpc, pcem etc.

  3. Tried booting Unix v9 on this and got a segfault. Can’t get gdb on this box atm. Did you get anything similar?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.