Updated libc

This commit is contained in:
Alex
2022-12-07 13:53:08 +02:00
parent bc92258a5f
commit 2b57c3126a
28 changed files with 360 additions and 65 deletions

21
apps/base/echo/echo.cpp Normal file
View File

@ -0,0 +1,21 @@
static inline long syscall2(int sc, long arg1, long arg2)
{
long ret;
__asm__ __volatile__("syscall"
: "=a"(ret)
: "a"(sc), "D"(arg1), "S"(arg2)
: "rcx", "r11", "memory");
return ret;
}
int main(int argc, char *argv[])
{
// TODO: Change this to use stdout
for (int i = 1; i < argc; i++)
{
for (int j = 0; argv[i][j]; j++)
syscall2(1, argv[i][j], 0);
syscall2(1, ' ', 0);
}
return 0;
}