Load raw C binary + docs

This commit is contained in:
2026-05-08 12:38:16 +02:00
parent 9a1a0e428a
commit eb8a03facd
10 changed files with 169 additions and 50 deletions
+30
View File
@@ -0,0 +1,30 @@
#pragma once
// 3 because 3 arguments to the call, get it??
static inline long syscall3(long n, long a, long b, long c) {
long ret;
__asm__ volatile (
"int $0x80"
: "=a"(ret)
: "a"(n), "D"(a), "S"(b), "d"(c)
: "memory"
);
return ret;
}
static inline void write(int fd, const char* buf, long len) {
syscall3(1, fd, (long)buf, len);
}
static inline void exit(int code) {
__asm__ volatile (
"int $0x80"
:
: "a"(60), "D"(code)
: "memory"
);
for (;;);
}