summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls/shutdown.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Syscalls/shutdown.cpp')
-rw-r--r--Kernel/Syscalls/shutdown.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Kernel/Syscalls/shutdown.cpp b/Kernel/Syscalls/shutdown.cpp
index 8a666b5249..22338483a6 100644
--- a/Kernel/Syscalls/shutdown.cpp
+++ b/Kernel/Syscalls/shutdown.cpp
@@ -8,6 +8,7 @@
#include <Kernel/FileSystem/FileSystem.h>
#include <Kernel/IO.h>
#include <Kernel/Process.h>
+#include <Kernel/TTY/ConsoleManagement.h>
namespace Kernel {
@@ -37,6 +38,7 @@ KResultOr<int> Process::sys$halt()
return EPERM;
REQUIRE_NO_PROMISES;
+ ConsoleManagement::the().switch_to_debug();
dbgln("acquiring FS locks...");
FS::lock_all();
@@ -50,8 +52,8 @@ KResultOr<int> Process::sys$halt()
// VirtualBox shutdown failed. Try Bochs/Old QEMU shutdown.
IO::out16(0xb004, 0x2000);
dbgln("shutdown attempts failed, applications will stop responding.");
-
- return 0;
+ dmesgln("Shutdown can't be completed. It's safe to turn off the computer!");
+ Processor::halt();
}
}