From ac9741e12222e72bad3414bc6f588e70a3d130cc Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Tue, 14 Apr 2026 22:47:15 +0800 Subject: feat: implement FDT-based memory discovery and add comprehensive debug logging to exec syscalls --- include/kernel/pmm.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'include/kernel/pmm.h') diff --git a/include/kernel/pmm.h b/include/kernel/pmm.h index 1fc3070..261786d 100644 --- a/include/kernel/pmm.h +++ b/include/kernel/pmm.h @@ -1,16 +1,21 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* - * Copyright (C) 2026 Richard QIn + * Copyright (C) 2026 Richard Qin */ #pragma once #include "common/types.h" #include "kernel/spinlock.h" +#include "kernel/fdt.h" // For g_devices // Physical Memory Layout Definition #define KERNBASE 0x80000000 -// Set the memory size to 128MB -#define PHYSIZE (128 * 1024 * 1024) + +// Dynamic memory size from FDT +// Default to 128MB if FDT not present/parsed +extern uint64 g_phys_size; + +#define PHYSIZE (g_phys_size) #define PHYSTOP (KERNBASE + PHYSIZE) // Buddy System Max Order -- cgit v1.2.3