From 296737c1336240a3884fa72ffc1348fa519190ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Sat, 26 Nov 2022 18:26:19 +0000 Subject: [PATCH] Build final versions of hex2 and M1. --- Development/kaem-optional.c | 3 +-- M2-Planet | 2 +- M2libc | 2 +- amd64/bin/placeholder | 0 amd64/mescc-tools-mini-kaem.kaem | 39 ++++++++++++++++++++++++++++++++ 5 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 amd64/bin/placeholder diff --git a/Development/kaem-optional.c b/Development/kaem-optional.c index 84a6385..63a5b3c 100644 --- a/Development/kaem-optional.c +++ b/Development/kaem-optional.c @@ -157,8 +157,7 @@ efi_status_t efi_main(efi_handle_t image_handle, struct efi_system_table *system system->boot->free_pool(device_path); system->boot->free_pool(executable); - system->boot->open_protocol(child_ih, &guid1, (void **) &child_image, child_ih, 0, - EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL); + system->boot->open_protocol(child_ih, &guid1, (void **) &child_image, child_ih, 0, EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL); child_image->load_options = command; child_image->load_options_size = 2 * (i + 1); child_image->device = image->device; diff --git a/M2-Planet b/M2-Planet index b866478..12d40f6 160000 --- a/M2-Planet +++ b/M2-Planet @@ -1 +1 @@ -Subproject commit b8664784b6a24e07173bef962542fd7066d33c44 +Subproject commit 12d40f6c82c8bd2aa194c417bfab2803643b7155 diff --git a/M2libc b/M2libc index 49252ff..453ba69 160000 --- a/M2libc +++ b/M2libc @@ -1 +1 @@ -Subproject commit 49252ff89a4366db3ef7ffdaed7b1db60180a3cb +Subproject commit 453ba693526d0d9b2bfbf31b5ba33eb301adc2de diff --git a/amd64/bin/placeholder b/amd64/bin/placeholder new file mode 100644 index 0000000..e69de29 diff --git a/amd64/mescc-tools-mini-kaem.kaem b/amd64/mescc-tools-mini-kaem.kaem index 8a8c739..5c297c0 100644 --- a/amd64/mescc-tools-mini-kaem.kaem +++ b/amd64/mescc-tools-mini-kaem.kaem @@ -1,3 +1,4 @@ +#! /usr/bin/env bash # SPDX-FileCopyrightText: 2022 Andrius Štikonas # SPDX-FileCopyrightText: 2017 Jeremiah Orians # SPDX-FileCopyrightText: 2017 2017 Jan Nieuwenhuizen @@ -60,3 +61,41 @@ amd64\artifact\catm.efi amd64\artifact\M1-macro-0-0.M1 M2libc\amd64\amd64_defs.M amd64\artifact\M0.efi amd64\artifact\M1-macro-0-0.M1 amd64\artifact\M1-macro-0.hex2 amd64\artifact\catm.efi amd64\artifact\M1-macro-0-0.hex2 M2libc\amd64\uefi\PE32-amd64.hex2 amd64\artifact\M1-macro-0.hex2 amd64\artifact\hex2-0.efi amd64\artifact\M1-macro-0-0.hex2 amd64\artifact\M1-0.efi + + +# This is the last stage where catm will need to be used and the last stage where +# M0 is used, as we will being using it's much more powerful and cross-platform +# version with a bunch of extra goodies. +# We are also switching to a more powerful C library that supports more of the POSIX standard. + +####################################### +# 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\amd64\uefi\unistd.c -f M2libc\amd64\uefi\sys\stat.c -f M2libc\stdlib.c -f M2libc\stdio.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 + +amd64\artifact\catm.efi amd64\artifact\hex2_linker-1-0.hex2 M2libc\amd64\uefi\PE32-amd64.hex2 amd64\artifact\hex2_linker-1.hex2 + +amd64\artifact\hex2-0.efi amd64\artifact\hex2_linker-1-0.hex2 amd64\artifact\hex2-1.efi + +# This is the last stage where we will be using the handwritten hex2 and instead +# be using the far more powerful, cross-platform version with a bunch more goodies + +################################### +# 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/amd64/uefi/unistd.c -f M2libc/amd64/uefi/sys/stat.c -f M2libc/stdlib.c -f M2libc/stdio.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 + +amd64\artifact\hex2-1.efi --architecture amd64 --little-endian -f M2libc/amd64/uefi/PE32-amd64.hex2 -f amd64/artifact/M1-macro-1.hex2 -o amd64/bin/M1.efi + +##################################### +# 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/amd64/uefi/unistd.c -f M2libc/amd64/uefi/sys/stat.c -f M2libc/stdlib.c -f M2libc/stdio.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 + +amd64\artifact\hex2-1.efi --architecture amd64 --little-endian -f M2libc/amd64/uefi/PE32-amd64.hex2 -f amd64/artifact/hex2_linker-2.hex2 -o amd64/bin/hex2.efi