From e6f333ae001023224ee887b4c00ef39348b6a436 Mon Sep 17 00:00:00 2001 From: Liav A Date: Mon, 17 May 2021 01:57:34 +0300 Subject: Kernel: Print failed attempt to shutdown the machine Because we don't parse ACPI AML yet, If we are not able to shut down the machine with "hacky" emulation methods - halt and print this state to the users so they know they can shutdown the machine by themselves. --- Kernel/Syscalls/shutdown.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Kernel/Syscalls/shutdown.cpp') 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 #include #include +#include namespace Kernel { @@ -37,6 +38,7 @@ KResultOr 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 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(); } } -- cgit v1.2.3