Initial commit. We have a booting kernel
This commit is contained in:
9
libc/stdio/printf.c
Normal file
9
libc/stdio/printf.c
Normal 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
15
libc/stdio/putchar.c
Normal 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
6
libc/stdio/puts.c
Normal file
@@ -0,0 +1,6 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int puts(const char* str)
|
||||
{
|
||||
return printf("%s\n", str);
|
||||
}
|
||||
Reference in New Issue
Block a user