summaryrefslogtreecommitdiff
path: root/src/init/main.c
blob: 84475da0f182add1f6cdad4880ae9674cbaf1e9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <kernel/syscalls.h>
#include <stddef.h>
#include <stdint.h>

int _syscall(int, int, int, int);

void exit(const char *msg, size_t len) {
	_syscall(SC_EXIT, (void*)msg, len, 0);
	__builtin_unreachable();
}

int debuglog(const char *msg, size_t len) {
	return _syscall(SC_DEBUGLOG, (void*)msg, len, 0);
}


int main() {
	debuglog("hello from init! ",
	  sizeof("hello from init! ") - 1);

	exit(    "bye from init! ",
	  sizeof("bye from init! ") - 1);
}