feat(app): nolibc hello world

This commit is contained in:
2026-04-20 16:00:17 +02:00
parent d829209488
commit d5be4cfe0b
5 changed files with 103 additions and 1 deletions

18
app/nolibc.c Normal file
View File

@@ -0,0 +1,18 @@
void *syscall5(void *number, void *arg1, void *arg2, void *arg3, void *arg4,
void *arg5);
typedef unsigned long int size_t;
typedef long int ssize_t;
static ssize_t write(int fd, void const *data, size_t nbytes) {
return (ssize_t)syscall5((void *)1, /* SYS_write, call number 1 */
(void *)(size_t)fd, (void *)data, (void *)nbytes,
0, /* Ignored */
0 /* Ignored */
);
}
int main() {
write(0, "Hello World!\n", 13);
return 0;
}