From aad9aa1db58d2d38bde62b332e591691f6795190 Mon Sep 17 00:00:00 2001 From: apio Date: Sun, 18 Sep 2022 17:03:29 +0200 Subject: [PATCH] Start the call stack with a null RBP before calling _start --- kernel/moon.ld | 2 +- kernel/src/main.asm | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 kernel/src/main.asm diff --git a/kernel/moon.ld b/kernel/moon.ld index 65d26417..68fe520f 100644 --- a/kernel/moon.ld +++ b/kernel/moon.ld @@ -1,4 +1,4 @@ -ENTRY(_start) +ENTRY(_main) OUTPUT_FORMAT(elf64-x86-64) mmio = 0xfffffffff8000000; /* these are configurable for level 2 loaders */ diff --git a/kernel/src/main.asm b/kernel/src/main.asm new file mode 100644 index 00000000..92eee7f3 --- /dev/null +++ b/kernel/src/main.asm @@ -0,0 +1,6 @@ +global _main +extern _start + +_main: + xor rbp, rbp + call _start \ No newline at end of file