core: core:cdr: Support port type.
[mes.git] / guix / mescc-tools-boot.patch
1 From c184e95096881a13f29ebd7fc507fe305d3d8de5 Mon Sep 17 00:00:00 2001
2 From: Jan Nieuwenhuizen <janneke@gnu.org>
3 Date: Thu, 4 Oct 2018 22:03:31 +0200
4 Subject: [PATCH] build.sh: Update for mes 0.18.
5
6 ---
7  build.sh   | 92 +++++++++++++++++++++++++++++++++++++-----------------
8  install.sh |  6 ++--
9  2 files changed, 66 insertions(+), 32 deletions(-)
10
11 diff --git a/build.sh b/build.sh
12 index 335a7bb..19a0029 100755
13 --- a/build.sh
14 +++ b/build.sh
15 @@ -18,7 +18,8 @@
16  # along with mescc-tools.  If not, see <http://www.gnu.org/licenses/>.
17  
18  set -eux
19 -MES_SEED=${MES_SEED-../mescc-tools-seed/libs}
20 +MES_PREFIX=${MES_PREFIX-../mes}
21 +MES_SEED=${MES_SEED-../mes-seed}
22  MESCC_TOOLS_SEED=${MESCC_TOOLS_SEED-../mescc-tools-seed}
23  
24  #########################################
25 @@ -32,15 +33,23 @@ MESCC_TOOLS_SEED=${MESCC_TOOLS_SEED-../mescc-tools-seed}
26  # blood-elf
27  # Create proper debug segment
28  $MESCC_TOOLS_SEED/blood-elf\
29 +    -f $MESCC_TOOLS_SEED/file_print.M1\
30 +    -f $MESCC_TOOLS_SEED/match.M1\
31 +    -f $MESCC_TOOLS_SEED/numerate_number.M1\
32 +    -f $MESCC_TOOLS_SEED/string.M1\
33      -f $MESCC_TOOLS_SEED/blood-elf.M1\
34      -o blood-elf-blood-elf-footer.M1
35  
36  # Build
37  # M1-macro phase
38  $MESCC_TOOLS_SEED/M1 --LittleEndian --Architecture 1\
39 -    -f $MES_SEED/x86.M1\
40 -    -f $MES_SEED/crt1.M1\
41 -    -f $MES_SEED/libc+tcc-mes.M1\
42 +    -f $MES_PREFIX/lib/x86-mes/x86.M1\
43 +    -f $MES_SEED/x86-mes/crt1.S\
44 +    -f $MES_SEED/x86-mes/libc+tcc.S\
45 +    -f $MESCC_TOOLS_SEED/file_print.M1\
46 +    -f $MESCC_TOOLS_SEED/match.M1\
47 +    -f $MESCC_TOOLS_SEED/numerate_number.M1\
48 +    -f $MESCC_TOOLS_SEED/string.M1\
49      -f $MESCC_TOOLS_SEED/blood-elf.M1\
50      -f blood-elf-blood-elf-footer.M1\
51      -o blood-elf.hex2
52 @@ -49,7 +58,7 @@ $MESCC_TOOLS_SEED/hex2\
53      --LittleEndian\
54      --Architecture 1\
55      --BaseAddress 0x1000000\
56 -    -f $MES_SEED/elf32-header.hex2\
57 +    -f $MES_PREFIX/lib/x86-mes/elf32-header.hex2\
58      -f blood-elf.hex2\
59      --exec_enable\
60      -o bin/blood-elf
61 @@ -65,9 +74,13 @@ $MESCC_TOOLS_SEED/hex2\
62  $MESCC_TOOLS_SEED/M1 \
63      --LittleEndian\
64      --Architecture 1\
65 -    -f $MES_SEED/x86.M1\
66 -    -f $MES_SEED/crt1.M1\
67 -    -f $MES_SEED/libc+tcc-mes.M1\
68 +    -f $MES_PREFIX/lib/x86-mes/x86.M1\
69 +    -f $MES_SEED/x86-mes/crt1.S\
70 +    -f $MES_SEED/x86-mes/libc+tcc.S\
71 +    -f $MESCC_TOOLS_SEED/file_print.M1\
72 +    -f $MESCC_TOOLS_SEED/match.M1\
73 +    -f $MESCC_TOOLS_SEED/numerate_number.M1\
74 +    -f $MESCC_TOOLS_SEED/string.M1\
75      -f $MESCC_TOOLS_SEED/M1.M1\
76      -f M1-footer.M1\
77      -o M1.hex2
78 @@ -76,7 +89,7 @@ $MESCC_TOOLS_SEED/hex2 \
79      --LittleEndian\
80      --Architecture 1\
81      --BaseAddress 0x1000000\
82 -    -f $MES_SEED/elf32-header.hex2\
83 +    -f $MES_PREFIX/lib/x86-mes/elf32-header.hex2\
84      -f M1.hex2\
85      --exec_enable\
86      -o bin/M1
87 @@ -92,9 +105,13 @@ $MESCC_TOOLS_SEED/hex2 \
88  ./bin/M1 \
89      --LittleEndian\
90      --Architecture 1\
91 -    -f $MES_SEED/x86.M1\
92 -    -f $MES_SEED/crt1.M1\
93 -    -f $MES_SEED/libc+tcc-mes.M1\
94 +    -f $MES_PREFIX/lib/x86-mes/x86.M1\
95 +    -f $MES_SEED/x86-mes/crt1.S\
96 +    -f $MES_SEED/x86-mes/libc+tcc.S\
97 +    -f $MESCC_TOOLS_SEED/file_print.M1\
98 +    -f $MESCC_TOOLS_SEED/match.M1\
99 +    -f $MESCC_TOOLS_SEED/numerate_number.M1\
100 +    -f $MESCC_TOOLS_SEED/string.M1\
101      -f $MESCC_TOOLS_SEED/hex2.M1\
102      -f hex2-footer.M1\
103      -o hex2.hex2
104 @@ -103,10 +120,10 @@ $MESCC_TOOLS_SEED/hex2 \
105        --LittleEndian\
106        --Architecture 1\
107        --BaseAddress 0x1000000\
108 -      -f $MES_SEED/elf32-header.hex2\
109 +      -f $MES_PREFIX/lib/x86-mes/elf32-header.hex2\
110        -f hex2.hex2\
111        --exec_enable\
112 -      -o bin/hex2
113 +      -o bin/hex2-0
114  
115  #########################
116  # Phase-1 Self-host     #
117 @@ -123,18 +140,22 @@ $MESCC_TOOLS_SEED/hex2 \
118  ./bin/M1 \
119      --LittleEndian\
120      --Architecture 1\
121 -    -f $MES_SEED/x86.M1\
122 -    -f $MES_SEED/crt1.M1\
123 -    -f $MES_SEED/libc+tcc-mes.M1\
124 +    -f $MES_PREFIX/lib/x86-mes/x86.M1\
125 +    -f $MES_SEED/x86-mes/crt1.S\
126 +    -f $MES_SEED/x86-mes/libc+tcc.S\
127 +    -f $MESCC_TOOLS_SEED/file_print.M1\
128 +    -f $MESCC_TOOLS_SEED/match.M1\
129 +    -f $MESCC_TOOLS_SEED/numerate_number.M1\
130 +    -f $MESCC_TOOLS_SEED/string.M1\
131      -f $MESCC_TOOLS_SEED/blood-elf.M1\
132      -f blood-elf-blood-elf-footer.M1\
133      -o blood-elf.hex2
134  # Hex2-linker phase
135 -./bin/hex2 \
136 +./bin/hex2-0 \
137      --LittleEndian\
138      --Architecture 1\
139      --BaseAddress 0x1000000\
140 -    -f $MES_SEED/elf32-header.hex2\
141 +    -f $MES_PREFIX/lib/x86-mes/elf32-header.hex2\
142      -f blood-elf.hex2\
143      --exec_enable\
144      -o blood-elf
145 @@ -150,18 +171,22 @@ $MESCC_TOOLS_SEED/hex2 \
146  ./bin/M1 \
147      --LittleEndian\
148      --Architecture 1\
149 -    -f $MES_SEED/x86.M1\
150 -    -f $MES_SEED/crt1.M1\
151 -    -f $MES_SEED/libc+tcc-mes.M1\
152 +    -f $MES_PREFIX/lib/x86-mes/x86.M1\
153 +    -f $MES_SEED/x86-mes/crt1.S\
154 +    -f $MES_SEED/x86-mes/libc+tcc.S\
155 +    -f $MESCC_TOOLS_SEED/file_print.M1\
156 +    -f $MESCC_TOOLS_SEED/match.M1\
157 +    -f $MESCC_TOOLS_SEED/numerate_number.M1\
158 +    -f $MESCC_TOOLS_SEED/string.M1\
159      -f $MESCC_TOOLS_SEED/M1.M1\
160      -f M1-footer.M1\
161      -o M1.hex2
162  # Hex2-linker phase
163 -./bin/hex2 \
164 +./bin/hex2-0 \
165      --LittleEndian\
166      --Architecture 1\
167      --BaseAddress 0x1000000\
168 -    -f $MES_SEED/elf32-header.hex2\
169 +    -f $MES_PREFIX/lib/x86-mes/elf32-header.hex2\
170      -f M1.hex2\
171      --exec_enable\
172      -o bin/M1
173 @@ -177,18 +202,27 @@ $MESCC_TOOLS_SEED/hex2 \
174  ./bin/M1 \
175      --LittleEndian\
176      --Architecture 1\
177 -    -f $MES_SEED/x86.M1\
178 -    -f $MES_SEED/crt1.M1\
179 -    -f $MES_SEED/libc+tcc-mes.M1\
180 +    -f $MES_PREFIX/lib/x86-mes/x86.M1\
181 +    -f $MES_SEED/x86-mes/crt1.S\
182 +    -f $MES_SEED/x86-mes/libc+tcc.S\
183 +    -f $MESCC_TOOLS_SEED/file_print.M1\
184 +    -f $MESCC_TOOLS_SEED/match.M1\
185 +    -f $MESCC_TOOLS_SEED/numerate_number.M1\
186 +    -f $MESCC_TOOLS_SEED/string.M1\
187      -f $MESCC_TOOLS_SEED/hex2.M1\
188      -f hex2-footer.M1\
189      -o hex2.hex2
190  # Hex2-linker phase
191 -./bin/hex2 \
192 +./bin/hex2-0 \
193        --LittleEndian\
194        --Architecture 1\
195        --BaseAddress 0x1000000\
196 -      -f $MES_SEED/elf32-header.hex2\
197 +      -f $MES_PREFIX/lib/x86-mes/elf32-header.hex2\
198        -f hex2.hex2\
199        --exec_enable\
200        -o bin/hex2
201 +
202 +# TODO
203 +touch bin/exec_enable
204 +touch bin/get_machine
205 +touch bin/kaem
206 diff --git a/install.sh b/install.sh
207 index e4dccff..29e58d6 100644
208 --- a/install.sh
209 +++ b/install.sh
210 @@ -18,6 +18,6 @@
211  PREFIX=${PREFIX-usr}
212  
213  mkdir -p "$PREFIX/bin"
214 -cp blood-elf "$PREFIX/bin/blood-elf"
215 -cp hex2 "$PREFIX/bin/hex2"
216 -cp M1 "$PREFIX/bin/M1"
217 +cp bin/blood-elf "$PREFIX/bin/blood-elf"
218 +cp bin/hex2 "$PREFIX/bin/hex2"
219 +cp bin/M1 "$PREFIX/bin/M1"
220 -- 
221 2.18.0
222