Introduction:


PCem is an Open Source low-level emulation for 8086/286/386/486/586 PC's from the 80th and 90th, see the PCem project web site. The primary focus seems to be on providing emulations for Windows systems, but Linux also is supported. There is no official OSX support, but that works about the same as under Linux. I've not done anything with the Windows version, I've installed PCem release v13.1 on Debian 8 Linux as well as on OSX. So just download the source archive, unpack it and read the README for Linux.






For installation on Debian 8:
	apt-get sdl2-dev
	apt-get libwxgtk3.0-dev
	apt-get libopenal-dev
	cd ~/pcem
	./configure
	make

For installation on OSX usage of brew is recommended:
	brew install sdl2
	brew install wxmac
	brew link wxmac
	brew install openal-soft
	cd ~/pcem
	./configure
	make



Configuration:


If one runs PCem the first time the software complains that no ROM's were found, the source archive doesn't include any. So first we need a bunch of ROM's, you'll find them at the Wiki for the fork 86Box.

Please be aware that these BIOS's are copyrighted software from a commercial vendor, we are using THEIR software without formal permission, caveat utilitor!

As the README says, under Linux the software uses ~/.pcem for it's configuration files, while under OSX all files are kept in the extracted ~/pcem directory. For Linux we first need to copy the contents of the battery backed NV-RAM into place:

cp ~/pcem/nvr/* ~/.pcem/nvr

Then we need the various BIOS ROM's in ~/.pcem/roms or ~/pcem/roms. For running COHERENT AMI BIOS's are good, so copy the AMI BIOS files for 286, 386SX, 386DX and 486 into the appropriate rom directory. On UNIX systems the filenames must be all lowercase, the downloaded BIOS files are in several mixed case, correct the filenames while copying.

Besides the machines BIOS's we also need some video BIOS, mda.rom is mandatory, without the BIOS has no character set to display. You also might want ibm_vga.bin and et4000.bin for color consoles and a color X11 server. The video BIOS files reside in the rom directory, not some subdirectory, like the machine BIOS files.


General hints:

While on Windows the emulation seems to integrate well into the GUI, on UNIX systems it works a bit different. To get at the menu that allows changing the floppy disk in some drive, right click on the emulator window with the mouse not captured.

To uncapture the mouse under OSX one needs to enter Ctrl-END, there is no middle mouse button. Also an Apple notebook has no END key, but Fn+Ctrl+Cursor right will do. This is an inconvenient key sequence, it also gets through into the emulation, and COHERENT releases with virtual consoles will switch from the current console to the next one.

I prefer to use the extension .dsk for disk images, while PCem wants files with the extension .img, so rename the files.

Most BIOS's want the DEL key to enter the BIOS setup. An Apple notebook has no DEL key and Fn+backspace isn't working, so you won't be able to get into the BIOS anymore after the initial setup. Fortunately the BIOS will complain and enter setup again, if the NV-RAM contents is invalid. So delete the file in directory nvr to get at the setup again.

The boot order in many BIOS's is C:,A:, after installing a bootable OS on the harddisk, booting from floppy disk is not possible anymore. Change the stupid boot order in the BIOS setting.

The system BIOS's of the 90th require to set the harddisk type, at this time it wasn't all automatic negotiation of the physical drive geometries. Make sure to configure the same disk type in the machine setup and the BIOS, setting the wrong disk type won't work. Make notes about the disk type for the configured machines, so that it can be set correctly after a BIOS reset.

The more advanced keyboard drivers for COHERENT supporting loadable keyboard tables and/or virtual consoles won't work with PCem. These drivers use keyboard scancode set 3 and this is not implemented correctly, the kernel will hang.


Installing COHERENT 3.0:

COHERENT 3.0 is a 16bit OS for Intel 286 CPU's or better. For the filesystem related bits the OS uses 16bit unsigned integers, so a filesystem cannot be larger than 65536 * 512 Bytes, ca. 32MB. To use a harddisk larger than this it needs to be partitioned, else the OS won't boot correct. A 20MB BIOS type 2 disk will be fine for using the system, an installation needs less than 7MB from the disk.

The installation is straightforward, I also created a COHERENT 3.0 installation video, which shows machine and BIOS configuration I used.

Software from 1990 of course has a Y2K problem, so I build a modified installation disk with a fixed date command, that will set the correct date. It is suggested to use this disk for an installation, otherwise the date will be 1970.

It is possible to upgrade the 3.0 installation to 3.1 and then 3.2, the final version of the 286 COHERENT releases. This should be done anyway, 3.0 has a number of bugs like not working 3.5" 1.44MB floppy disk drives, which is fixed with the later releases.


Installing COHERENT 4.0:

Release 4.0 was the first COHERENT release for the 386 CPU, that allowed to run "large" 32bit applications on average PC hardware. Please note that the 4.0.1 distribution disks are a BETA test release, not a production release.

For an installation use the 5.25" disk images, the kernel on the 3.5" disk images isn't working. Also use the Y2K fixed installation disk, else the system date will be 1970.

Do not configure the keyboard driver supporting loadable keyboard maps and virtual consoles, this is not working because the driver uses keyboard scancode set 3.

This BETA release has bugs in the filesystem, a race condition on i-nodes is possible with lots of write I/O. This very likely happens when uncompressing the manual pages, ignore the warning as explained, and repair the filesystem after installation of the OS.

I also created a COHERENT 4.0 installation video showing a working machine setup.

Configure the first floppy disk drive as 5.25" 1.2MB, so that an installation from the 5.25" images is possible. Configure the second drive as 3.5" 1.44MB so that the DDK and update can be installed.

After a successful installation and before progressing further make a copy of /bin/date to /bin/date.401 and /etc/ATclock to /etc/ATclock.401. Updates replace /bin/date and /etc/ATclock, but the old versions still are needed to run 4.0.1 with a correct date.

	cp -d /bin/date /bin/date.401
	chown bin /bin/date.401
	chgrp bin /bin/date.401
	cp -d /etc/ATclock /etc/ATclock.401
	chown bin /etc/ATclock.401
	chgrp bin /etc/ATclock.401

I also moved the home directory for root from / to /home/root, so that I have a nice clean /:

	mkdir /home/root
	mv /.profile /home/root
Then edit /etc/passwd and change / to /home/root for the user root. After that logout and login again.

Next install the DDK:

	/etc/install Drv_200 /dev/fva1 1
	/conf/DK386
	cd /usr/sys
	Build -ip at kb
After this we have a new build r68 kernel /coh.test. Boot this kernel and you'll find that access to the floppy disk drives is not working anymore, the driver reports that the drive door is open. So now we make sure that we are able to boot both kernels with a correct system date.
	cd /
	mv coherent coh.401
	mv coh.test coh.r68
	rm autoboot
	ln coh.r68 autoboot
in /etc/brc and in /etc/rc the system date is set from the hardware clock with a line:
	/bin/date -s `/etc/ATclock` >/dev/null
In both files modify it to this:
	REL=`uname -a | awk '{ print $3 }'`
	if test $REL = "4.0.1"
	then
		/bin/date.401 -s `/etc/ATclock.401` >/dev/null
	else
		/bin/date -s `/etc/ATclock` >/dev/null
	fi
After that boot both kernels and verify that both are running with the correct system date.

Now install the r74 Update, boot coh.401 to have a working floppy drive:

	/etc/install CohUpd /dev/fva1 2
Make sure to use the Y2k fixed update disk, else the system date will be 1970. The update will install a new /coherent kernel and links autoboot to this. When booting the system /etc/ATclock dumps core, /etc/brc was modified by the update and the old 286 binary is called. Fix /etc/brc again, so that the correct date and ATclock binaries are used dependent on the kernel version. And finally rename /coherent to /coh.r74, so that one knows the kernel release.

A disk image with a complete installation also is available here.


Installing COHERENT 4.2:


Video for COHERENT 4.2