printf thing
This commit is contained in:
parent
2374905355
commit
31d90032c7
@ -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;
|
||||
}
|
26
sys/memory.c
26
sys/memory.c
@ -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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user