separating: there will be libk and libc

This commit is contained in:
2025-01-07 15:23:14 +01:00
parent b3687d20ee
commit a8582ba343
32 changed files with 29 additions and 31 deletions

25
kernel/kheap.h Normal file
View File

@@ -0,0 +1,25 @@
// Kernel heap management header
// Author: xamidev
// Licensed under the Unlicense. See the repo below.
// https://github.com/xamidev/blankos
#ifndef KHEAP_H
#define KHEAP_H
#include <stdint.h>
#include "system.h"
typedef struct block
{
size_t size;
struct block* next;
} block_t;
#define HEAP_SIZE 1024*1024 // 1MB malloc-able
void init_alloc();
void* malloc(size_t size);
void free(void* ptr);
void* calloc(size_t num, size_t size);
#endif