diff --git a/.gitmodules b/.gitmodules index b705656..10e7ca0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,3 +13,6 @@ [submodule "mescc-tools"] path = mescc-tools url = https://github.com/oriansj/mescc-tools/ +[submodule "M2-Mesoplanet"] + path = M2-Mesoplanet + url = https://github.com/oriansj/M2-Mesoplanet.git diff --git a/M2-Mesoplanet b/M2-Mesoplanet new file mode 160000 index 0000000..791cec1 --- /dev/null +++ b/M2-Mesoplanet @@ -0,0 +1 @@ +Subproject commit 791cec1343d2bf50417637e9ba98890211263887 diff --git a/M2-Planet b/M2-Planet index 4f17e04..286964d 160000 --- a/M2-Planet +++ b/M2-Planet @@ -1 +1 @@ -Subproject commit 4f17e046e87a42b79bcc5c73656122c2ae50143b +Subproject commit 286964d5f81ee7393a24b74447ddf48d435ac89a diff --git a/M2libc b/M2libc index a1db99e..fbd4f10 160000 --- a/M2libc +++ b/M2libc @@ -1 +1 @@ -Subproject commit a1db99e06ca5fbf97f41158187908d593a8b59fd +Subproject commit fbd4f1099ff1e45c2a572c6c2bf48058daefcd75 diff --git a/amd64/kaem.run b/amd64/kaem.run index 6f26dc9..d41e591 100644 --- a/amd64/kaem.run +++ b/amd64/kaem.run @@ -5,8 +5,8 @@ # To run in kaem simply: kaem --verbose --strict -ARCH="amd64" -ARCH_DIR="amd64" +ARCH=amd64 +ARCH_DIR=amd64 M2LIBC="../M2libc" TOOLS="../${ARCH_DIR}/bin" BLOOD_FLAG="--64" diff --git a/amd64/mescc-tools-full-kaem.kaem b/amd64/mescc-tools-full-kaem.kaem index 19e8c40..09c2889 100644 --- a/amd64/mescc-tools-full-kaem.kaem +++ b/amd64/mescc-tools-full-kaem.kaem @@ -1,12 +1,119 @@ #! /usr/bin/env bash # SPDX-FileCopyrightText: 2022 Andrius Štikonas -# SPDX-FileCopyrightText: 2017,2019 Jeremiah Orians -# SPDX-FileCopyrightText: 2017,2019 Jan Nieuwenhuizen # # SPDX-License-Identifier: GPL-3.0-or-later +############################################ +# Phase-11 Build M2-Planet from M2-Planet # +############################################ + +./${ARCH_DIR}/artifact/M2.efi --architecture ${ARCH} \ + -f ./M2libc/sys/types.h \ + -f ./M2libc/stddef.h \ + -f ./M2libc/${ARCH}/uefi/uefi.c \ + -f ./M2libc/string.c \ + -f ./M2libc/${ARCH}/uefi/fcntl.c \ + -f ./M2libc/fcntl.c \ + -f ./M2libc/stdio.c \ + -f ./M2libc/${ARCH}/uefi/unistd.c \ + -f ./M2libc/${ARCH}/uefi/sys/stat.c \ + -f ./M2libc/stdlib.c \ + -f ./M2libc/ctype.c \ + -f ./M2libc/bootstrappable.c \ + -f ./M2-Planet/cc.h \ + -f ./M2-Planet/cc_globals.c \ + -f ./M2-Planet/cc_reader.c \ + -f ./M2-Planet/cc_strings.c \ + -f ./M2-Planet/cc_types.c \ + -f ./M2-Planet/cc_core.c \ + -f ./M2-Planet/cc_macro.c \ + -f ./M2-Planet/cc.c \ + -o ./${ARCH_DIR}/artifact/M2-1.M1 + +./${ARCH_DIR}/bin/M1.efi --architecture ${ARCH} \ + ${ENDIAN_FLAG} \ + -f ./M2libc/${ARCH}/${ARCH}_defs.M1 \ + -f ./M2libc/${ARCH}/uefi/libc-full.M1 \ + -f ./${ARCH_DIR}/artifact/M2-1.M1 \ + -f ./${ARCH_DIR}/artifact/M2-1-footer.M1 \ + -o ./${ARCH_DIR}/artifact/M2-1.hex2 + +./${ARCH_DIR}/bin/hex2.efi --architecture ${ARCH} \ + ${ENDIAN_FLAG} \ + -f ./M2libc/${ARCH}/uefi/PE32-${ARCH}.hex2 \ + -f ./${ARCH_DIR}/artifact/M2-1.hex2 \ + -o ./${ARCH_DIR}/bin/M2-Planet.efi + cd ${ARCH_DIR} ############################################### # Phase-12 Build M2-Mesoplanet from M2-Planet # ############################################### + +./bin/M2-Planet.efi --architecture ${ARCH} \ + -f ../M2libc/sys/types.h \ + -f ../M2libc/stddef.h \ + -f ../M2libc/${ARCH}/uefi/uefi.c \ + -f ../M2libc/string.c \ + -f ../M2libc/${ARCH}/uefi/fcntl.c \ + -f ../M2libc/fcntl.c \ + -f ../M2libc/stdio.c \ + -f ../M2libc/${ARCH}/uefi/unistd.c \ + -f ../M2libc/${ARCH}/uefi/sys/stat.c \ + -f ../M2libc/stdlib.c \ + -f ../M2libc/ctype.c \ + -f ../M2libc/bootstrappable.c \ + -f ../M2-Mesoplanet/cc.h \ + -f ../M2-Mesoplanet/cc_globals.c \ + -f ../M2-Mesoplanet/cc_env.c \ + -f ../M2-Mesoplanet/cc_reader.c \ + -f ../M2-Mesoplanet/cc_spawn.c \ + -f ../M2-Mesoplanet/cc_core.c \ + -f ../M2-Mesoplanet/cc_macro.c \ + -f ../M2-Mesoplanet/cc.c \ + -o ./artifact/M2-Mesoplanet-1.M1 + +./bin/M1.efi --architecture ${ARCH} \ + ${ENDIAN_FLAG} \ + -f ../M2libc/${ARCH}/${ARCH}_defs.M1 \ + -f ../M2libc/${ARCH}/uefi/libc-full.M1 \ + -f ./artifact/M2-Mesoplanet-1.M1 \ + -o ./artifact/M2-Mesoplanet-1.hex2 + +./bin/hex2.efi --architecture ${ARCH} \ + ${ENDIAN_FLAG} \ + -f ../M2libc/${ARCH}/uefi/PE32-${ARCH}.hex2 \ + -f ./artifact/M2-Mesoplanet-1.hex2 \ + -o ./bin/M2-Mesoplanet.efi + +############################################# +# Phase-13 Build get_machine from C sources # +############################################# + +./bin/M2-Planet.efi --architecture ${ARCH} \ + -f ../M2libc/sys/types.h \ + -f ../M2libc/stddef.h \ + -f ../M2libc/${ARCH}/uefi/uefi.c \ + -f ../M2libc/string.c \ + -f ../M2libc/${ARCH}/uefi/fcntl.c \ + -f ../M2libc/fcntl.c \ + -f ../M2libc/stdio.c \ + -f ../M2libc/${ARCH}/uefi/unistd.c \ + -f ../M2libc/stdlib.c \ + -f ../M2libc/ctype.c \ + -f ../M2libc/bootstrappable.c \ + -f ../mescc-tools/get_machine.c \ + -o artifact/get_machine.M1 + +./bin/M1.efi --architecture ${ARCH} \ + ${ENDIAN_FLAG} \ + -f ../M2libc/${ARCH}/${ARCH}_defs.M1 \ + -f ../M2libc/${ARCH}/uefi/libc-full.M1 \ + -f ./artifact/get_machine.M1 \ + -o ./artifact/get_machine.hex2 + +./bin/hex2.efi --architecture ${ARCH} \ + ${ENDIAN_FLAG} \ + -f ../M2libc/${ARCH}/uefi/PE32-${ARCH}.hex2 \ + -f ./artifact/get_machine.hex2 \ + -o ./bin/get_machine.efi