Update echo program

This commit is contained in:
Alex 2023-05-03 06:38:49 +03:00
parent 850415b559
commit 2523ad0911
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD
2 changed files with 4 additions and 14 deletions

View File

@ -56,7 +56,7 @@ endif
build: $(FILENAME) build: $(FILENAME)
$(OBJDUMP) -d $(FILENAME) > file_dump.map $(OBJDUMP) -d $(FILENAME) > file_dump.map
mv $(FILENAME) ../../../out/system/$(FILENAME) mv $(FILENAME) ../../../out/system/bin/$(FILENAME)
$(FILENAME): $(OBJ) $(FILENAME): $(OBJ)
$(info Linking $@) $(info Linking $@)

View File

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