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
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:
Which is a shame, as I thought that PCem would probably handle any sensitive timing issues the best.
Next up, I tried 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
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:
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!
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.
Why not try PCjs as well, just for completeness’ sake 😉
This is a sad outcome. I vaguely remember being able to install Coherent on MESS, but I remember neither which version of coherent it was, nor which version of MESS (or if I’m confusing this now with one of the many other obscure UNIX variants out there)
All is not lost!
I just found out that Qemu 2.2.50 is able to run Coherent!
Had to hack the IDE code a bit because interrupts were arriving too fast.
Another old OS to try is CTOS. The floppy images are at http://bitsavers.trailing-edge.com/bits/Convergent/ngen/3.5_ima/ and start with the 1-B25-SGB_CTOS_Standard_Software_SuperGen_Boot_Disk_R12.3.120.IMA disk.
Nice! I’m hoping I can inject the source stuff into the disk image, and try to compile some stuff tomorrow..
As for the IDE, even at this point I’d be happy with a polled driver, I guess I should look at the code, see if there is anything obvious, or how much is it v7 like.. And no doubt the filesystem is probably going to be single layered, no networking, no virtual memory (does that one matter anymore), and I’ve found booting with 12MB of ram leads to all kinds of disk issues, while 8 and 16 seem better.. But would there be any point in adding stuff like BSD’s network stack, and expanding memory capacity?
The interesting space for this stuff is embedded with it’s insanely small footprint.
As much as I almost want 80286 based stuff, I have a feeling it’s small/tiny memory models only, nothing in the order of huge.. And for that matter if the 386 can’t swap it’s probably not using the good old 4k pages/4gig address space…?
Lots of unknowns with this one.
Paging is enabled and all the segments have 0 base and 4G limits so it shouldn’t have any address space limitations.
now that i think about it, did coherent support any SCSI controllers?
Yeah there was something in the install, but I wasn’t paying attention… Adaptec for sure, and I’d bet 1542.
There is apparently an IDE driver here, but I don’t see any download link…
I assume it was based off of this leaked source.
This seems naive, but if you recompile (hack) bochs such that command 0x31 (write sector no retry) does the same thing as 0x30 (write sector with retry), I wonder if it would work…
it could be worth a shot…
Yes, it seems to work when applied to Bochs 2.6.8 (I can boot the hard disk image from the top of the article). From a quick look at some ATA specs, it looks like this is a valid thing to do. Maybe one day I’ll submit a patch to Bochs for this.
If only I knew how to slow Bochs down so I could play /usr/game/chase (pass -c flag for color) which seems to be a Pac Man clone, I guess other emulators will have this feature.
For the record, qemu 2.4.0.1 also works, not that I did too much under it except boot the hard disk image.
Would be really nice if you could report the bug that you found running Coherent in PCEm to PCEm team, so they can fix it :-).
I was busy fighting glib2 on OS X… I’ve posted it, so we’ll see.
I ran into the PCEm panic so I went away and installed on a 386DX40 with IDE controller and a 256MB compact flash card. I’ve also got a 1542 but I can’t find a drive in the attic to fit it…
No problems with the install just unfamiliarity with unices of that vintage.
Qemu is probably the easiest to use, as you can then ‘mount’ a directory as a fat disk, and copy in the source that way… I haven’t seen how to build the kernel yet though…
the latest svn rv of pcem can run this piece of software 🙂 (as of rv202).
Indeed it does run! And it’s much more stabler than Qemu.