Commit | Line | Data |
---|---|---|
3c4fa418 PH |
1 | #!/bin/bash |
2 | ||
3 | # AUTO BOOT THE PDP8 VIA RIM LOADER | |
4 | ||
eadb1a5d PH |
5 | PDP8=$(realpath $(dirname "$0")/..) |
6 | AUTO_RIM=~/pdp8/sw/autobin/autobin.rim | |
7 | ||
3c4fa418 PH |
8 | PORT=`cat ~/.minirc.dfl | grep "port" | awk '{print $3}'` |
9 | if [ ! "$PORT" ]; then PORT="/dev/ttyS0"; fi | |
10 | ||
11 | SPEED=`cat ~/.minirc.dfl | grep "baudrate" | awk '{print $3}'` | |
3c4fa418 PH |
12 | echo "PORT : $PORT" |
13 | echo "SPEED: $SPEED" | |
14 | ||
eadb1a5d PH |
15 | |
16 | echo "PDP8: $PDP8" | |
17 | ||
3c4fa418 PH |
18 | error(){ |
19 | echo "ERROR: $1" >&2 | |
20 | bad | |
21 | exit $1 | |
22 | } | |
23 | ||
24 | stty -F $PORT $SPEED raw -crtscts -echo cs8 cstopb clocal || error 1 | |
25 | ||
26 | cat $AUTO_RIM > $PORT || error 2 | |
27 | ||
28 | sleep 0.1 | |
29 | ||
30 | if [ -f "$1" ]; then | |
31 | cat $1 > $PORT || error 3 | |
32 | fi |