forked from PoliEcho-holding-org/kern
MAJOR RESTRUCTURE
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
#include <syscalls/syscalls.h>
|
||||
#include <memory/malloc.h>
|
||||
#include <cpu/isr.h>
|
||||
#include <stddef.h>
|
||||
|
||||
int sys_malloc(intFrame_t* iframe) {
|
||||
size_t count = iframe->ebx;
|
||||
|
||||
// First Malloc()
|
||||
if (!mallocListHead) {
|
||||
mallocInit(count); // Setup malloc linked list
|
||||
}
|
||||
|
||||
void* ptr = mallocNextNode(count);
|
||||
mallocMergeFree();
|
||||
|
||||
return (size_t)ptr;
|
||||
}
|
||||
Reference in New Issue
Block a user