        Prime Emulator Run Directory (pub)

Prime Computer, Inc. sold computers from the early 70's to the early
90's, competing mainly with DEC, Wang, Perkin-Elmer, and HP.  This is
a Linux-based software emulator for Prime 50-Series hardware, running
Prime software unchanged.

The emulator tar file contains ready-to-run disk images for the last 7
major versions of Prime software.  Prime's "RingNet" was a token-ring
LAN allowing Prime computers to be networked in a "self-healing" ring.
These 7 releases are packaged together and pre-configured to be
networked in a virtual Prime ring using TCP/IP.  Releases can also run
standalone.


HISTORICAL CONTEXT
------------------

In its early days, Prime sold the Prime 200 and 300.  The 200 was a
realtime computer system.  The 300 was a multiuser system supporting
R-mode, with programs having a 64K 16-bit word address space (128K
bytes).  Primos III and the P300 supported paging, which avoids
programmers having to use overlays, and supported CPU modes 16S, 32S,
32R, and 64R.

Prime was extremely well-known for its forward-compatibility.  Even
it's latest, largest systems could run programs compiled for systems
from 20 years earlier.  So can the emulator.  Prime's motto was
"Software First", meaning that they designed their hardware around
their software.  For example, Prime CPUs have a computed goto
instruction to implement this Fortran statement.  Their Fortran
compiler was so efficient, they used it for the operating system with
supporting assembler.  They also released the source for all of their
software, though this tapered off in later years.

Early versions of Primos, before 1977, had filesystem subroutines
names like CREATE to create a directory, SEARCH to open files, and
PRWFIL (Position, Read, Write File) for file I/O.  A later release
added a dollar sign, becaming CREAT$, SEARC$, and PRWFL$, with the old
subroutines still available for compatibility.  In these early
filesystems, filenames were limited to 6 characters so source files
were often given 4-character names, with compiler output named B_PROG,
compiler listings named L_PROG, and runfiles named *PROG.

In Fall 1977 Prime released Primos IV rev 13 for the Prime 400.  The
P400 was the first system to support V-mode (64V), a new addressing
mode that enabled the use of multiple 128K-byte segments, allowing
flexible virtual memory handling.  The hardware had 4 ranges of
segments: 0-'1777 (octal) for the operating system, '2000-'3777 for
shared libraries, '4000-'5777 for user programs, and '6000-'7777 for
per-user data structures managed by Primos.  All users share segments
0-'3777 but have their own segments '4000-'7777.  A Prime 400 system
with 2 80MB CDC hard drives, 9-track and 7-track tape drives, a
printer, and 256K of memory cost about $400K in 1977.

With the release of rev 13, another dollar sign was added to
filesystem subroutine names to support 32-character filenames, giving
us CREA$$, SRCH$$, and PRWF$$.  These had a very long life in Prime
software, widely used until the company folded.

The emulator project does not have any surviving software from Prime's
early days before 1982 (rev 18).  The 7 versions of Prime software
included with the emulator span major releases 18-24.  Based on file
timestamps and dates in documentation files, this spans the years from
1982 to 1994 - an average of about 2 years between major releases.

By the time the company folded in the early 90's, Prime's software had
grown tremendously.  This is easy to see by comparing the kinds of
software described above with the software installed on the emulators.


EMULATOR FILES
--------------

Directories 18-24 contain disk images for the corresponding version
of Primos, Prime's operating system.

Files em32 and em64 are the emulator program itself, built for 32- and
64-bit Linux respectively.  Copy or symlink the appropriate one to
'em', or build one from source.

File runem is a shell script to start the emulators from inittab using
the "screen" program.  This allows you to use:
  screen -x em19
to attach to the rev 19 system console.  To exit screen, use ctrl-a
ctrl-d.  You may need different options to run screen from outside
inittab.

You may wish to add two lines to ~/.screenrc to allow screen sharing:

	multiuser on
	acladd <youruserid>

File ring.cfg is a ring configuration file showing node numbers, IP
addresses, and passwords for all systems in the ring.


STARTING THE EMULATOR
---------------------

Each version is configured with an erase character of backspace and
a kill (line erase) character of ctrl-u.

To start the emulator, cd to a rev directory and use:

$ ./em -tport 8001               NOTE: add -cpuid 5 for rev 18

The emulator will boot and your terminal session becomes the system
console.  The system console runs as Prime userid SYSTEM.  The boot
process places a priority ACL on the system partition giving userid
SYSTEM all access, like running as root on Unix.

-tport 8001 enables incoming telnet sessions as terminals (see below).
This isn't required, but the Primos startup will give errors if no
terminals are configured.

One user login id "guest" is setup on each version (on rev 18 it is
called GUEST18).  Every login id also has an initial attach point aka
home directory named GUESTrr, where rr is the rev number, so GUEST20
is the home directory for the rev 20 GUEST login id.  The reason for
this is so that if all emulators are started in a virtual ring,
Prime's remote disk software can attach to any guest directory
directly without having to use disk numbers, and it avoids new user
confusion.


STOPPING THE EMULATOR
---------------------

The normal way to shutdown Primos (and the emulator) from the system
console is:

OK, sh all
Really? yes

Another option is to use ctrl \.  This will cause a sensor check
within 1 minute and also eventually shutdown Primos gracefully.  If
the ctrl \ is repeated, the emulator halts immediately.  This is like
hitting the power switch, so Primos does not get a chance to flush
modified disk buffers for example.


TERMINALS
---------

The emulator supports virtual terminals using telnet.  To start the
emulator and enable terminals, use:

  $ ./em -tport 8001

This will enable 16 AMLC (Asynchronous Multi-Line Controller) lines.
The emulator supports up to 127 terminal sessions but in the tar file
Primos is only configured for 7 terminals.  To connect to the emulator
as a terminal, use telnet from another Unix terminal session, leaving
the Prime console running.  For example:

-----
# telnet localhost 8001
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

Welcome to the Prime Computer 50-series emulator, running Primos rev 19.2!

  Login guest <enter>, then use password pr1me
  The line erase character is ctrl-u
  After logging in, use the Prime HELP command for assistance.
  Prime manuals: http://yagi.h-net.msu.edu/prime_manuals/prirun_scans

Enjoy your time travels!

Login please.
login guest
Password? pr1me  (this won't display)

GUEST (user 2) logged in Saturday, 14 Mar 20 21:29:36.
Welcome to PRIMOS version 19.2.
Last login Saturday, 14 Mar 20 19:54:28.

OK, lo

GUEST (user 2) logged out Saturday, 14 Mar 20 21:29:56.
Time used: 00h 00m connect, 00m 00s CPU, 00m 00s I/O.

Prime session disconnected
Connection closed by foreign host.
-----

The rev 23 version of Primos stays connected after logout.  To
disconnect, enter the command DROPDTR, or use the regular telnet
escape to end your telnet session.


NETWORKING EMULATORS
--------------------

The tar file has a 7-node Prime ring pre-configured in ring.cfg, one
node for each release.  To start an emulator with networking enabled,
use:

  $ ./em -tport 8001 -nport 8101

If multiple emulators are started, they each need unique -tport and
-nport ports as specified in ring.cfg.  They are also confgured this
way in the pre-configured Primos disk images (CONFIG_NET).  When
booted, they will automatically connect to the ring and be able to
access other nodes' disk drives via Prime's Remote File Access
software.  RFA enables remote subroutine calls across the network and
Prime used this mechanism to share filesystems between nodes, but also
in more sophisticated ways.  For example, their indexed sequential
file softwre, MIDASPLUS, used remote subroutine calls to add, delete,
and update records in MIDAS files on remote nodes.


STARTING ON BOOT
----------------

To start the emulators from inittab, use something like:

em19:2345:respawn:/home/jim/prime/pub/runem 19 8001 8101
em20:2345:respawn:/home/jim/prime/pub/runem 20 8002 8102
em21:2345:respawn:/home/jim/prime/pub/runem 21 8003 8103
em22:2345:respawn:/home/jim/prime/pub/runem 22 8004 8104
em23:2345:respawn:/home/jim/prime/pub/runem 23 8005 8105
em24:2345:respawn:/home/jim/prime/pub/runem 24 8006 8106
em18:2345:respawn:/home/jim/prime/pub/runem 18 8007 8107

For more info and the latest emulator version, see:

https://github.com/prirun

Enjoy your Prime time travels!
Jim
