summaryrefslogtreecommitdiff
path: root/Kernel/Arch
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Arch')
-rw-r--r--Kernel/Arch/x86/common/I8042Reboot.cpp19
-rw-r--r--Kernel/Arch/x86/common/I8042Reboot.h (renamed from Kernel/Arch/x86/common/QEMUShutdown.h)2
-rw-r--r--Kernel/Arch/x86/common/Shutdown.cpp (renamed from Kernel/Arch/x86/common/QEMUShutdown.cpp)7
-rw-r--r--Kernel/Arch/x86/common/Shutdown.h14
4 files changed, 40 insertions, 2 deletions
diff --git a/Kernel/Arch/x86/common/I8042Reboot.cpp b/Kernel/Arch/x86/common/I8042Reboot.cpp
new file mode 100644
index 0000000000..2eaf0a0df7
--- /dev/null
+++ b/Kernel/Arch/x86/common/I8042Reboot.cpp
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2022, Liav A. <liavalb@hotmail.co.il>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#include <AK/Format.h>
+#include <Kernel/Arch/x86/IO.h>
+#include <Kernel/Arch/x86/common/I8042Reboot.h>
+
+namespace Kernel {
+
+void i8042_reboot()
+{
+ dbgln("attempting reboot via KB Controller...");
+ IO::out8(0x64, 0xFE);
+}
+
+}
diff --git a/Kernel/Arch/x86/common/QEMUShutdown.h b/Kernel/Arch/x86/common/I8042Reboot.h
index 18634ff622..9c457a0f1a 100644
--- a/Kernel/Arch/x86/common/QEMUShutdown.h
+++ b/Kernel/Arch/x86/common/I8042Reboot.h
@@ -8,6 +8,6 @@
namespace Kernel {
-void qemu_shutdown();
+void i8042_reboot();
}
diff --git a/Kernel/Arch/x86/common/QEMUShutdown.cpp b/Kernel/Arch/x86/common/Shutdown.cpp
index 0c3149dff5..948f720981 100644
--- a/Kernel/Arch/x86/common/QEMUShutdown.cpp
+++ b/Kernel/Arch/x86/common/Shutdown.cpp
@@ -5,7 +5,7 @@
*/
#include <Kernel/Arch/x86/IO.h>
-#include <Kernel/Arch/x86/common/QEMUShutdown.h>
+#include <Kernel/Arch/x86/common/Shutdown.h>
namespace Kernel {
@@ -18,4 +18,9 @@ void qemu_shutdown()
IO::out16(0xb004, 0x2000);
}
+void virtualbox_shutdown()
+{
+ IO::out16(0x4004, 0x3400);
+}
+
}
diff --git a/Kernel/Arch/x86/common/Shutdown.h b/Kernel/Arch/x86/common/Shutdown.h
new file mode 100644
index 0000000000..90a742176e
--- /dev/null
+++ b/Kernel/Arch/x86/common/Shutdown.h
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2022, Liav A. <liavalb@hotmail.co.il>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#pragma once
+
+namespace Kernel {
+
+void qemu_shutdown();
+void virtualbox_shutdown();
+
+}