From fffa4b76994bd0e9485826e86dae92938ff433e2 Mon Sep 17 00:00:00 2001 From: Ruslan Isaev Date: Wed, 20 Aug 2025 21:01:09 +0300 Subject: [PATCH] kmain: allocate first 16 pages for stack --- src/kernel/kernel.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c index 698b2c0..ad93a90 100644 --- a/src/kernel/kernel.c +++ b/src/kernel/kernel.c @@ -136,8 +136,11 @@ void kmain(unsigned int magic, unsigned int info) printf("test_str: %X, &test_str %X\n", test_str, &test_str); free_page(test_str); - alloc_page();//TODO: fix this this, because now we MUST allocate a page for checks of successfulness of allocation to pass - //the first page is at 0x0 and in check we check by if(!) which returns 0 (false), yeah + //reserve first 16 pages (64KB) for the stack whose top address is defined as 0xC0010000 in the boot.asm + for(int i = 0; i < 16; i++) + { + alloc_page(); + } //while(1){}