kmain: fix heap initialization and use kvalloc instead of alloc_page
This commit is contained in:
+4
-2
@@ -11,6 +11,7 @@
|
|||||||
#include "../include/task.h"
|
#include "../include/task.h"
|
||||||
#include "../include/multiboot.h"
|
#include "../include/multiboot.h"
|
||||||
#include "../include/liballoc.h"
|
#include "../include/liballoc.h"
|
||||||
|
#include "../include/kheap.h"
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
@@ -187,6 +188,7 @@ void kmain(unsigned int magic, unsigned int info)
|
|||||||
|
|
||||||
//heap_init();
|
//heap_init();
|
||||||
//printf("after heap_init\n");
|
//printf("after heap_init\n");
|
||||||
|
kheap_init();
|
||||||
__asm__ __volatile__ ("sti");
|
__asm__ __volatile__ ("sti");
|
||||||
//scheduler_init();
|
//scheduler_init();
|
||||||
printf("Kernel init sequence completed\n");
|
printf("Kernel init sequence completed\n");
|
||||||
@@ -205,8 +207,8 @@ void kmain(unsigned int magic, unsigned int info)
|
|||||||
char temp1[1024] = "rusya_krutoy";
|
char temp1[1024] = "rusya_krutoy";
|
||||||
char temp2[1024] = "katya_tozhe_krutaya";
|
char temp2[1024] = "katya_tozhe_krutaya";
|
||||||
|
|
||||||
huy = malloc(64);//alloc_page();//heap_alloc(1024);
|
huy = kvalloc(1);//alloc_page();
|
||||||
huy2 = malloc(64);//alloc_page();//heap_alloc(1024);
|
huy2 = kvalloc(2);//alloc_page();
|
||||||
|
|
||||||
memcpy(huy, temp1, sizeof(temp1));
|
memcpy(huy, temp1, sizeof(temp1));
|
||||||
memcpy(huy2, temp2, sizeof(temp1));
|
memcpy(huy2, temp2, sizeof(temp1));
|
||||||
|
|||||||
Reference in New Issue
Block a user