Compiling KLH10

From Computer History Wiki
Revision as of 06:10, 26 February 2012 by Lexthehex (talk | contribs) (Compiling KLH10 on Gentoo x86_64)
Jump to: navigation, search

Introduction

This is a brief guide to compiling Ken Harrenstein's KLH10 PDP-10 emulator. It was written on an AMD64 Gentoo machine with 2GB RAM and gcc 4.5.3-r1. The author currently has a bad cold, so please excuse any mistakes/foolishness caused by dizziness.

Useful links: Viktor Björn's tutorial 'Some notes on setting up an ITS system'

This tutorial assumes that you are running a Linux system with a modern version of gcc. Some of these instructions will not apply to your system, or may differ. I am using a current Gentoo system, as of February 2012. The system has been configured as a 'multilib' configuration, with a mixture of 32- and 64-bit. By default, gcc compiles for 64-bit. (verify this)

Step 1: obtaining the KLH-10 source. There are two places that you can get the source, but I recommend using the Panda source, which you can download at [1]. As mentioned in Mr. Viktor's tutorial, if you are using gcc 4.x or later (I am!) you need to apply this patch. I needed to apply some additional patches of my own - see later.

Step 2: unpack the source - easy: 'tar -xzf panda-dist.tar.gz'

Step 3: compile the source. Here's where I got lost. The instructions (panda-dist/klh10-2.0h/doc/install.txt) tell you to:

  1. Unpack the main distribution, and the auxiliary distribution (I didn't, as I don't need it yet).
  2. Configure for the native platform. Again, I didn't do anything here. Perhaps I should have.
  3. 'Build a KN10 from sources'. Here, I was stumped. Which sources? Where? How?

The example shows:

       $ cd <distrib>/bld/<platform>
       $ make base-kl          ;;; or base-ks or base-ks-its

On my system, '<distrib>' is 'klh10-2.0h' and '<platform>' is 'lnx86' (Linux, x86) - so, I did:

       $ cd klh10-2.0h/bld/lnx86

.. but was dismayed to find a solitary file in this directory:

       -rwxr-xr-x 1 lex root 70 Feb 21  2005 00build

This contains a 'make' command:

       #!/bin/sh
       make base-kl CONFFLAGS_AUX=-DKLH10_I_CIRC=1 LDFLAGS=-static

Predictably, executing it causes make to output an error, because there is no Makefile.

       make: *** No rule to make target `base-kl'.  Stop.

Lexthehex 21:10, 25 February 2012 (PST)