core: add physical allocator (not supposed to work but smh kinda does)

This commit is contained in:
2025-04-18 14:42:07 +02:00
parent 65f08e3887
commit 6c8c158a1f
12 changed files with 471 additions and 14 deletions

View File

@ -61,7 +61,8 @@ typedef struct Zone {
* For TINY and SMALL, the zone will be divided in blocks.
* For LARGE, it will be entire page(s).
*/
extern Zone *zones[3];
extern Zone *vzones[3];
extern Zone *kzones[3];
/*----------- UTILS ----------*/
block_type_t get_type(size_t size);
@ -71,6 +72,7 @@ size_t align_mem(size_t addr);
/*-------- ALLOCATOR ---------*/
int new_vzone(block_type_t type, size_t size);
int new_kzone(block_type_t type, size_t size);
/*----------------------------*/
void *vmalloc(size_t size);
@ -78,3 +80,8 @@ void vfree(void *ptr);
void *vrealloc(void *ptr, size_t size);
void show_valloc_mem(void);
size_t vsize(void *virt_addr);
void *kmalloc(size_t size);
void kfree(void *ptr);
void *krealloc(void *ptr, size_t size);
void show_kalloc_mem(void);
size_t ksize(void *phys_addr);