-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuildall
executable file
·165 lines (151 loc) · 5.35 KB
/
buildall
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
#!/bin/bash
# Not used: Target machine, used to select the right software for the SD card.
# TARGET=MZ-700
# TARGET=MZ-80A
TARGET=MZ-2000
ZPU_SHARPMZ_BUILD=0
#ZPU_SHARPMZ_APPADDR=0x100000
#ZPU_SHARPMZ_APPSIZE=0x70000
#ZPU_SHARPMZ_HEAPSIZE=0x8000
#ZPU_SHARPMZ_STACKSIZE=0x3D80
ZPU_SHARPMZ_APPADDR=0x100000
ZPU_SHARPMZ_APPSIZE=0x70000
ZPU_SHARPMZ_HEAPSIZE=0x8000
ZPU_SHARPMZ_STACKSIZE=0x3D80
ZPU_E115_BUILD=0
ZPU_E115_APPADDR=0x10000
ZPU_E115_APPSIZE=0x8000
ZPU_E115_HEAPSIZE=0x4000
ZPU_E115_STACKSIZE=0x3D80
echo "Build target: ${TARGET}"
# NB: When setting this variable, see lower section creating the SD card image which uses a hard coded value and will need updating.
ROOT_DIR=/dvlp/Projects/dev/github/
# NB: This clean out is intentionally hard coded as -fr is dangerous, if a variable failed to be set if could see your source base wiped out.
rm -fr /dvlp/Projects/dev/github/zSoft/SD/K64F/*
(
# Ensure the zOS target directories exist.
cd ${ROOT_DIR}/zSoft
mkdir -p SD/SharpMZ
mkdir -p SD/Dev
mkdir -p SD/K64F/ZOS
if [ "${ZPU_SHARPMZ_BUILD}x" != "x" -a ${ZPU_SHARPMZ_BUILD} = 1 ]; then
echo "Building ZPU for Sharp MZ"
./build.sh -C EVO -O zos -o 0 -M 0x1FD80 -B 0x0000 -S ${ZPU_SHARPMZ_STACKSIZE} -N ${ZPU_SHARPMZ_HEAPSIZE} -A ${ZPU_SHARPMZ_APPADDR} -a ${ZPU_SHARPMZ_APPSIZE} -n 0x0000 -s 0x0000 -d -Z
if [ $? != 0 ]; then
echo "Error building Sharp MZ Distribution..."
exit 1
fi
# Copy the BRAM ROM templates to the build area for the FPGA.
cp rtl/TZSW_* ../tranZPUter/FPGA/SW700/v1.3/devices/sysbus/BRAM/
# Copy the newly built files into the staging area ready for copying to an SD card.
cp -r build/SD/* SD/SharpMZ/
# The K64F needs a copy of the zOS ROM for the ZPU so that it can load it into the FPGA.
cp build/SD/ZOS/* SD/K64F/ZOS/
fi
if [ "${ZPU_E115_BUILD}x" != "x" -a ${ZPU_E115_BUILD} = 1 ]; then
echo "Building ZPU for Dev board"
./build.sh -C EVO -O zos -o 0 -M 0x1FD80 -B 0x0000 -S ${ZPU_E115_STACKSIZE} -N ${ZPU_E115_HEAPSIZE} -A ${ZPU_E115_APPADDR} -a ${ZPU_E115_APPSIZE} -n 0x0000 -s 0x0000 -d
if [ $? != 0 ]; then
echo "Error building Dev board Distribution..."
exit 1
fi
cp rtl/zOS_* rtl/IOCP* rtl/ZPUTA* ../zpu/devices/sysbus/BRAM/
cp -r build/SD/* SD/Dev/
fi
if [ "${TARGET}x" != "x" -a "${TARGET}" = "MZ-80A" ]; then
echo "Building for K64F on MZ-80A"
./build.sh -C K64F -O zos -N 0x10000 -d -T
if [ $? != 0 ]; then
echo "Error building K64F Distribution..."
exit 1
fi
elif [ "${TARGET}x" != "x" -a "${TARGET}" = "MZ-2000" ]; then
echo "Building for K64F on MZ-2000"
./build.sh -C K64F -O zos -N 0x10000 -d -T
if [ $? != 0 ]; then
echo "Error building K64F Distribution..."
exit 1
fi
else
echo "Building for K64F"
./build.sh -C K64F -O zos -N 0x18000 -d -T
if [ $? != 0 ]; then
echo "Error building K64F Distribution..."
exit 1
fi
fi
cp -r build/SD/* SD/K64F/
# Ensure the TZFS target directories exist
k64fsddir=${ROOT_DIR}/zSoft/SD/K64F
tzfsdir=${ROOT_DIR}/tranZPUter/software
#mkdir -p $k64fsddir/TZFS/
#mkdir -p $k64fsddir/MZF/
#mkdir -p $k64fsddir/CPM/
#mkdir -p $k64fsddir/BAS
#mkdir -p $k64fsddir/CAS
(
cd $tzfsdir
tools/assemble_tzfs.sh
if [ $? != 0 ]; then
echo "TZFS assembly failed..."
exit 1
fi
tools/assemble_roms.sh
if [ $? != 0 ]; then
echo "ROMS assembly failed..."
exit 1
fi
tools/assemble_cpm.sh
if [ $? != 0 ]; then
echo "CPM assembly failed..."
exit 1
fi
tools/make_cpmdisks.sh
if [ $? != 0 ]; then
echo "CPM disks assembly failed..."
exit 1
fi
)
if [ $? != 0 ]; then
exit 1
fi
# Copy the files to the remote build server.
cd ${ROOT_DIR}/zSoft
rsync -avh * psmart@192.168.15.205:${ROOT_DIR}/zSoft/
if [ $? != 0 ]; then
echo "Error syncing K64F Distribution..."
exit 1
fi
# Simple mechanism to prevent remote build and programming of the K64F.
diff ${ROOT_DIR}/zSoft/zOS/main.bin ${ROOT_DIR}/zSoft/zOS/main.bak
if [ $? -ne 0 ]; then
cd ${ROOT_DIR}/zSoft
echo "GO" > ${ROOT_DIR}/zSoft/.dobuild
rsync -avh .dobuild psmart@192.168.15.205:${ROOT_DIR}/zSoft/
if [ $? != 0 ]; then
echo "Error syncing K64F Distribution..."
exit 1
fi
fi
cp ${ROOT_DIR}/zSoft/zOS/main.bin ${ROOT_DIR}/zSoft/zOS/main.bak
)
if [ $? != 0 ]; then
exit 1
fi
# Use copytosd.sh to transfer files to an SD card. Still need to copy the k64F files manually.
# ---------------
# Copy across all the Z80/TZFS software into the target, keep it in one place for placing onto an SD card!
#cp $tzfsdir/roms/tzfs.rom $k64fsddir/TZFS/
#cp $tzfsdir/roms/monitor_SA1510.rom $k64fsddir/TZFS/SA1510.rom
#cp $tzfsdir/roms/monitor_80c_SA1510.rom $k64fsddir/TZFS/SA1510-8.rom
#cp $tzfsdir/roms/monitor_1Z-013A.rom $k64fsddir/TZFS/1Z-013A.rom
#cp $tzfsdir/roms/monitor_80c_1Z-013A.rom $k64fsddir/TZFS/1Z-013A-8.rom
#cp $tzfsdir/roms/monitor_1Z-013A-KM.rom $k64fsddir/TZFS/1Z-013A-KM.rom
#cp $tzfsdir/roms/monitor_80c_1Z-013A-KM.rom $k64fsddir/TZFS/1Z-013A-KM-8.rom
#cp $tzfsdir/roms/MZ80B_IPL.rom $k64fsddir/TZFS/MZ80B_IPL.rom
#cp $tzfsdir/roms/cpm22.bin $k64fsddir/CPM/
#cp $tzfsdir/CPM/SDC16M/RAW/* $k64fsddir/CPM/
#cp $tzfsdir/MZF/Common/*.MZF $k64fsddir/MZF/
#cp $tzfsdir/MZF/${TARGET}/* $k64fsddir/MZF/
#cp $tzfsdir/BAS/* $k64fsddir/BAS/
#cp $tzfsdir/CAS/* $k64fsddir/CAS/