From 730d88f9b057ded5088df017e5e40031bcbf2035 Mon Sep 17 00:00:00 2001 From: karina Date: Sat, 25 Apr 2026 06:05:46 +0400 Subject: [PATCH] fix: preserve bootinfo pointer in kernel _start --- Kernel/Source/Arch/entry.S | 4 ++++ Kernel/Source/KernelMain.c | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Kernel/Source/Arch/entry.S b/Kernel/Source/Arch/entry.S index af21614..af8fadc 100644 --- a/Kernel/Source/Arch/entry.S +++ b/Kernel/Source/Arch/entry.S @@ -1,6 +1,10 @@ .section .text.boot, "ax" .global _start _start: + sub sp, sp, #16 + str x0, [sp] bl ExceptionsVectorsInit + ldr x0, [sp] + add sp, sp, #16 bl KernelMain b . \ No newline at end of file diff --git a/Kernel/Source/KernelMain.c b/Kernel/Source/KernelMain.c index 3976a24..b36806a 100644 --- a/Kernel/Source/KernelMain.c +++ b/Kernel/Source/KernelMain.c @@ -1,5 +1,7 @@ #include +#include "../Common/bootinfo.h" -void KernelMain(void) { - OSLog("Hi meow! ;3\n"); +void KernelMain(Bootinfo* bootinfo) { + OSLog("DTB located at 0x%x\n", bootinfo->dtb); + OSLog("Kernel located at 0x%x\n", bootinfo->kernelInfo.kernelAddress); } \ No newline at end of file