summaryrefslogtreecommitdiff
path: root/Kernel/Arch/x86/common/Shutdown.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Arch/x86/common/Shutdown.cpp')
-rw-r--r--Kernel/Arch/x86/common/Shutdown.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/Kernel/Arch/x86/common/Shutdown.cpp b/Kernel/Arch/x86/common/Shutdown.cpp
new file mode 100644
index 0000000000..948f720981
--- /dev/null
+++ b/Kernel/Arch/x86/common/Shutdown.cpp
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2022, Liav A. <liavalb@hotmail.co.il>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#include <Kernel/Arch/x86/IO.h>
+#include <Kernel/Arch/x86/common/Shutdown.h>
+
+namespace Kernel {
+
+void qemu_shutdown()
+{
+ // Note: This will invoke QEMU Shutdown, but for other platforms (or emulators),
+ // this has no effect on the system.
+ // We also try the Bochs/Old QEMU shutdown method, if the first didn't work.
+ IO::out16(0x604, 0x2000);
+ IO::out16(0xb004, 0x2000);
+}
+
+void virtualbox_shutdown()
+{
+ IO::out16(0x4004, 0x3400);
+}
+
+}