1
0
mirror of https://github.com/rricharz/Tek4010.git synced 2026-04-15 16:11:18 +00:00

running on same Raspbi as PiDP-11

This commit is contained in:
Rene Richarz
2019-03-27 11:19:52 +01:00
parent c21dd52331
commit 2b783c5d52
5 changed files with 142 additions and 14 deletions

101
README.md
View File

@@ -8,9 +8,22 @@ its ability for fading objects.
It is currently in alpha-test and updated daily.
It can be used to log into a historical Unix system such as 2.11 BSD on the PiDP11.
It can be used to log into a historical Unix system such as 2.11 BSD on the PiDP11
or a real historical system
First, you need to login remotely into your system, for example using
Install the tek4010 emulator from this repo on a Raspberry Pi. The emulator uses "rsh",
because historical Unix systems do not support the secure ssh, and because ssh does not
allow using a virtual emulator such as tek4010. You need therefore to install rsh
on the Raspberry Pi running the tek4010 emulator:
sudo apt-get install rsh-client
**Login in a remote historical Unix system**
This can either be a real historical computer, or a virtual system using simh such
as the PiDP-11.
First, you need to login remotely from your client machine into your historical system, using
rsh -l user_name system
@@ -21,17 +34,87 @@ of the system, for example
If this works properly, you can use the tek4010 emulator. Call it as follows:
tek4010 /usr/bin/rsh -l user_name system
./tek4010 /usr/bin/rsh -l user_name system
At the moment, it only seems to work with rsh.
It the current alpha-testing version, there are very few useful hints if this does not work.
If the terminal window is closed right away, there is a problem with your rsh call or you
forgot to use the absolute path for rsh.
The following keys are not transmitted to the Unix system, but are executed locally
in the terminal emulator:
in the terminal emulator and clear the persistent screen:
home clear persistent screen
page up clear persistent screen
page down clear persistent screen
home
page up
page down
control arrow up
control arrow left
These keys emulate the "page" key of the Tektronix 4010
These keys emulate the "page" key of the Tektronix 4010. You need to use one of these
keys frequently to avoid to get a mess on the screen, as on a real Tektronix 4010.
**Login in PiDP11 running on the same Raspberry Pi**
This is really work in progress, but works amazingly well already. It is running
with a screen and keyboard attached to the Raspberry Pi, or almost equally well using
VNC viewer from a laptop!
Expect a bit of slow down from time to time. In my test version the
PiDP11 software and the tek4010 software are using all 4 cores of the Raspberry Pi 3B+ running
at 70% CPU usage! It's amazing how powerful the Raspberry Pi 3B+ is!
You cannot use the tek4010 emulator running screens, as it is done in the standard setup
of the PiDP using the console, because screens filters the output stream of simh and is
therefore unsuitable for graphics terminals such as the tek4010 emulator. If you don't
want to change the standard setup, use <ctrl>e to stop simh, and then "exit" to quit simh.
Because tek4010 insists on using rsh, you need to install rsh-server and rsh-client on
the Raspberry Pi:
sudo apt-get install rsh-server
sudo apt-get install rsh-client
Now start tek4010 as follows:
./tek4010 /usr/bin/rsh -l pi localhost
This should give you a login prompt into your Raspberry Pi. If not, test the rsh call first.
Once your password has been accepted, be prepared to use the "home" key or any of the other
keys described above frequently to avoid to get a mess on the dump 4010 terminal emulator!
The following will start the PiDP software:
cd /opt/pidp11/bin
./pidp11.sh
Everything should run as expected, and you should be able to use the tek4010 terminal emulator with any of
the historical operating systems. It has not yet been tested on other systems than 2.11 BSD.
Your feedback to rricharz77@gmail.com or the PiDP11 forum is therefore very much appreciated.
One word of caution! If you run the PiDP11 software this way without using screens, you SHOULD
NOT detach or quit the terminal while your historical operating system is running, because
this will kill the PiDP11 simh emulator right away. First run down your historical operating
system and simh properly, before detaching the terminal emulator!
**Reporting problems**
As this software is still under development, there will be problems. I just do not have enough
programs doing graphics to properly test the program.
If everything works properly for you, but your graphics application produces garbage on the
tek4010 emulator, you could send me your data as follows: On a historical Unix system, type
your_graphics_program > captured_data
I don't know how this can be done on other operating systems. You can then mail your
captured_data file together with a description of the problem to rricharz77@gmail.com.
Pack it with zip or something else to make sure that the mailing program does not alter it.
**Compiling the tek4010 project**
If you want to compile the project, you need to install "libgtk-3-dev":
sudo apt-get install libgtk-3-dev
There is a make file in the repo.

2
main.c
View File

@@ -111,6 +111,8 @@ static void on_key_press(GtkWidget *widget, GdkEventKey *event, gpointer user_da
// printf("key pressed, state =%04X, keyval=%04X\r\n", event->state, event->keyval);
if ((event->keyval == 0xFF50) || // "home" key
(event->keyval == 0xFF51) || // "<ctrl>left arrow" key
(event->keyval == 0xFF52) || // "<ctrl>up arrow" key
(event->keyval == 0xFF55) || // "page up" key
(event->keyval == 0xFF56)) // "page down" key
{

BIN
tek4010

Binary file not shown.

View File

@@ -32,9 +32,27 @@ float memv[MEM];
*/
int count = 0;
static int mode;
static int x0,y0,x2,y2;
// mode handles the current state of the emulator:
//
// mode 0 alpha mode
//
// mode 1 expecting first byte of dark mode (move to) address
// mode 2 expecting second byte of dark mode (move to) address
// mode 3 expecting third byte of dark mode (move to) address
// mode 4 expecting fourth byte of dark mode (move to) address
// mode 5 expecting first byte of persistent vector end point address
// mode 6 expecting second byte of persistent vector end point address
// mode 7 expecting third byte of persistent vector end point address
// mode 8 expecting fourth byte of persistent vector end point address
//
// mode 30 expecting escape sequence, escape code received
// mode 31 ; received in ANSI escape sequence, escape sequence continues if next char is digit
//
static int mode;
int leftmargin;
int hDotsPerChar;
@@ -228,6 +246,10 @@ void tek4010_draw(cairo_t *cr, cairo_t *cr2, int width, int height, int first)
showCursor = 0;
ch = -1;
}
if (mode == 31) {
// printf("ANSI escape mode 31, ch=%02x\n",ch);
if ((ch>='0') && (ch<='9')) mode = 30;
}
switch (mode) {
case 1: y0 = 32 * (ch - 32); mode++; break;
@@ -258,7 +280,8 @@ void tek4010_draw(cairo_t *cr, cairo_t *cr2, int width, int height, int first)
y0 = y2;
mode = 5;
break;
case 10: // handle escape modes
case 30: // handle escape sequencies
// printf("Escape mode 30, ch=%02x\n",ch);
switch (ch) {
case 12: cairo_set_source_rgb(cr, 0, 0.0, 0); // clear screen
cairo_paint(cr);
@@ -269,12 +292,31 @@ void tek4010_draw(cairo_t *cr, cairo_t *cr2, int width, int height, int first)
break;
case '[': // a second escape code follows, do not reset mode
break;
// start of ignoring ANSI escape sequencies, could be improved (but the Tek4010 couldn't do this either!)
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9': break;
case ';': mode = 31; break;
case ']': break;
case 'm': mode = 0; break;
// end of ignoring ANSI escape sequencies
default: // printf("Escape code %d\n",ch);
mode = 0;
break;
}
break;
default:// if (ch != -1) printf("ch code %d\n",ch);
default: // if (ch != -1) {
// printf("ch code %2x",ch);
// if ((ch>0x20)&&(ch<=0x7E)) printf("(%c)",ch);
// printf("\n");
// }
switch (ch) {
case 0: break;
case EOF: break;
@@ -301,7 +343,8 @@ void tek4010_draw(cairo_t *cr, cairo_t *cr2, int width, int height, int first)
mode = 0; todo = 0; x0 = leftmargin;
break;
case 27: // escape
mode = 10;
mode = 30;
// printf("Starting escape mode\n");
break;
case 29: // group separator
mode = 1;

View File

@@ -4,5 +4,5 @@
#define WINDOW_NAME "Tektronix 4010" // name of main window
#define ICON_NAME "" // path to icon for window
#define TIME_INTERVAL 25 // time interval for timer function in msec
#define TIME_INTERVAL 50 // time interval for timer function in msec
// 0 means no timer function