mm: implement heap with liballoc, might review later

This commit is contained in:
2025-06-06 00:36:22 +03:00
parent d1ac41deeb
commit 541bc7172f
6 changed files with 786 additions and 4 deletions
+16
View File
@@ -0,0 +1,16 @@
#ifndef KERNEL_HEAP_H
#define KERNEL_HEAP_H
#include <stdint.h>
#include <stddef.h>
#define KHEAP_START 0xE0000000 // Start of kernel heap
#define KHEAP_INITIAL_SIZE 0x100000 // 1 MiB initial size
#define KHEAP_END (KHEAP_START + KHEAP_INITIAL_SIZE)
#define KHEAP_PAGES (KHEAP_INITIAL_SIZE / PAGE_SIZE)
void kheap_init();
void* kvalloc(size_t npages);
void kvfree(void* addr, size_t npages);
#endif