This code works, and prints "Hello, world0" to the screen.
Code: Select all
void _start() {
syscall3(SYSCALL_CONSOLE, CONSOLE_PUTS, "Hello, world0\n");
//internal_puts("Hello, world 234");
syscall2(SYSCALL_EXIT, 0);
}
Code: Select all
void _start() {
syscall3(SYSCALL_CONSOLE, CONSOLE_PUTS, "Hello, world0\n");
internal_puts("Hello, world 234");
syscall2(SYSCALL_EXIT, 0);
}
"./kos-gcc -o helloworld helloworld.c -Llibc -lc"
kos-gcc is a script file:
Code: Select all
#!/bin/sh
CFLAGS="-m32 -I libc/include -nostdlib -fno-builtin -fno-stack-protector -nostartfiles -nodefaultlibs"
gcc $CFLAGS $@ -Llibc -lc