aboutsummaryrefslogtreecommitdiff
path: root/kernel/features
diff options
context:
space:
mode:
authorMarvin Borner2021-03-13 00:38:36 +0100
committerMarvin Borner2021-03-13 00:40:23 +0100
commit606774e6b0e0a2d36139983b85c8675b2228a9ff (patch)
tree72a8ba13668ac0a91ac3871b08c1882ce43f7580 /kernel/features
parente8f17844d05fdc0e44d3793dc73996c7c09e44d6 (diff)
Fixed test suite
Diffstat (limited to 'kernel/features')
-rw-r--r--kernel/features/syscall.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/kernel/features/syscall.c b/kernel/features/syscall.c
index 486da6c..31cdf5f 100644
--- a/kernel/features/syscall.c
+++ b/kernel/features/syscall.c
@@ -86,9 +86,32 @@ static void syscall_handler(struct regs *r)
break;
}
case SYS_EXIT: {
+ print("EXIT!\n");
proc_exit(proc_current(), (int)r->ebx);
break;
}
+ case SYS_BOOT: { // TODO: Move
+ if (r->ebx != SYS_BOOT_MAGIC || !proc_super()) {
+ r->eax = -1;
+ break;
+ }
+ switch (r->ecx) {
+ case SYS_BOOT_REBOOT:
+ print("Rebooting...\n");
+ __asm__ volatile("ud2");
+ break;
+ case SYS_BOOT_SHUTDOWN:
+ print("Shutting down...\n");
+ outw(0xB004, 0x2000);
+ outw(0x604, 0x2000);
+ outw(0x4004, 0x3400);
+ __asm__ volatile("ud2");
+ break;
+ default:
+ r->eax = -1;
+ }
+ break;
+ }
case SYS_YIELD: {
proc_yield(r);
break;
@@ -130,7 +153,7 @@ static void syscall_handler(struct regs *r)
break;
}
default: {
- print("Unknown syscall!\n");
+ printf("Unknown syscall %d!\n", num);
break;
}
}