-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgetmsdos
executable file
·46 lines (34 loc) · 2.07 KB
/
getmsdos
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
#!/bin/sh
# requires msexpand, renamed version of test/expand from libmspack
DISKS_BASE_URL=http://archive.org/download/IBM_PC_Compatibles_TOSEC_2012_04_23/IBM_PC_Compatibles_TOSEC_2012_04_23.zip
DISK1=IBM%20PC%20Compatibles%20%5BTOSEC%5D%2FIBM%20PC%20Compatibles%20-%20Operating%20Systems%20-%20%5BIMA%5D%20%28TOSEC-v2011-01-06_CM%29%2FMicrosoft%20MS-DOS%20v6.22%20%281994%29%28Microsoft%29%28Disk%201%20of%203%29.zip
DISK2=IBM%20PC%20Compatibles%20%5BTOSEC%5D%2FIBM%20PC%20Compatibles%20-%20Operating%20Systems%20-%20%5BIMA%5D%20%28TOSEC-v2011-01-06_CM%29%2FMicrosoft%20MS-DOS%20v6.22%20%281994%29%28Microsoft%29%28Disk%202%20of%203%29.zip
DISK3=IBM%20PC%20Compatibles%20%5BTOSEC%5D%2FIBM%20PC%20Compatibles%20-%20Operating%20Systems%20-%20%5BIMA%5D%20%28TOSEC-v2011-01-06_CM%29%2FMicrosoft%20MS-DOS%20v6.22%20%281994%29%28Microsoft%29%28Disk%203%20of%203%29.zip
TMP_DIR=/tmp/msdos622-$USER
DRIVE_C="$1"
DOSEMU_EXECUTABLE=`which dosemu`
DOSEMU_SYSPREFIX=`dirname ${DOSEMU_EXECUTABLE}`/..
DOSEMU_DRIVEZ_DIR=`realpath ${DOSEMU_SYSPREFIX}`/share/dosemu/drive_z
. ./include/download.sh
. ./include/extract.sh
mkdir -p "${TMP_DIR}"
download_file "${DISKS_BASE_URL}"/"${DISK1}" "${TMP_DIR}"/disk1.zip
download_file "${DISKS_BASE_URL}"/"${DISK2}" "${TMP_DIR}"/disk2.zip
download_file "${DISKS_BASE_URL}"/"${DISK3}" "${TMP_DIR}"/disk3.zip
extract_7z "${TMP_DIR}"/disk1.zip "" "${TMP_DIR}"/ex1
extract_7z "${TMP_DIR}"/disk2.zip "" "${TMP_DIR}"/ex2
extract_7z "${TMP_DIR}"/disk3.zip "" "${TMP_DIR}"/ex3
IMAGE1="ex1/`ls \"${TMP_DIR}\"/ex1/`"
IMAGE2="ex2/`ls \"${TMP_DIR}\"/ex2/`"
IMAGE3="ex3/`ls \"${TMP_DIR}\"/ex3/`"
extract_to_c "$IMAGE1" io.sys
extract_to_c "$IMAGE1" msdos.sys
extract_to_c "$IMAGE1" command.com
#extract_to_c_bin "$IMAGE1" expand.exe
mkdir -p ${DRIVE_C}/bin
extract_7z "${TMP_DIR}"/"$IMAGE1" ega.cp_ "${TMP_DIR}"
msexpand "${TMP_DIR}"/EGA.CP_ ${DRIVE_C}/bin/ega.cpi
extract_7z "${TMP_DIR}"/"$IMAGE1" DISPLAY.SY_ "${TMP_DIR}"
msexpand "${TMP_DIR}"/EGA.CP_ ${DRIVE_C}/bin/display.sys
extract_7z "${TMP_DIR}"/"$IMAGE1" MODE.CO_ "${TMP_DIR}"
msexpand "${TMP_DIR}"/EGA.CP_ ${DRIVE_C}/bin/mode.com