summaryrefslogtreecommitdiff
path: root/include/kernel/pmm.h
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2026-04-14 22:47:15 +0800
committerRichard Qin <richard.qin.x@gmail.com>2026-04-14 22:47:15 +0800
commitac9741e12222e72bad3414bc6f588e70a3d130cc (patch)
tree6aace9f63a2ea54c7c3fd1e49e98ff81b638296f /include/kernel/pmm.h
parent1e862099a13266da57ff7c6de11c1a11c42a8112 (diff)
downloadlume-ac9741e12222e72bad3414bc6f588e70a3d130cc.tar.gz
lume-ac9741e12222e72bad3414bc6f588e70a3d130cc.tar.xz
feat: implement FDT-based memory discovery and add comprehensive debug logging to exec syscalls
Diffstat (limited to 'include/kernel/pmm.h')
-rw-r--r--include/kernel/pmm.h11
1 files changed, 8 insertions, 3 deletions
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