-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun.sh
executable file
·330 lines (212 loc) · 5.19 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
#!/bin/bash
#
#;; BSD 3-Clause License
#;;
#;; Copyright (c) 2022-2023, Felipe Miguel Nery Lunkes
#;; All rights reserved.
#;;
#;; Redistribution and use in source and binary forms, with or without
#;; modification, are permitted provided that the following conditions are met:
#;;
#;; 1. Redistributions of source code must retain the above copyright notice, this
#;; list of conditions and the following disclaimer.
#;;
#;; 2. Redistributions in binary form must reproduce the above copyright notice,
#;; this list of conditions and the following disclaimer in the documentation
#;; and/or other materials provided with the distribution.
#;;
#;; 3. Neither the name of the copyright holder nor the names of its
#;; contributors may be used to endorse or promote products derived from
#;; this software without specific prior written permission.
#;;
#;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
#;; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
#;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
#;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
#;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
#;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
#;; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
#;; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
#;; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
#;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
run_v7x86()
{
cd "v7_x86"
qemu-system-i386 -hda hd0.img
cd ..
clean
exit
}
run_211BSD()
{
cd "2.11BSD"
pdp11 211bsd.simh
cd ..
clean
exit
}
run_v7UNIX()
{
cd "v7"
pdp11 v7.simh
cd ..
clean
exit
}
run_v5UNIX()
{
cd "v5"
pdp11 v5.simh
cd ..
clean
exit
}
run_v1UNIX()
{
cd "v1"
pdp11 v1.simh
cd ..
clean
exit
}
clean()
{
cd v1
rm -rf *.log *.dat
cd ..
cd v5
rm -rf *.log *.dat
cd ..
cd v7
rm -rf *.log *.dat
cd ..
cd "2.11BSD"
rm -rf *.log *.dat
cd ..
echo
echo -e "\e[1;32m[Done]\e[0m"
echo
exit
}
help()
{
clear
echo
echo -e "You can use this script to start simulating older versions of UNIX."
echo -e "For this, you must select a version from the displayed list."
echo -e "To try, run this script ($NAME) again."
echo
exit
}
install_images()
{
clear
echo
echo -e "Please wait while the UNIX disk images are installed locally."
echo -e "This process may take a few minutes, depending on the speed of"
echo -e "your internet connection."
echo
mkdir -p temp
cd temp
mkdir -p v5
mkdir -p v7
mkdir -p "2.11BSD"
mkdir -p "v7_x86"
echo -e "\e[1;32m > Downloading v5 UNIX...\e[0m"
# v5
wget -q https://www.retro11.de/data/oc_w11/oskits/u5ed_rkset.tgz
echo -e "\e[1;32m > Unpacking v5 UNIX...\e[0m"
tar -xvzf u5ed_rkset.tgz -C v5/ >> /dev/null
# v7
echo
echo -e "\e[1;32m > Downloading v7 UNIX...\e[0m"
wget -q https://www.retro11.de/data/oc_w11/oskits/u7ed_rpset.tgz
echo -e "\e[1;32m > Unpacking v7 UNIX...\e[0m"
tar -xvzf u7ed_rpset.tgz -C v7/ >> /dev/null
# 2.11BSD
echo
echo -e "\e[1;32m > Downloading 2.11BSD UNIX...\e[0m"
wget -q https://www.retro11.de/data/oc_w11/oskits/211bsd_rpethset.tgz
echo -e "\e[1;32m > Unpacking 2.11BSD UNIX...\e[0m"
echo
tar -xvzf 211bsd_rpethset.tgz -C "2.11BSD/" >> /dev/null
# v7 UNIX for x86
echo -e "\e[1;32m > Downloading v7 UNIX for x86...\e[0m"
wget -q https://www.nordier.com/v7x86/v7x86-0.8a-all.tar.xz
echo -e "\e[1;32m > Unpacking v7 UNIX for x86...\e[0m"
tar xvf v7x86-0.8a-all.tar.xz -C "v7_x86/" >> /dev/null
cd "v7_x86"
cd v7x86-0.8a-all
cd releases
unzip v7x86-0.8a-vm.zip >> /dev/null
cd v7x86-0.8a-vm
cp hd0.img ../../../hd0.img
cd ..
cd ..
cd ..
cd ..
rm -Rf v7x86-0.8a-all
# Install the images
echo
echo -e "\e[1;32m > Installing v5 UNIX...\e[0m"
cd v5
cp u5ed_rk.dsk ../../v5/v5.dsk
cd ..
echo -e "\e[1;32m > Installing v7 UNIX...\e[0m"
cd v7
cp u7ed_rp.dsk ../../v7/v7.dsk
cd ..
echo -e "\e[1;32m > Installing 2.11BSD UNIX...\e[0m"
cd "2.11BSD"
cp 211bsd_rpeth.dsk "../../2.11BSD/211bsd.dsk"
cd ..
echo -e "\e[1;32m > Installing v7 UNIX for x86...\e[0m"
cd "v7_x86"
cp hd0.img "../../v7_x86/hd0.img"
cd ..
cd ..
rm -Rf temp/
echo
echo -e "\e[1;32m[Done]\e[0m"
echo
exit
}
init()
{
clear
echo
echo -e "You must select, from the list below, which edition/version of"
echo -e "UNIX you want to start. The available options are:"
echo
echo -e "1) v1 UNIX"
echo -e "2) v5 UNIX"
echo -e "3) v7 UNIX"
echo -e "4) 2.11BSD UNIX"
echo -e "5) v7 UNIX for x86"
echo -e "6) Clear temporary files"
echo -e "7) Install the disk images for UNIX"
echo
echo -n "Select a number and press <ENTER>: "
read UNIXVERSION
case $UNIXVERSION in
1) run_v1UNIX; exit;;
2) run_v5UNIX; exit;;
3) run_v7UNIX; exit;;
4) run_211BSD; exit;;
5) run_v7x86; exit;;
6) clean; exit;;
7) install_images; exit;;
*) help; exit;;
esac
}
export NAME=$0
case $1 in
v1UNIX) run_v1UNIX; exit;;
v5UNIX) run_v5UNIX; exit;;
v7UNIX) run_v7UNIX; exit;;
211BSDUNIX) run_211BSD; exit;;
v7UNIXx86) run_v7x86; exit;;
installUNIX) install_images; exit;;
clearTemp) clean; exit;;
*) init; exit;;
esac