From 34f86b3f917f75f9c575799766914bfde4afad08 Mon Sep 17 00:00:00 2001 From: nakst <> Date: Wed, 22 Sep 2021 13:43:37 +0100 Subject: [PATCH] com output option --- util/build_common.h | 1 + util/build_core.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/util/build_common.h b/util/build_common.h index 026226c..995428f 100644 --- a/util/build_common.h +++ b/util/build_common.h @@ -285,6 +285,7 @@ Option options[] = { { "Flag.VGA_TEXT_MODE", OPTION_TYPE_BOOL, { .b = false } }, { "Flag.CHECK_FOR_NOT_RESPONDING", OPTION_TYPE_BOOL, { .b = true } }, { "Flag._ALWAYS_USE_VBE", OPTION_TYPE_BOOL, { .b = false } }, + { "Flag.COM_OUTPUT", OPTION_TYPE_BOOL, { .b = true } }, { "Dependency.ACPICA", OPTION_TYPE_BOOL, { .b = true } }, { "Dependency.stb_image", OPTION_TYPE_BOOL, { .b = true } }, { "Dependency.stb_image_write", OPTION_TYPE_BOOL, { .b = true } }, diff --git a/util/build_core.c b/util/build_core.c index ec420d4..33f302a 100644 --- a/util/build_core.c +++ b/util/build_core.c @@ -150,6 +150,7 @@ char apiLinkFlags1[4096] = " -T util/linker/api64.ld -ffreestanding -nostdlib -g char apiLinkFlags2[4096] = " -lgcc "; char apiLinkFlags3[4096] = " -Wl,--end-group -Lroot/Applications/POSIX/lib "; char kernelLinkFlags[4096] = " -ffreestanding -nostdlib -lgcc -g -z max-page-size=0x1000 "; +char kernelAssemblyFlags[4096] = " -felf64 -Fdwarf "; // Specific configuration options: @@ -1046,8 +1047,7 @@ void LinkKernel() { } void BuildKernel(Application *application) { - ExecuteForApp(application, toolchainNasm, "-MD", "bin/kernel2.d", "-D", "COM_OUTPUT", - "-felf64", "kernel/x86_64.s", "-o", "bin/kernel_x86_64.o", "-Fdwarf"); + ExecuteForApp(application, toolchainNasm, "-MD", "bin/kernel2.d", "kernel/x86_64.s", "-o", "bin/kernel_x86_64.o", ArgString(kernelAssemblyFlags)); ExecuteForApp(application, toolchainCXX, "-MD", "-c", "kernel/main.cpp", "-o", "bin/kernel.o", ArgString(kernelCompileFlags), ArgString(cppCompileFlags), ArgString(commonCompileFlags)); } @@ -1300,6 +1300,8 @@ int main(int argc, char **argv) { convertFonts = false; } else if (0 == strcmp(s.key, "Flag._ALWAYS_USE_VBE")) { bootUseVBE = !!atoi(s.value); + } else if (0 == strcmp(s.key, "Flag.COM_OUTPUT") && atoi(s.value)) { + strcat(kernelAssemblyFlags, " -DCOM_OUTPUT "); } else if (0 == memcmp(s.key, "General.", 8)) { EsINIState s2 = s; s2.key += 8, s2.keyBytes -= 8;