initial commit

This commit is contained in:
Dessa Simpson 2023-10-25 18:25:51 -07:00
commit 99a66f4cfd
15 changed files with 287 additions and 0 deletions

13
docker/Dockerfile Normal file
View file

@ -0,0 +1,13 @@
FROM debian:11-slim AS builder
RUN apt-get -y update && apt-get -y upgrade && apt-get -y install gcc libpcap-dev libvdeplug-dev libpcre3-dev libedit-dev libsdl2-dev libpng-dev libsdl2-ttf-dev build-essential && apt-get clean
ADD simh-3.9-0.tgz /
WORKDIR /simh-3.9-0
RUN make pdp11
FROM debian:11-slim
ENV DISK_FILENAME=rq0.dsk
RUN apt-get -y update && apt-get -y upgrade && apt-get -y install ed libpcap-dev iproute2 iptables gcc vdeplug libpcre3 net-tools telnet
COPY --from=builder /simh-3.9-0/BIN/pdp11 /usr/local/bin/pdp11
COPY boot.ini.template /
COPY startup.sh /
CMD /startup.sh

42
docker/boot.ini.template Normal file
View file

@ -0,0 +1,42 @@
; model a PDP-11/70 with maximum memory, fpu, no CIS
set cpu 11/70 4096K fpp
; disable all extra devices by default, will enable later
detach all
reset all
; use 7b ascii terminal
set tto 7b
; set the boot disk as an MSCP UDA50
set rq enabled
set rq0 rauser=1000
attach rq0 /mnt/<DISK_FILENAME>
show rq0
; set one DZ11 8 line async mux
; accessible via telnet to port 4000
set dz enabled
set dz lines=8
set dz 7b
attach -am dz 4000
show dz
; set one DELUA/DEUNA unibus enet controller
; ==> must setup ethX per your system config
set xu enabled
set xu type=delua
attach xu tap:pdp
show xu
; show our config
show devices
show cpu iospace
; Configure all csr/vector
set cpu autoconfig
; Change DZ vector
set dz vector=310
; boot it
boot rq0
<EXIT>

17
docker/build.sh Executable file
View file

@ -0,0 +1,17 @@
#!/bin/sh
usage () {
echo "usage: $0 tag"
exit 1
}
[ -n "$1" ] && tag="$1" || usage
file="simh-3.9-0.tgz"
url="https://codeload.github.com/simh/simh/tar.gz/refs/tags/v3.9-0"
cd "$(dirname $0)"
[ -f "$file" ] || wget "$url" -O "$file"
docker build -t "$tag" .

25
docker/startup.sh Executable file
View file

@ -0,0 +1,25 @@
#!/bin/sh
set -ex
[ -n "$DISK_FILENAME" ] || DISK_FILENAME="rq0.dsk"
[ -f "/mnt/$DISK_FILENAME" ] || { echo "Unable to find tape /mnt/$DISK_FILENAME"; exit 1; }
[ -w "/mnt/$DISK_FILENAME" ] || { echo "Tape /mnt/$DISK_FILENAME is not writable"; exit 1; }
# Set exit command only if NOEXIT not set
[ -z "$NOEXIT" ] && EXIT_CMD="exit" || EXIT_CMD=""
sed -e "s/<DISK_FILENAME>/${DISK_FILENAME}/" \
-e "s/<EXIT>/${EXIT_CMD}/" /boot.ini.template > /boot.ini
cidr=28
hostip=1.3.3.1
pdpip=1.3.3.7
ip tuntap add pdp mode tap
ip link set pdp up
ip addr add "${hostip}/${cidr}" dev pdp
iptables -t nat -A PREROUTING ! -i pdp -p tcp --dport 4000 -j ACCEPT
iptables -t nat -A PREROUTING ! -i pdp -j DNAT --to-destination 1.3.3.7
iptables -t nat -A POSTROUTING ! -o pdp -j MASQUERADE
pdp11 /boot.ini