diff --git a/kernel/sys/syscall.c b/kernel/sys/syscall.c index 2728d825..4613468b 100644 --- a/kernel/sys/syscall.c +++ b/kernel/sys/syscall.c @@ -388,13 +388,17 @@ static void inspect_memory (uintptr_t vaddr) { } */ +extern void ext2_disk_sync(); + static int reboot() { debug_print(NOTICE, "[kernel] Reboot requested from process %d by user #%d", current_process->id, current_process->user); if (current_process->user != USER_ROOT_UID) { return -1; } else { debug_print(NOTICE, "[kernel] Good bye!"); + ext2_disk_sync(); /* Goodbye, cruel world */ + IRQ_OFF; uint8_t out = 0x02; while ((out & 0x02) != 0) { out = inportb(0x64); @@ -495,8 +499,6 @@ static int yield() { return 1; } -extern void ext2_disk_sync(); - /* * System Function */