Newer
Older
tree-os / src / kernel / lib / memory / alloc.c
@lukas lukas on 2 Apr 2021 320 bytes add basic tasking
#include <lib/memory/alloc.h>
#include <stdint.h>
#include <lib/textMode/stdio.h>

uint32_t currentPosition;

void initMemoryAllocation(uint32_t kernelEnd) {
    currentPosition = kernelEnd;
}

void* malloc(uint32_t size) {
    uint32_t result = currentPosition;
    currentPosition += size;
    return (void*) result;
}