summaryrefslogtreecommitdiff
path: root/src/init/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/init/main.c')
-rw-r--r--src/init/main.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/init/main.c b/src/init/main.c
index 71a2d4e..ec6d5be 100644
--- a/src/init/main.c
+++ b/src/init/main.c
@@ -85,9 +85,22 @@ void fs_test(void) {
void test_await(void) {
int ret;
+ // regular exit()s
if (!_syscall_fork()) _syscall_exit(69);
if (!_syscall_fork()) _syscall_exit(420);
+ // faults
+ if (!_syscall_fork()) { // invalid memory access
+ asm volatile("movb $69, 0" ::: "memory");
+ log("this shouldn't happen");
+ _syscall_exit(-1);
+ }
+ if (!_syscall_fork()) { // #GP
+ asm volatile("hlt" ::: "memory");
+ log("this shouldn't happen");
+ _syscall_exit(-1);
+ }
+
while ((ret = _syscall_await()) != ~0) {
log("await returned: ");
//_syscall_write(tty_fd, buf, len, 0); TODO printf