Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ vpm(4) — UNIX System III

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

vpmc(1C)

vpmstart(1C)

trace(4)

VPM(4)  —  UNIX 3.0

NAME

vpm − The Virtual Protocol Machine

DESCRIPTION

This entry describes a particular kind of special file and gives an introduction to the Virtual Protocol Machine (VPM). 

The VPM is a software construct for implementing link protocols on the KMC11 in a high-level language.  This is accomplished by a compiler that runs on UNIX and that translates a high-level language description of a protocol into an intermediate language that is interpreted by an interpreter running in the KMC11. 

The VPM driver is functionally split into two parts: a top VPM device and a bottom VPM device.  The top device may be modified or replaced to suit particular applications; the bottom device interfaces with the VPM interpreter using the KMC driver.  When using the mknod command to make a directory entry and corresponding i-node for a VPM special file, the minor device number identifies the top, bottom, and physical KMC devices to be used for this special file.  The two most significant bits of the minor device number denote the physical KMC device; the next two bits denote the VPM bottom device; the four least significant bits denote the VPM top device.  For example, if top device 1 is to be used with bottom device 2, which in turn is to be used with KMC device 3, the minor device number would be 0341(octal). 

UNIX user processes transfer data to or from a remote terminal or computer system through VPM using normal open, read, write, and close operations.  Flow control and error recovery are provided by the protocol description residing in the KMC11. 

The VPM software consists of six components:

1.  vpmc(1C): compiler for the protocol description language; it runs on UNIX. 

2.  VPM interpreter: a KMC11 program that controls the overall operation of the KMC11 and interprets the protocol script. 

3.  vpm.c: a UNIX driver that provides the interface to the VPM. 

4.  vpmstart(1C): a UNIX command that copies a load module into the KMC11 and starts it. 

5.  vpmsnap(1C): a UNIX command that prints a time-stamped event trace while the protocol is running. 

6.  vpmtrace(1C): a UNIX command that prints an event trace for debugging purposes while the protocol is running. 

The VPM open for reading-and-writing is exclusive; opens for reading-only or writing-only are not. The VPM open checks that the correct interpreter is running in the KMC11, then sends a RUN command to the interpreter (causing it to start interpreting the protocol script), and supplies a 512-byte receive buffer to the interpreter. 

The VPM read returns either the number of bytes requested or the number remaining in the current receive buffer, whichever is less.  Bytes remaining in a receive buffer are used to satisfy subsequent reads.  The VPM write copies the user data into 512-byte system buffers and passes them to the VPM interpreter in the KMC11 for transmission. 

The VPM close arranges for the return of system buffers and for a general cleanup when the last transmit buffer has been returned by the interpreter. 

The user command vpmtrace(1C) reads the trace driver and prints event records. While this command is executing, the VPM driver will generate a number of event records, allowing the activity of the VPM driver and protocol script to be monitored for debugging purposes.  The system functions vpmopen, vpmread, vpmwrite, and vpmclose generate event records (identified respectively by o, r, w, and c).  Calls to the vpmc(1C) primitive trace(arg1,arg2) cause the VPM interpreter to pass arg1 and arg2 along with the current value of the script location counter to the VPM driver, which generates an event record identified by a T.  Each event record is structured as follows:

struct event {
shorte_seqn;/∗sequence number∗/
chare_type;/∗record identifier∗/
chare_dev;/∗minor device number∗/
shorte_short1;/∗data∗/
shorte_short2;/∗data∗/
}

When the script terminates for any reason, the driver is notified and generates an event record identified by an E.  This record also contains the minor device number, the script location counter, and a termination code defined as follows:

 0 Normal termination; the interpreter received a halt command from the driver. 

 1 Undefined virtual-machine operation code. 

 2 Script program counter out of bounds. 

 3 Interpreter stack overflow or underflow. 

 4 Jump address not even. 

 5 UNIBUS error. 

 6 Transmit buffer has an odd address; the driver tried to give the interpreter too many transmit buffers; or a get or rtnxbuf was executed while no transmit buffer was open, i.e., no getxbuf was executed prior to the get or rtnxbuf.

 7 Receive buffer has an odd address; the driver tried to give the interpreter too many receive buffers; or a put or rtnrbuf was executed while no receive buffer was open, i.e., no getrbuf was executed prior to the get or rtnxbuf.

 8 The script executed an exit.

 9 A crc16 was executed without a preceding crcloc execution. 

10 Interpreter detected loss of modem-ready signal. 

11 Transmit-buffer sequence-number error. 

12 Command error; an invalid command or an improper sequence of commands was received from the driver. 

13 Not used. 

14 Invalid transmit state. 

15 Invalid receive state. 

16 Not used. 

17 Xmtctl or setctl attempted while transmitter was still busy. 

18 Not used. 

19 Same as error code 6. 

20 Same as error code 7. 

21 Script to large. 

22 Used for debugging the interpreter. 

23 The driver’s OK-check has timed out. 

SEE ALSO

vpmc(1C), vpmstart(1C), trace(4). 

May 16, 1980

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026