From 0ecfc3f99ce7f34f581d6237ea988e2f3e79603f Mon Sep 17 00:00:00 2001 From: Ali Mashtizadeh Date: Thu, 9 Nov 2023 11:54:56 -0500 Subject: [PATCH] Linker and boot cleanup --- SConstruct | 3 ++- sys/SConscript | 4 ++-- sys/arm64/{multiboot.S => locore.S} | 4 +--- 3 files changed, 5 insertions(+), 6 deletions(-) rename sys/arm64/{multiboot.S => locore.S} (89%) diff --git a/SConstruct b/SConstruct index 4cda479..361f96e 100644 --- a/SConstruct +++ b/SConstruct @@ -56,6 +56,7 @@ if env["ARCH"] == "amd64": env.Append(CPPFLAGS = [ "-target", "x86_64-freebsd-freebsd-elf" ]) elif env["ARCH"] == "arm64": env.Append(CPPFLAGS = [ "-target", "arm64-freebsd-freebsd-elf" ]) + env.Append(LINKFLAGS = [ "-fuse-ld=lld", "-Wl,-maarch64elf" ]) else: print("Unsupported architecture: " + env["ARCH"]) sys.exit(-1) @@ -152,7 +153,7 @@ if not conf.CheckCC(): if not env["CCVERSION"].startswith("15."): print('Only Clang 15 is supported') print('You are running: ' + env["CCVERSION"]) - CheckFailed() +# CheckFailed() conf.Finish() diff --git a/sys/SConscript b/sys/SConscript index e2d1c49..5439d59 100644 --- a/sys/SConscript +++ b/sys/SConscript @@ -38,9 +38,9 @@ src_amd64 = [ src_arm64 = [ # Multiboot requires multiboot.S to be the first file - "arm64/multiboot.S", + "arm64/locore.S", "arm64/mbentry.c", - # AMD64 + # ARM64 "arm64/debug.c", "arm64/disasm.c", "arm64/irq.c", diff --git a/sys/arm64/multiboot.S b/sys/arm64/locore.S similarity index 89% rename from sys/arm64/multiboot.S rename to sys/arm64/locore.S index 12e1c16..1946d62 100644 --- a/sys/arm64/multiboot.S +++ b/sys/arm64/locore.S @@ -1,5 +1,5 @@ /* - * Multiboot Entry + * Boot */ #define STACK_SIZE 0x4000 @@ -7,8 +7,6 @@ #define KERNEL_BASE 0xFFFF800000000000 #define LOWMEM(_x) (_x - KERNEL_BASE) -.extern mb_entry - .text /**