Initial commit. We have a booting kernel

This commit is contained in:
Bananymous
2022-11-12 21:04:47 +02:00
commit e6b4866ab0
36 changed files with 691 additions and 0 deletions

9
libc/stdio/printf.c Normal file
View File

@@ -0,0 +1,9 @@
#include <stdio.h>
int printf(const char* restrict fmt, ...)
{
int len = 0;
while (fmt[len])
putchar(fmt[len++]);
return len;
}

15
libc/stdio/putchar.c Normal file
View File

@@ -0,0 +1,15 @@
#include <stdio.h>
#if defined(__is_libk)
#include <kernel/tty.h>
#endif
int putchar(int c)
{
#if defined(__is_libk)
char ch = (char)c;
terminal_write(&ch, sizeof(ch));
#else
#endif
return c;
}

6
libc/stdio/puts.c Normal file
View File

@@ -0,0 +1,6 @@
#include <stdio.h>
int puts(const char* str)
{
return printf("%s\n", str);
}