-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlib-install-dos-on-qemu.sh
126 lines (109 loc) · 2.4 KB
/
lib-install-dos-on-qemu.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
. lib-bogomips-sleep.sh
. lib-qemu.sh
install-dos-on-qemu() {
local dosdisk1="$1"
local dosdisk2="$2"
local dosdisk3="$3"
local dossuppdisk="$4"
if [ $# -lt 3 ]
then
install-dos-on-qemu-usage
return
fi
if ! [ -f "$1" ]
then
echo "file not found: $1" 1>&2
install-dos-on-qemu-usage
return
fi
if ! [ -f "$2" ]
then
echo "file not found: $2" 1>&2
install-dos-on-qemu-usage
return
fi
if ! [ -f "$3" ]
then
echo "file not found: $3" 1>&2
install-dos-on-qemu-usage
return
fi
if [ "$4" != "" ] && ! [ -f "$4" ]
then
echo "file not found: $4" 1>&2
install-dos-on-qemu-usage
return
fi
echo "inserting dos disk 1 and reboot..."
qemu-send "change floppy0 ${dosdisk1}"
qemu-send "boot_set a"
qemu-send "system_reset"
bogomips-sleep 6
echo "confirming messages saying the disk needs to be partitioned..."
qemu-send-key "ret"
bogomips-sleep 0.1
qemu-send-key "ret"
bogomips-sleep 0.1
qemu-send-key "ret"
echo "rebooting..."
bogomips-sleep 8
echo "choosing language..."
qemu-send-key "up"
qemu-send-key "up"
qemu-send-key "ret"
bogomips-sleep 0.1
for ((i=0; i<13; i++))
do
qemu-send-key "up"
done
qemu-send-key "ret"
bogomips-sleep 0.1
echo "choosing keyboard layout..."
qemu-send-key "up"
qemu-send-key "ret"
bogomips-sleep 0.1
for ((i=0; i<13; i++))
do
qemu-send-key "up"
done
qemu-send-key "ret"
bogomips-sleep 0.1
echo "starting installation..."
qemu-send-key "ret"
bogomips-sleep 0.1
qemu-send-key "ret"
bogomips-sleep 9
echo "inserting and installing disk 2..."
qemu-send "change floppy0 ${dosdisk2}"
qemu-send-key "ret"
bogomips-sleep 11
echo "inserting and installing disk 3..."
qemu-send "change floppy0 ${dosdisk3}"
qemu-send-key "ret"
bogomips-sleep 11
echo "ejecting floppy and reboot..."
qemu-send "eject floppy0"
qemu-send-key "ret"
bogomips-sleep 0.1
qemu-send-key "ret"
bogomips-sleep 6
if [ -f "${dossuppdisk}" ]
then
echo "inserting and copying supplemental disk to be copied..."
qemu-send "change floppy0 ${dossuppdisk}"
qemu-send-line-de "a:"
qemu-send-line-de "setup.bat c:\\dos"
qemu-send-line-de "a"
bogomips-sleep 1
qemu-send-key "f5"
qemu-send-line-de "y"
bogomips-sleep 2
qemu-send-line-de "y"
# wait copy to finish
bogomips-sleep 13
qemu-send-line-de "c:"
fi
}
install-dos-on-qemu-usage() {
echo -e "usage:\n\tinstall-dos-on-qemu <dos disk 1> <dos disk 2> <dos disk 3> [dos supplemental disk]" 1>&2
}