Wrote a new stdio.h, Implemented fcntl.h

This commit is contained in:
2024-10-25 12:32:22 +02:00
parent fe2dac1361
commit bd7e00e7e8
6 changed files with 76 additions and 252 deletions
-17
View File
@@ -1,17 +0,0 @@
#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;
}