ack icon indicating copy to clipboard operation
ack copied to clipboard

pdpv7 issues: hilo_bas crashes, paranoia_c is too big, startrek_c can't move Enterprise

Open kernigh opened this issue 7 years ago • 0 comments

I run the *.pdpv7 examples in simh-pdp11 running Unix V7. I fixed some problems in pull request #100; but this issue lists problems that I did not fix.

# ./hilo_bas.pdpv7
Bus error - core dumped

hilo_bas crashes with SIGBUS, so it fails to give the usual error message about the missing data file.

# ./paranoia_c.pdp
./paranoia_c.pdp: too big
# size *.p*
hilo_b.pdpv7: 5006+574+132 = 5712b = 013120b
hilo_bas.pdpv7: 26786+4188+3242 = 34216b = 0102650b
hilo_c.pdpv7: 15478+2226+310 = 18014b = 043136b
hilo_mod.pdpv7: 18784+1936+3498 = 24218b = 057232b
hilo_p.pdpv7: 5672+1478+2160 = 9310b = 022136b
mandelbrot_c.p: 1096+138+80 = 1314b = 02442b
paranoia_c.pdp: 20926+37144+242 = 58312b = 0161710b
startrek_c.pdp: 29514+10396+1276 = 41186b = 0120342b

paranoia_c is too big. I suspect (but don't know) that the limit is 49152 or 57344 bytes, being 6 or 7 segments (if the PDP-11 has 8 segments of 8192 bytes each). This would be smaller than the limit in my CP/M emulator.

paranoia works if I compile it with ack -i so it uses separate instruction/data spaces.

# ./startrek_c.pdp
...
Command? nav

Course (0-9): 6

Lt. Sulu roports:
  Incorrect course data, sir!

In startrek_c, Lt. Sulu always refuses my course, so I can't move the Enterprise. The course is a floating-point number, so something might be wrong converting strings to floats. pdpv7 might be our only platform where floats don't use IEEE format.


To reproduce these problems, install simh-pdp11 (I use OpenBSD's pkg_add). Go to http://simh.trailing-edge.com/software.html, fetch "PDP-11 UNIX V7", and unzip it. The plan is to boot from unix_v7_rl.dsk, and to use a second disk named exchange.tar to move files in and out of the emulator.

If the emulator is named simh-pdp11, then it loads simh-pdp11.ini from the current directory. Create a file named simh-pdp11.ini with these 4 lines:

set cpu u18
attach rl0 unix_v7_rl.dsk
attach rl1 exchange.tar
boot rl0

This will change the cpu (set cpu 11/45 also works) and create exchange.tar if it doesn't exist. Be able to scroll up the terminal. Run simh-pdp11. The @ prompt is the first-stage bootloader. Enter boot to run the second-stage bootloader, then rl(0,0)rl2unix to boot the kernel. (If you make a mistake, type ^E to escape to simh, where you can boot rl0 again.)

$ simh-pdp11

PDP-11 simulator V3.9-0
Disabling XQ
@boot
New Boot, known devices are hp ht rk rl rp tm vt 
: rl(0,0)rl2unix
mem = 177856
# 

It boots to a single-user shell. The important keys are ^? to interrupt, # to wipe a character (so pd#wd is pwd), @ to wipe a line, ^D to send EOF, ^E to escape to simh. (If you ^D the single-user shell, you can login root with password root.)

Enter stty cr0 to speed up the terminal. After the first boot, run mkdir /tmp so /tmp exists, and cd /dev then make rl so device nodes like /dev/rrl1 exist. When /tmp exists, manuals like man stty will work.

To move files through exchange.tar, use the old tar format, not the now common ustar format. I use pax -wvx tar -f /path/to/exchange.tar *.pdpv7 in OpenBSD to put the *.pdpv7 examples in the old format. In the emulator, run cd /tmp (or where you want to extract the files) then tar xvf /dev/rrl1 to extract the files. Then either ./hilo_b.* or hilo_b.* runs the hilo_b example.

To halt the system and emulator, first run sync, then type ^E and enter q.

kernigh avatar Jun 16 '18 04:06 kernigh