Add mescc-tools-extra.

This commit is contained in:
Andrius Štikonas 2022-12-31 17:20:13 +00:00
parent 33714ff1dd
commit 77f78b2fe5
9 changed files with 86 additions and 20 deletions

3
.gitmodules vendored
View File

@ -16,3 +16,6 @@
[submodule "M2-Mesoplanet"]
path = M2-Mesoplanet
url = https://github.com/oriansj/M2-Mesoplanet.git
[submodule "mescc-tools-extra"]
path = mescc-tools-extra
url = https://github.com/oriansj/mescc-tools-extra.git

@ -1 +1 @@
Subproject commit 791cec1343d2bf50417637e9ba98890211263887
Subproject commit 0dec40778b314da52b163ca2c709bd200725445a

2
M2libc

@ -1 +1 @@
Subproject commit 1b8dacd2acb82e3e598af946992f11cd6bc10e8b
Subproject commit 41a04d675314766fd278c1f385e28c54027e9f8c

View File

@ -113,6 +113,11 @@ We now build `kaem` which is a more capable version of `kaem-optional` and adds
We can now rebuild `M2-Planet` so that it itself can benefit from full `M2libc`.
### Work in progress
### M2-Mesoplanet
Stage0-uefi is not yet complete and we still need to improve M2libc to reach the feature parity with `stage0-posix`.
`M2-Mesoplanet` is a preprocessor that is more capable than `M2-Planet` and supports `#include` statements. It can also launch compiler, assembler and linker, so we don't need to invoke them
manually.
### mescc-tools-extra
Some extra tools such as `sha256sum`, `untar`, `ungz`, `unbz2`, `mkdir`, `rm` and a few others.

18
amd64.answers Normal file
View File

@ -0,0 +1,18 @@
f9992cc845ed0b59a63060233ddfd1410536ab048b9a14bb74f147c6570cfaf1 amd64/bin/blood-elf.efi
a06abebc0d35c1c4472fdbe6da7920b4778240477a1f8cbb9d2954bb0a508981 amd64/bin/catm.efi
6dd53d9eab518d041be502463051d5b6c715009475871b6e4c2bc623b107db16 amd64/bin/chmod.efi
3bee6f93efd2b3e9559594c4469e088b59c40443c45ebbdd5578070bcddf7620 amd64/bin/cp.efi
aa3bdb6fd55bdd18894d58ed0365395fb217b9c3df530e1a1d2dac3c166f244d amd64/bin/get_machine.efi
f053f053807739dcb4489439f03c99285135907f9f9c5c682632e51c73812480 amd64/bin/hex2.efi
893719d90a64d84d1119bfb1c69ccc01a957fbfa12ed70e6f2fa90fbe6fd7d4f amd64/bin/kaem.efi
e7bb258b29861292b4a2de9550c6a29764c59542b38e39feaab6e8109dd0560a amd64/bin/M1.efi
db992bc203d3cac94bda9ed7aef3ae1996eda62707000111fb068b1558e380e7 amd64/bin/M2-Mesoplanet.efi
d25d18a569228314fb2f865a3b3a40ce261f06a0a42671b5276e342913a4f069 amd64/bin/M2-Planet.efi
6ea9c7f5dffc18e5d9426b97d11118f6243d135fe6f5c86b76cb51475088013b amd64/bin/match.efi
388012e386a792c0e62a69b529fd62e3de4c9511541da8a598889329d2df2d16 amd64/bin/mkdir.efi
9ef30a125f8663188298eeb0cab069f7f721391ced1b4941bf274bc6e2a0fdee amd64/bin/replace.efi
2cd5fd31d28e527f8c66cfd270d4b2804030fd04db9875d1632683a87926b029 amd64/bin/rm.efi
fe339744c2f3bc16a60c91a7e56c41fabc45c19b2037b7d25cdf7ca4c514dcad amd64/bin/sha256sum.efi
cc1ccf86623cc4df7d980aa545a9ddc3218abd7fc65eaa0c55ec616bbc581208 amd64/bin/ungz.efi
4f42d313d686fd5375d8d186f1d43a741c39f6143a75c58eee3a884f10add0ad amd64/bin/unbz2.efi
0ee176b2a6df20f117c82685b0ee83798a56b57696123ee505729ad2ef7486dc amd64/bin/untar.efi

View File

@ -15,6 +15,8 @@ ENDIAN_FLAG="--little-endian"
BINDIR="../${ARCH_DIR}/bin"
BUILDDIR="../${ARCH_DIR}/artifact"
TMPDIR="${BUILDDIR}"
EXE_SUFFIX=".efi"
OPERATING_SYSTEM_FLAG="--operating-system UEFI"
################################################
# Phase 11-14 Rebuild M2-Planet from C sources #
@ -27,7 +29,7 @@ TMPDIR="${BUILDDIR}"
cd mescc-tools-extra
${BINDIR}/kaem.efi --verbose --strict --file mescc-tools-extra.kaem
cd ..
./${ARCH_DIR}/bin/sha256sum -c ${ARCH}.answers
./${ARCH_DIR}/bin/sha256sum.efi -c ${ARCH}.answers
#########################
# Load after.kaem hook #

View File

@ -10,13 +10,14 @@
./${ARCH_DIR}/artifact/M2.efi --architecture ${ARCH} \
-f ./M2libc/sys/types.h \
-f ./M2libc/stddef.h \
-f ./M2libc/${ARCH}/uefi/uefi.c \
-f ./M2libc/uefi/uefi.c \
-f ./M2libc/string.c \
-f ./M2libc/${ARCH}/uefi/fcntl.c \
-f ./M2libc/uefi/fcntl.c \
-f ./M2libc/fcntl.c \
-f ./M2libc/stdio.h \
-f ./M2libc/stdio.c \
-f ./M2libc/${ARCH}/uefi/unistd.c \
-f ./M2libc/${ARCH}/uefi/sys/stat.c \
-f ./M2libc/uefi/unistd.c \
-f ./M2libc/uefi/sys/stat.c \
-f ./M2libc/stdlib.c \
-f ./M2libc/ctype.c \
-f ./M2libc/bootstrappable.c \
@ -53,13 +54,14 @@ cd ${ARCH_DIR}
./bin/M2-Planet.efi --architecture ${ARCH} \
-f ../M2libc/sys/types.h \
-f ../M2libc/stddef.h \
-f ../M2libc/${ARCH}/uefi/uefi.c \
-f ../M2libc/uefi/uefi.c \
-f ../M2libc/string.c \
-f ../M2libc/${ARCH}/uefi/fcntl.c \
-f ../M2libc/uefi/fcntl.c \
-f ../M2libc/fcntl.c \
-f ../M2libc/stdio.h \
-f ../M2libc/stdio.c \
-f ../M2libc/${ARCH}/uefi/unistd.c \
-f ../M2libc/${ARCH}/uefi/sys/stat.c \
-f ../M2libc/uefi/unistd.c \
-f ../M2libc/uefi/sys/stat.c \
-f ../M2libc/stdlib.c \
-f ../M2libc/ctype.c \
-f ../M2libc/bootstrappable.c \
@ -93,12 +95,13 @@ cd ${ARCH_DIR}
./bin/M2-Planet.efi --architecture ${ARCH} \
-f ../M2libc/sys/types.h \
-f ../M2libc/stddef.h \
-f ../M2libc/${ARCH}/uefi/uefi.c \
-f ../M2libc/uefi/uefi.c \
-f ../M2libc/string.c \
-f ../M2libc/${ARCH}/uefi/fcntl.c \
-f ../M2libc/uefi/fcntl.c \
-f ../M2libc/fcntl.c \
-f ../M2libc/stdio.h \
-f ../M2libc/stdio.c \
-f ../M2libc/${ARCH}/uefi/unistd.c \
-f ../M2libc/uefi/unistd.c \
-f ../M2libc/stdlib.c \
-f ../M2libc/ctype.c \
-f ../M2libc/bootstrappable.c \
@ -117,3 +120,37 @@ cd ${ARCH_DIR}
-f ../M2libc/${ARCH}/uefi/PE32-${ARCH}.hex2 \
-f ./artifact/get_machine.hex2 \
-o ./bin/get_machine.efi
#############################################
# Phase-14 Build blood_elf from C sources #
#############################################
./bin/M2-Planet.efi --architecture ${ARCH} \
-f ../M2libc/sys/types.h \
-f ../M2libc/stddef.h \
-f ../M2libc/uefi/uefi.c \
-f ../M2libc/string.c \
-f ../M2libc/uefi/fcntl.c \
-f ../M2libc/fcntl.c \
-f ../M2libc/stdio.h \
-f ../M2libc/stdio.c \
-f ../M2libc/uefi/unistd.c \
-f ../M2libc/stdlib.c \
-f ../M2libc/ctype.c \
-f ../M2libc/bootstrappable.c \
-f ../mescc-tools/stringify.c \
-f ../mescc-tools/blood-elf.c \
-o artifact/blood-elf.M1
./bin/M1.efi --architecture ${ARCH} \
${ENDIAN_FLAG} \
-f ../M2libc/${ARCH}/${ARCH}_defs.M1 \
-f ../M2libc/${ARCH}/uefi/libc-full.M1 \
-f ./artifact/blood-elf.M1 \
-o ./artifact/blood-elf.hex2
./bin/hex2.efi --architecture ${ARCH} \
${ENDIAN_FLAG} \
-f ../M2libc/${ARCH}/uefi/PE32-${ARCH}.hex2 \
-f ./artifact/blood-elf.hex2 \
-o ./bin/blood-elf.efi

View File

@ -71,7 +71,7 @@ amd64\artifact\hex2-0.efi amd64\artifact\M1-macro-0-0.hex2 amd64\artifact\M1-0.e
#######################################
# Phase-7 Build hex2-1 from C sources #
#######################################
amd64\artifact\M2.efi --architecture amd64 -f M2libc\sys\types.h -f M2libc\stddef.h -f M2libc\amd64\uefi\uefi.c -f M2libc\string.c -f M2libc\amd64\uefi\fcntl.c -f M2libc\fcntl.c -f M2libc\stdio.c -f M2libc\amd64\uefi\unistd.c -f M2libc\amd64\uefi\sys\stat.c -f M2libc\stdlib.c -f M2libc\ctype.c -f M2libc\bootstrappable.c -f mescc-tools\hex2.h -f mescc-tools\hex2_linker.c -f mescc-tools\hex2_word.c -f mescc-tools\hex2.c -o amd64\artifact\hex2_linker-1.M1
amd64\artifact\M2.efi --architecture amd64 -f M2libc\sys\types.h -f M2libc\stddef.h -f M2libc\uefi\uefi.c -f M2libc\string.c -f M2libc\uefi\fcntl.c -f M2libc\fcntl.c -f M2libc/stdio.h -f M2libc\stdio.c -f M2libc\uefi\unistd.c -f M2libc\uefi\sys\stat.c -f M2libc\stdlib.c -f M2libc\ctype.c -f M2libc\bootstrappable.c -f mescc-tools\hex2.h -f mescc-tools\hex2_linker.c -f mescc-tools\hex2_word.c -f mescc-tools\hex2.c -o amd64\artifact\hex2_linker-1.M1
amd64\artifact\M1-0.efi --architecture amd64 --little-endian -f M2libc\amd64\amd64_defs.M1 -f M2libc\amd64\uefi\libc-full.M1 -f amd64\artifact\hex2_linker-1.M1 -o amd64\artifact\hex2_linker-1.hex2
@ -85,7 +85,7 @@ amd64\artifact\hex2-0.efi amd64\artifact\hex2_linker-1-0.hex2 amd64\artifact\hex
###################################
# Phase-8 Build M1 from C sources #
###################################
amd64\artifact\M2.efi --architecture amd64 -f M2libc/sys/types.h -f M2libc/stddef.h -f M2libc/amd64/uefi/uefi.c -f M2libc/string.c -f M2libc/amd64/uefi/fcntl.c -f M2libc/fcntl.c -f M2libc/stdio.c -f M2libc/amd64/uefi/unistd.c -f M2libc/amd64/uefi/sys/stat.c -f M2libc/stdlib.c -f M2libc/ctype.c -f M2libc/bootstrappable.c -f mescc-tools/stringify.c -f mescc-tools/M1-macro.c -o amd64/artifact/M1-macro-1.M1
amd64\artifact\M2.efi --architecture amd64 -f M2libc/sys/types.h -f M2libc/stddef.h -f M2libc/uefi/uefi.c -f M2libc/string.c -f M2libc/uefi/fcntl.c -f M2libc/fcntl.c -f M2libc/stdio.h -f M2libc/stdio.c -f M2libc/uefi/unistd.c -f M2libc/uefi/sys/stat.c -f M2libc/stdlib.c -f M2libc/ctype.c -f M2libc/bootstrappable.c -f mescc-tools/stringify.c -f mescc-tools/M1-macro.c -o amd64/artifact/M1-macro-1.M1
amd64\artifact\M1-0.efi --architecture amd64 --little-endian -f M2libc/amd64/amd64_defs.M1 -f M2libc/amd64/uefi/libc-full.M1 -f amd64/artifact/M1-macro-1.M1 -o amd64/artifact/M1-macro-1.hex2
@ -94,7 +94,7 @@ amd64\artifact\hex2-1.efi --architecture amd64 --little-endian -f M2libc/amd64/u
#####################################
# Phase-9 Build hex2 from C sources #
#####################################
amd64\artifact\M2.efi --architecture amd64 -f M2libc/sys/types.h -f M2libc/stddef.h -f M2libc/amd64/uefi/uefi.c -f M2libc/string.c -f M2libc/amd64/uefi/fcntl.c -f M2libc/fcntl.c -f M2libc/stdio.c -f M2libc/amd64/uefi/unistd.c -f M2libc/amd64/uefi/sys/stat.c -f M2libc/stdlib.c -f M2libc/ctype.c -f M2libc/bootstrappable.c -f mescc-tools/hex2.h -f mescc-tools/hex2_linker.c -f mescc-tools/hex2_word.c -f mescc-tools/hex2.c -o amd64/artifact/hex2_linker-2.M1
amd64\artifact\M2.efi --architecture amd64 -f M2libc/sys/types.h -f M2libc/stddef.h -f M2libc/uefi/uefi.c -f M2libc/string.c -f M2libc/uefi/fcntl.c -f M2libc/fcntl.c -f M2libc/stdio.h -f M2libc/stdio.c -f M2libc/uefi/unistd.c -f M2libc/uefi/sys/stat.c -f M2libc/stdlib.c -f M2libc/ctype.c -f M2libc/bootstrappable.c -f mescc-tools/hex2.h -f mescc-tools/hex2_linker.c -f mescc-tools/hex2_word.c -f mescc-tools/hex2.c -o amd64/artifact/hex2_linker-2.M1
amd64\bin\M1.efi --architecture amd64 --little-endian -f M2libc/amd64/amd64_defs.M1 -f M2libc/amd64/uefi/libc-full.M1 -f amd64/artifact/hex2_linker-2.M1 -o amd64/artifact/hex2_linker-2.hex2
@ -103,7 +103,7 @@ amd64\artifact\hex2-1.efi --architecture amd64 --little-endian -f M2libc/amd64/u
######################################
# Phase-10 Build kaem from C sources #
######################################
amd64\artifact\M2.efi --architecture amd64 -f M2libc/sys/types.h -f M2libc/stddef.h -f M2libc/amd64/uefi/uefi.c -f M2libc/string.c -f M2libc/amd64/uefi/fcntl.c -f M2libc/fcntl.c -f M2libc/stdio.c -f M2libc/amd64/uefi/unistd.c -f M2libc/amd64/uefi/sys/stat.c -f M2libc/stdlib.c -f M2libc/ctype.c -f M2libc/bootstrappable.c -f mescc-tools/Kaem/kaem.h -f mescc-tools/Kaem/variable.c -f mescc-tools/Kaem/kaem_globals.c -f mescc-tools/Kaem/kaem.c -o amd64/artifact/kaem.M1
amd64\artifact\M2.efi --architecture amd64 -f M2libc/sys/types.h -f M2libc/stddef.h -f M2libc/uefi/uefi.c -f M2libc/string.c -f M2libc/uefi/fcntl.c -f M2libc/fcntl.c -f M2libc/stdio.h -f M2libc/stdio.c -f M2libc/uefi/unistd.c -f M2libc/uefi/sys/stat.c -f M2libc/stdlib.c -f M2libc/ctype.c -f M2libc/bootstrappable.c -f mescc-tools/Kaem/kaem.h -f mescc-tools/Kaem/variable.c -f mescc-tools/Kaem/kaem_globals.c -f mescc-tools/Kaem/kaem.c -o amd64/artifact/kaem.M1
amd64\bin\M1.efi --architecture amd64 --little-endian -f M2libc/amd64/amd64_defs.M1 -f M2libc/amd64/uefi/libc-full.M1 -f amd64/artifact/kaem.M1 -o amd64/artifact/kaem.hex2

1
mescc-tools-extra Submodule

@ -0,0 +1 @@
Subproject commit ac95f61d12efe150eca7b74241384fa9fbba3a2d