Changed libc structure, shouldn't've added anything new

This commit is contained in:
2024-10-19 15:11:00 +02:00
parent e2e24d3853
commit 64b4e47d73
38 changed files with 264 additions and 276 deletions
+17
View File
@@ -0,0 +1,17 @@
#include <syscall.h>
#include <stdio.h>
void putc(char c) {
// write(stdout, &c, 1); TODO: This doesn't work and we need to use a static variable
static char _c;
_c = c;
write(1, &_c, 1);
}
char getc() {
char* c = (char*)0x2100; // TODO: Don't use a random looking memory address -_('-')_-
*c= '\0';
while (*c == '\0') { __asm__ volatile ("hlt"); }
return *c;
}