From c58fcd5efead995d8fbf575547c9eefa0d91c82b Mon Sep 17 00:00:00 2001 From: "Magomed Kostoev (mkostoevr)" Date: Sat, 27 Nov 2021 09:23:17 +0000 Subject: [PATCH] [KERNEL][TEST] Refactor UMKA build git-svn-id: svn://kolibrios.org@9329 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/runtests.py | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/kernel/trunk/runtests.py b/kernel/trunk/runtests.py index 7c70955727..e6dfed67e2 100755 --- a/kernel/trunk/runtests.py +++ b/kernel/trunk/runtests.py @@ -173,23 +173,42 @@ def run_tests_serially(tests, root_dir): return thread def gcc(fin, fout): - command = f"gcc -m32 -std=c11 -g -O0 -D_FILE_OFFSET_BITS=64 -DNDEBUG -masm=intel -D_POSIX_C_SOURCE=200809L -Iumka -Iumka/linux -fno-pie -c {fin} -o {fout}" + flags = "-m32 -std=c11 -g -O0 -masm=intel -fno-pie" + defines = "-D_FILE_OFFSET_BITS=64 -DNDEBUG -D_POSIX_C_SOURCE=200809L" + include = "-Iumka -Iumka/linux" + command = f"gcc {flags} {defines} {include} -c {fin} -o {fout}" print(command) os.system(command) +def build_umka_asm(): + include = "INCLUDE=\"../../programs/develop/libraries/libcrash/hash\"" + flags = "-dUEFI=1 -dextended_primary_loader=1 -dUMKA=1" + files = "umka/umka.asm umka/build/umka.o -s umka/build/umka.fas" + memory = "-m 2000000" + os.system(f"{include} fasm {flags} {files} {memory}") + def build_umka(): if not enable_umka: return if os.path.exists("umka_shell"): return os.makedirs("umka/build", exist_ok = True) - sources = ["umka_shell.c", "shell.c", "trace.c", "trace_lbr.c", "vdisk.c", "vnet.c", "lodepng.c", "linux/pci.c", "linux/thread.c", "util.c"] + sources = [ "umka_shell.c", + "shell.c", + "trace.c", + "trace_lbr.c", + "vdisk.c", + "vnet.c", + "lodepng.c", + "linux/pci.c", + "linux/thread.c", + "util.c" ] sources = [f"umka/{f}" for f in sources] for source in sources: gcc(source, f"{source}.o") objects = " ".join([ f"{s}.o" for s in sources ]) - os.system(f"INCLUDE=\"../../programs/develop/libraries/libcrash/hash\" fasm -dUEFI=1 -dextended_primary_loader=1 -dUMKA=1 umka/umka.asm umka/build/umka.o -s umka/build/umka.fas -m 2000000") - objects += (" umka/build/umka.o") + build_umka_asm() + objects += " umka/build/umka.o" os.system(f"gcc -m32 -no-pie -o umka_shell -static -T umka/umka.ld {objects}") def run_umka_test(test_file_path):