printf thing

This commit is contained in:
MonkeyGG2 2024-02-18 09:14:47 -05:00
parent 2374905355
commit 31d90032c7
2 changed files with 15 additions and 19 deletions

View File

@ -9,3 +9,11 @@ strlen(const char *str)
return i;
}
printf(const char *format, ...)
{
const u32 len = strlen(format);
vga_write(format, len, 0x0f);
return len;
}

View File

@ -1,22 +1,10 @@
#include <memory.h>
#include <types.h>
void *
malloc(s32 size)
{
s32 actual_size = size + sizeof(s32) + sizeof(void *);
u32 curr = START;
if (start == NULL) {
start = (void *) START;
start[0] = '\0';
start[1] = '\0';
start[2] = '\0';
start[3] = '\0';
SIZE(m) = size;
return USABLE(m);
}
/* TODO */
}
void *malloc(s32 size) {
u32 addr = curr;
curr += size;
return (void*)addr;
}