mirror of
https://github.com/Fennix-Project/Userspace.git
synced 2025-05-25 22:14:28 +00:00
Update echo program
This commit is contained in:
parent
850415b559
commit
2523ad0911
@ -56,7 +56,7 @@ endif
|
||||
|
||||
build: $(FILENAME)
|
||||
$(OBJDUMP) -d $(FILENAME) > file_dump.map
|
||||
mv $(FILENAME) ../../../out/system/$(FILENAME)
|
||||
mv $(FILENAME) ../../../out/system/bin/$(FILENAME)
|
||||
|
||||
$(FILENAME): $(OBJ)
|
||||
$(info Linking $@)
|
||||
|
@ -1,21 +1,11 @@
|
||||
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;
|
||||
}
|
||||
#include <stdio.h>
|
||||
|
||||
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);
|
||||
printf("%s ", argv[i]);
|
||||
}
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user