Old phones on the internet..

Well it just goes to show the internet is the ultimate ‘pipe’ from one thing to another.  And in this case, people who collect legacy phone systems (yes they do exist, the people not the phones, I mean the phones of course they exist!) wanted a way to interconnect their various switches and sets to eachother.

Enter Asterisk

So it’s cool, they’ve established a wold wide network, collaborative net, or C*NET.

Which reminds me, one of these days I want to do a multi-site asterisk deployment with speex as the back end haul and see how that goes.

Novell Netware 3.12 once more runs on Qemu!

This version of Qemu seems to be one of the better ones in a LONG LONG time.

Netware 3.12

Netware 3.12

Much to my amazement, as I fully expected this to crash much like all the other versions, it actually runs.

qemu-system-i386.exe -m 16 -hda netware312.disk -device ne2k_isa,irq=10,iobase=0x300 -soundhw pcspk -serial none -parallel none -k en-us

I’m just more amazed it works.  Now I did try it on my old setup of a NE2000 on 0x300 Interrup 2/9 but I was getting some IRQ issues.  So I went ahead and reconfigured Netware for IRQ ‘A’, and set the CLI for 10. Of course I haven’t actually tested networking, this is really a ‘wow it did something’ statement.  No doubt I’ll have to build a new GNS3 test bed with this Qemu, and see how Netware performs.

I saw this git/Unix archive mentioned on TUHS

And I thought that I should broadcast it to the world. Diomidis Spinellis has gone through the hard work of going through all the old legacy Unix source code, making it easily available here.  Even more fun it to just find somewhere with a couple of GB free, and clone it!

git clone https://github.com/dspinellis/unix-history-repo

With that done, you can then ‘check’ out the repo from any of the major releases and get the source!  For example to see 4.4 BSD, you would type in:

cd unix-history-repo
git checkout BSD-4_4

Pretty cool!

And it goes up to FreeBSD 10.0.1  Release tags are:

  • Epoch
  • Research-V1
  • Research-V3
  • Research-V4
  • Research-V5
  • Research-V6
  • BSD-1
  • BSD-2
  • Research-V7
  • Bell-32V
  • BSD-3
  • BSD-4
  • BSD-4_1_snap
  • BSD-4_1c_2
  • BSD-4_2
  • BSD-4_3
  • BSD-4_3_Reno
  • BSD-4_3_Net_1
  • BSD-4_3_Tahoe
  • BSD-4_3_Net_2
  • BSD-4_4
  • BSD-4_4_Lite1
  • BSD-4_4_Lite2
  • BSD-SCCS-END
  • 386BSD-0.0
  • 386BSD-0.1
  • FreeBSD-release/1.0, 1.1, 1.1.5
  • FreeBSD-release/2.0 2.0.5, 2.1.0, 2.1.5, 2.1.6, 2.1.6.1, 2.1.7, 2.2.0, 2.2.1, 2.2.2, 2.2.5, 2.2.6, 2.2.7, 2.2.8
  • FreeBSD-release/3.0.0, 3.1.0, 3.2.0, 3.3.0, 3.4.0, 3.5.0
  • FreeBSD-release/4.0.0 4.1.0, 4.1.1, 4.2.0, 4.3.0, 4.4.0, 4.5.0, 4.6.0, 4.6.1, 4.6.2, 4.7.0, 4.8.0, 4.9.0, 4.10.0, 4.11.0
  • FreeBSD-release/5.0.0 5.1.0, 5.2.0, 5.2.1, 5.3.0, 5.4.0, 5.5.0
  • FreeBSD-release/6.0.0, 6.1.0, 6.2.0, 6.3.0, 6.4.0
  • FreeBSD-release/7.0.0, 7.1.0, 7.2.0, 7.3.0, 7.4.0
  • FreeBSD-release/8.0.0, 8.1.0, 8.2.0, 8.3.0, 8.4.0
  • FreeBSD-release/9.0.0, 9.1.0, 9.2.0
  • FreeBSD-release/10.0.0, 10.1.0

CBM Basic

I found this repository by accident, cbmbasic which is a ‘portable’ version of the old Microsoft Basic for the Commodore 8bit computers in C which can run on any manner of machine.

Really cool, right?

So for the heck of it, I fired up the x68000 toolchain, and in no time after gutting the file open operation as some stuff isn’t defined, and I wanted to see it run, I had a working executable.

C

CBM Basic

All the commands MUST BE IN UPPERCASE… Then again the Commodore did default to upper case, so I guess that isn’t a surprise.  There is no ‘system’ command to take you out of basic, but Control-C works just the same.

The other intersting thing, is that on the authors blog, pagetable.com, the original source code for the 6502 basic has been found.  Notably this version includes portions written by Bill Gates.  It is a very fascinating read.

OpenBSD 5.6 Sparc64 on Qemu

Well the good news is that like NetBSD the kernel boots.  The downside is that none of the network adapters I could think of work.  They are either ignored, or crash out the kernel.

OpenBIOS for Sparc64
Configuration device id QEMU version 1 machine id 0
kernel cmdline
CPUs: 1 x SUNW,UltraSPARC-IIi
UUID: 00000000-0000-0000-0000-000000000000
Welcome to OpenBIOS v1.1 built on Nov 15 2014 12:59
Type ‘help’ for detailed information
Trying cdrom:f…
Not a bootable ELF image
Not a bootable a.out image

Loading FCode image…
Loaded 4829 bytes
entry point is 0x4000
OpenBSD IEEE 1275 Bootblock 1.3
..
Jumping to entry point 0000000000100000 for type 0000000000000001…
switching to new context: entry point 0x100000 stack 0x00000000ffe8aa09
>> OpenBSD BOOT 1.6
Trying bsd…
open /pci@1fe,0/pci-ata@5/ide1@2200/cdrom@0:f/etc/random.seed: No such file or d
irectory
Booting /pci@1fe,0/pci-ata@5/ide1@2200/cdrom@0:f/bsd
3864176@0x1000000+2448@0x13af670+3261928@0x1800000+932376@0x1b1c5e8
symbols @ 0xffc5a300 119 start=0x1000000

Unexpected client interface exception: -1
console is /pci@1fe,0/ebus@3/su
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.
Copyright (c) 1995-2014 OpenBSD. All rights reserved. http://www.OpenBSD.org

OpenBSD 5.6 (RAMDISK) #178: Fri Aug 8 05:00:27 MDT 2014
[email protected]:/usr/src/sys/arch/sparc64/compile/RAMDISK
real mem = 2147483648 (2048MB)
avail mem = 2103877632 (2006MB)
mainbus0 at root: OpenBiosTeam,OpenBIOS
cpu0 at mainbus0: SUNW,UltraSPARC-IIi (rev 9.1) @ 100 MHz
cpu0: physical 256K instruction (64 b/l), 16K data (32 b/l), 256K external (64 b
/l)
psycho0 at mainbus0: SUNW,sabre, impl 0, version 0, ign 7c0
psycho0: bus range 0-2, PCI bus 0
psycho0: dvma map c0000000-dfffffff
pci0 at psycho0
ppb0 at pci0 dev 1 function 0 “Sun Simba” rev 0x11
pci1 at ppb0 bus 1
ppb1 at pci0 dev 1 function 1 “Sun Simba” rev 0x11
pci2 at ppb1 bus 2
unknown vendor 0x1234 product 0x1111 (class display subclass VGA, rev 0x02) at p
ci0 dev 2 function 0 not configured
ebus0 at pci0 dev 3 function 0 “Sun PCIO EBus2” rev 0x01
“fdthree” at ebus0 addr 0-ffffffff not configured
com0 at ebus0 addr 3f8-3ff ivec 0x2b: ns16550a, 16 byte fifo
com0: console
“kb_ps2” at ebus0 addr 60-67 not configured
“Realtek 8029” rev 0x00 at pci0 dev 4 function 0 not configured
pciide0 at pci0 dev 5 function 0 “CMD Technology PCI0646” rev 0x07: DMA, channel
0 configured to native-PCI, channel 1 configured to native-PCI
pciide0: using ivec 0x7d4 for native-PCI interrupt
pciide0: channel 0 disabled (no drives)
atapiscsi0 at pciide0 channel 1 drive 0
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: <QEMU, QEMU DVD-ROM, 2.2.> ATAPI 5/cdrom removable
cd0(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 2
prtc0 at mainbus0
softraid0 at root
scsibus1 at softraid0: 256 targets
bootpath: /pci@1fe,0/pci-ata@5,0/ide1@2200,0/cdrom@0,0:f
root on rd0a swap on rd0b dump on rd0b
unix-gettod:interpret: exception -13 caught
interpret h# 01c099ec unix-gettod failed with error ffffffffffffffed
WARNING: bad date in battery clock — CHECK AND RESET THE DATE!
erase ^?, werase ^W, kill ^U, intr ^C, status ^T

Welcome to the OpenBSD/sparc64 5.6 installation program.
(I)nstall, (U)pgrade, (A)utoinstall or (S)hell?

(I)nstall, (U)pgrade, (A)utoinstall or (S)hell? (I)nstall, (U)pgrade, (A)utoinst
all or (S)hell? s

#

But it’s great it’s this close!

NetBSD 6.1.5 Sparc64 on Qemu

Yes, really!

I thought I’d try it for the heck of it, and it’s working enough to go multiuser, but it has some issues with hitting the disk & network pretty hard.  But it does let you install!

I just started it up like this:

qemu-system-sparc64.exe -cdrom NetBSD-6.1.5-sparc64.iso -net nic,model=ne2k_pci -net user -boot c -hda netbsd-615-sparc64.raw -nographic -serial mon:telnet:127.0.0.1:23,server,wait -m 2048 -boot d

And in no time I was booting up!

OpenBIOS for Sparc64
Configuration device id QEMU version 1 machine id 0
kernel cmdline
CPUs: 1 x SUNW,UltraSPARC-IIi
UUID: 00000000-0000-0000-0000-000000000000
Welcome to OpenBIOS v1.1 built on Nov 15 2014 12:59
Type ‘help’ for detailed information
Trying cdrom:f…
Not a bootable ELF image
Not a bootable a.out image

Loading FCode image…
Loaded 7478 bytes
entry point is 0x4000
NetBSD IEEE 1275 Multi-FS Bootblock
Version $NetBSD: bootblk.fth,v 1.13 2010/06/24 00:54:12 eeh Exp $
..
Jumping to entry point 0000000000100000 for type 0000000000000001…
switching to new context: entry point 0x100000 stack 0x00000000ffe8aa09
>> NetBSD/sparc64 OpenFirmware Boot, Revision 1.16
=0x8870a0
Loading netbsd: 8072208+553056+339856 [601032+393301]=0x9cd528
Unimplemented service set-symbol-lookup ([2] — [0])

Unexpected client interface exception: -1
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010, 2011, 2012
The NetBSD Foundation, Inc. All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.

NetBSD 6.1.5 (GENERIC)
total memory = 2048 MB
avail memory = 1997 MB
mainbus0 (root): OpenBiosTeam,OpenBIOS: hostid 80123456
cpu0 at mainbus0: SUNW,UltraSPARC-IIi @ 100 MHz, UPA id 0
cpu0: 256K instruction (64 b/l), 16K data (32 b/l), 256K external (64 b/l)
psycho0 at mainbus0
psycho0: SUNW,sabre: impl 0, version 0: ign 7c0 bus range 0 to 2; PCI bus 0
pci0 at psycho0
ppb0 at pci0 dev 1 function 0: Sun Microsystems Simba PCI Bridge (rev. 0x11)
pci1 at ppb0 bus 1
ppb1 at pci0 dev 1 function 1: Sun Microsystems Simba PCI Bridge (rev. 0x11)
pci2 at ppb1 bus 2
genfb0 at pci0 dev 2 function 0: unmatched vendor 0x1234 product 0x1111 (rev. 0x02)
ebus0 at pci0 dev 3 function 0
ebus0: Sun Microsystems PCIO Ebus2, revision 0x01
fdthree at ebus0 addr 0-ffffffff not configured
com0 at ebus0 addr 3f8-3ff ipl 2b: ns16550a, working fifo
com0: console
kb_ps2 at ebus0 addr 60-67 not configured
ne0 at pci0 dev 4 function 0: Realtek 8029 Ethernet
ne0: Ethernet address 52:54:00:12:34:56
ne0: 10base2, 10baseT, 10baseT-FDX, auto, default [0x40 0x40] 10baseT-FDX
ne0: interrupting at ivec 3010
cmdide0 at pci0 dev 5 function 0: CMD Technology PCI0646 (rev. 0x07)
cmdide0: primary channel configured to native-PCI mode
cmdide0: using ivec 14 for native-PCI interrupt
atabus0 at cmdide0 channel 0
cmdide0: secondary channel configured to native-PCI mode
atabus1 at cmdide0 channel 1
NULL phandle
Unexpected client interface exception: -1
pcons at mainbus0 not configured
No counter-timer — using %tick at 100MHz as system clock.
wd0 at atabus0 drive 0
wd0: <QEMU HARDDISK>
wd0: 2048 MB, 4161 cyl, 16 head, 63 sec, 512 bytes/sect x 4194304 sectors
atapibus0 at atabus1: 2 targets
cd0 at atapibus0 drive 0: <QEMU DVD-ROM, QM00003, 2.2.50> cdrom removable
wd0: no disk label
wd0: no disk label
FATAL: boot device not found, check your firmware settings!
root device: cd0c
dump device (default cd0b):
file system (default generic):
root on cd0c dumps on cd0b
root file system type: cd9660
WARNING: no TOD clock present
WARNING: using default initial time
warning: no /dev/console
init path (default /sbin/init):
init: trying /sbin/init
Created tmpfs /dev (622592 byte, 1184 inodes)
init: kernel security level changed from 0 to 1

You are using a serial console, we do not know your terminal emulation.
Please select one, typical values are:

vt100
ansi
xterm

Terminal type (just hit ENTER for ‘vt220’): xterm

NetBSD/sparc64 6.1.5

This menu-driven tool is designed to help you install NetBSD to a hard disk,
or upgrade an existing NetBSD system, with a minimum of work.
In the following menus type the reference letter (a, b, c, …) to select an
item, or type CTRL+N/CTRL+P to select the next/previous item.
The arrow keys and Page-up/Page-down may also work.
Activate the current selection from the menu by typing the enter key.

┌─────────────────────────────────────────────┐
│>a: Installation messages in English │
│ b: Installation auf Deutsch │
│ c: Mensajes de instalacion en castellano │
│ d: Messages d’installation en français │
│ e: Komunikaty instalacyjne w jezyku polskim │
└─────────────────────────────────────────────┘

Wow, how’s that for cool?

A few notes though, if you use a VMDK disk access is dreadfully slow during the install, raw disk images are MUCH MUCH faster (36Kb/sec vs 3+MB/sec).  The kernel cannot figure out the root disk, so you have to tell it on every boot.  When installing it’s cd0c, when booting off the harddisk it’s wd0a. The e1000 adapter causes the kernel to go crazy, and on bootup the system indexes the man pages, which seems to kill the machine.

makemandb

makemandb indexing like crazy

As you can see this is what happens when you hit the disk too hard..

# dd if=/dev/wd0c of=/dev/null bs=1m
^Ccmdide0:0:0: lost interrupt
type: ata tc_bcount: 2048 tc_skip: 0
463+0 records in
463+0 records out
485490688 bytes transferred in 59.701 secs (8132036 bytes/sec)

and if you don’t incur the rage of the disk controller it’s the same speed:

# dd if=/dev/wd0c of=/dev/null bs=1m count=10
10+0 records in
10+0 records out
10485760 bytes transferred in 1.217 secs (8616072 bytes/sec)

But yeah, I can’t complain!

 

Qemu 2.2.0 for OS X 10.10

So yeah it’s been a while since I pushed out a build for OS X, and well I did a fresh install of OS X 10.10 on my MacBook, and this took a while to compile.  And I ran into my favorite OSS dependancy of glib2 which needs pkg-config to build, and pkg-config needs glib2.

I hate this so much...

I hate this so much…

So for those who want it, here is the build that I’ve only tested on 10.10 .. And I only compiled the i386 emulator.  And here is the larger archive with the rest of the emulators.

I’ve included the dylib’s that I needed in /usr/local/lib … And of course you’ll need LibSDL 1.2‘s framework installed.

It runs Coherent!

It runs Coherent!

And yes, I built it to run Coherent, and it runs pretty well.  The boot time fsck didn’t take 5 minutes to complete.

Coherent vs IDE controllers…

Since there has been some buzz on Coherent, I thought I’d see what the state of emulation is in 2015.. .While Qemu 1.2.0 can install Coherent, the hard disk access is incredibly slow.  Luckily for me, I was basically stuck on hold, and bouncing between tasks so the four hour long install didn’t seem so bad.

So for anyone who wants a pre-installed disk image, here you go!  It’s installed on a 500MB disk image, with the geometry CHS=1015/16/63

Unimplemented transfer 0x31 on Bochs.

Unimplemented transfer 0x31 on Bochs.

The first thing I tried to do was to get it to run on Bochs.  This was somewhat as easy as mounting the disk, and setting the hard disk to bootable in the Bochs setup program. Coherent boots up, and then starts to print errors that it’s unable to write to the disk.

write cmd 0x31 (WRITE SECTORS NO RETRY) not supported

So, the CPU seems to work, but without the ability to write to the disk, it isn’t too useful.

Next I tried PCem, and I got this error from both the 386DX and 486DX:

PCem in

PCem Spurious GP Fault on iret to Ring 3.

Which is a shame, as I thought that PCem would probably handle any sensitive timing issues the best.

Next up, I tried VMware Player.

Failure on VMware Player

Failure on VMware Player

Which had issues with the hard disk.

Next I thought MESS may actually be able to run it.

First step is the convert the flat disk image into a CHD:

D:\mess>chdman createhd -i \qemu\bochs-flat.img -o coherent.chd -chs 1015,16,63 -c none -f
chdman – MAME Compressed Hunks of Data (CHD) manager 0.153 (Apr 7 2014)
Output CHD: coherent.chd
Input file: \qemu\bochs-flat.img
Compression: none
Cylinders: 1015
Heads: 16
Sectors: 63
Bytes/sector: 512
Sectors/hunk: 8
Logical size: 523,837,440
Compression complete … final ratio = 14.6%

And then to run MESS:

mess64 -window at386 -ramsize 8388608 -harddisk1 coherent.chd

Stalling on MESS

Stalling on MESS

It boots, it seemingly doesn’t crash, but it just hangs there.  I assume it’s also plagued by the insanely slow hard disk access that Qemu struggles with.

And finally I thought I’d give Virtual PC 2004 a shot. I converted my raw disk image to a VHD, and fired it up (nested on Windows XP on VMware Player)

qemu-img.exe convert -f raw -O vpc bochs-flat.img coherent.vhd

And shockingly it slams the CPU and acts like it wanted to boot:

Coherent on Virtual PC

Coherent on Virtual PC

I don’t know if this counts for close.  But this is the current state of emulation.

So it’s great that there is source, although it looks like it’s several internal branches of the PC branch (the source only mentions the PDP11, 68000 and Z8001 ports in libc), but there is a bunch of RCS files.  Its more so a matter of going through all of that to parse out project tree’s and see which ones are newer.  Not all parts have RCS files though, the userland is just a straight source dump.

I’d suspect the only viable way to get this running on modern emulation is to really get it either cross compiling, which means building it’s toolchain, and trying to build a new kernel or finding old enough hardware to build on.  I can’t even begin to imagine trying to use a compiler on a disk that functions at 1kb/sec.

*** UPDATE ***

Well I thought I’d go ahead and try a newer version of Qemu for Windows, namely the 20141210 build, and here we go!

Success! Qemu 2.2.50 running Coherent

Success! Qemu 2.2.50 running Coherent

It takes about a minute to boot up, as it’ll run an aggressive (and silent) fsck.  I can only assume it scans the entire volume as I don’t see why it takes so long.  I also didn’t try to do anything special, just a guess on how to ‘tweak’ Qemu to be more friendly…

qemu-system-i386w.exe -cpu 486 -m 8 -hda bochs-flat.img

Although I don’t know if you need to reduce the CPU or limit the RAM (remember Coherent can’t swap!).

I need to test some more, as I managed to corrupt the disk editing some files, but I think you need the fsck @ boottime, and need to cleanly shutdown with a:

shutdown halt 0

Maybe now is a good time to read that manual.

Fun with Kerbal Space Program

So right before Christmas there was a new drop of KSP (Kerbal Space Program), and I’ve been playing it on/off again.  One thing that I’ve been amazed about is all of the pluggins.  One that caught my eye was KSPSerialIO, and it’s project page.  It’s mainly focused on using an Arduino based display/control system connected via a serial port.

So I thought I’d make some minor modification so I could talk to it locally.

KSPSerialIO data collection

KSPSerialIO data collection

KSP is a Unity3D program, which is very modular, and using C# you can write pluggin DLLs.  However Unity doesn’t use the native .NET framework on Windows, instead it uses Mono.  So things like named pipes, and message queues are out of the question.  However I was able to find netmq, a zeromq port in C#. Using a special branch (until it’s been mainlined) It will even work with Unity 3D/Mono as they are dependent on being .NET 3.5 compatible (not 2.0 or 4.0!)

So what do I have now?  A server program that the KSP pluggin can communicate with.  Right now it’s just telemetry data being sent to a console.  The next step is to send some commands back (blink the lights or something useful), and then see if I can get it tied into some named pipe so that any program that can open a file can control the craft.

Of course this uses floating point, so I’m going to have to see about how to deal with a binary representation of a float in C# to anything else.

A few minor tips.  First is that KSP takes a long time to load, and when you are crashing out, or constantly having to re-load to insert new versions of your DLL, it’s a real pain to be waiting the 2-3 minutes for it to load.  I found this plugin, ActiveTextureManagement, which compresses the textures.  Now it took me a good 20 minutes for my machine to do this, but once it was done it cut load time to around a minute and a half!

Another great thing to have is a RAM disk (well that, fast CPU/GPU, and plenty of RAM), so I used Softperfect’s RAM Disk. Steam doesn’t mind you copying a game off of disk, and running it off another disk.  I found this combination of a RAM disk + compressing the textures got me to loading in under a minute!

Although once KSP is loaded it’s in memory so most people probably won’t benefit much from it, but if you are constantly loading/unloading it greatly helps! (it feels a bit like experimenting with config.sys/autoexec.bat of the old days, and the difference even smartdrv could make).

CS1685:

So I’ve been playing with some C# in trying to mess with other stuff in some insane fun.  Anyways I was getting this weird compiler error trying to build my c# components:

warning CS1685: The predefined type ‘System.Func’ is defined in multiple
assemblies in the global alias; using definition from
‘c:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll’

Well that is strange.  Everything still worked, but I was getting screens full of this crap, so I was missing anything that didn’t build correctly from the CLI, so I had to find the source.  I found this nice tip, by adding the following into the source, and compile again.

System.Runtime.CompilerServices.ExtensionAttribute x = null;

And running the compiler (yet again), I got this:

c.cs(17,33): error CS0433: The type
‘System.Runtime.CompilerServices.ExtensionAttribute’ exists in both
‘d:\proj\zmq.net\b\System.Core.dll’ and
‘c:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll’
System.Core.dll: (Location of symbol related to previous error)
c:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll: (Location of symbol
related to previous error)

What is this? There is a System.Core.dll in my work area?

11/05/2010  09:53 AM           667,648 System.Core.dll

Sure enough, there it is.  I don’t know why it’s there, I don’t remember putting it there.  Even though I wasn’t directly referencing it, for some reason it was getting pulled in.

D:\proj\zmq.net\b>c:\Windows\Microsoft.NET\Framework\v4.0.30319\csc c.cs /r:netm
q.dll
Microsoft (R) Visual C# Compiler version 4.0.30319.18408
for Microsoft (R) .NET Framework 4.5
Copyright (C) Microsoft Corporation. All rights reserved.

c.cs(17,52): warning CS0219: The variable ‘x’ is assigned but its value is never
used

Now I can delete the added line, and I’ll get a silent compile.

Yay.