kmain: fix heap initialization and use kvalloc instead of alloc_page

This commit is contained in:
2025-06-06 14:16:47 +03:00
parent 01155234c6
commit ea6733fd46
+4 -2
View File
@@ -11,6 +11,7 @@
#include "../include/task.h"
#include "../include/multiboot.h"
#include "../include/liballoc.h"
#include "../include/kheap.h"
#include <stdint.h>
@@ -187,6 +188,7 @@ void kmain(unsigned int magic, unsigned int info)
//heap_init();
//printf("after heap_init\n");
kheap_init();
__asm__ __volatile__ ("sti");
//scheduler_init();
printf("Kernel init sequence completed\n");
@@ -205,8 +207,8 @@ void kmain(unsigned int magic, unsigned int info)
char temp1[1024] = "rusya_krutoy";
char temp2[1024] = "katya_tozhe_krutaya";
huy = malloc(64);//alloc_page();//heap_alloc(1024);
huy2 = malloc(64);//alloc_page();//heap_alloc(1024);
huy = kvalloc(1);//alloc_page();
huy2 = kvalloc(2);//alloc_page();
memcpy(huy, temp1, sizeof(temp1));
memcpy(huy2, temp2, sizeof(temp1));