aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kernel/features/memory.c6
-rw-r--r--libc/inc/mem.h3
2 files changed, 4 insertions, 5 deletions
diff --git a/kernel/features/memory.c b/kernel/features/memory.c
index 4dfebff..7813c56 100644
--- a/kernel/features/memory.c
+++ b/kernel/features/memory.c
@@ -405,16 +405,14 @@ void memory_initialize(struct mem_info *mem_info)
memory_map_identity(&kernel_dir, kernel_memory_range(), MEMORY_NONE);
// Map kernel stack
- memory_map_identity(&kernel_dir, memory_range_around_address(STACK_START, 0x1000),
+ memory_map_identity(&kernel_dir,
+ memory_range_around_address(STACK_START - STACK_SIZE, STACK_SIZE),
MEMORY_NONE);
// Map kernel heap
memory_map_identity(&kernel_dir, memory_range_around_address(HEAP_START, HEAP_INIT_SIZE),
MEMORY_NONE);
- // Map stack guard?
- /* memory_map_identity(&kernel_dir, memory_range_around_address(0xdeadbeef, 0x1), MEMORY_NONE); */
-
// Unmap NULL byte/page
virtual_free(&kernel_dir, memory_range(0, PAGE_SIZE));
physical_set_used(0, 1);
diff --git a/libc/inc/mem.h b/libc/inc/mem.h
index 737f772..e93f4d2 100644
--- a/libc/inc/mem.h
+++ b/libc/inc/mem.h
@@ -13,7 +13,8 @@ void *realloc(void *ptr, u32 size);
void *zalloc(u32 size);
#ifdef kernel
-#define STACK_START (0x00500000 - 1) // Defined it bootloader
+#define STACK_START 0x00500000 // Defined it bootloader
+#define STACK_SIZE 0x1000 // idk
#define HEAP_START 0x00f00000
#define HEAP_INIT_SIZE 0x0f00000
void heap_init(u32 start);