feat: added shutdown command

This commit is contained in:
2021-03-03 22:12:37 +01:00
parent c9102fbc65
commit 300e80c2e8
6 changed files with 71 additions and 25 deletions

15
kernel/util/power.c Normal file
View File

@@ -0,0 +1,15 @@
//
// Created by rick on 03-03-21.
//
#include <drivers/ports.h>
#include <attributes.h>
#include <libk/libk.h>
#include "power.h"
void noreturn power_shutdown() {
port_word_out(PORT_ACPI, PORT_ACPI_SHUTDOWN);
port_word_out(PORT_QEMU_COMMAND, PORT_QEMU_COMMAND_SHUTDOWN);
port_word_out(PORT_VBOX, PORT_VBOX_SHUTDOWN);
k_panics("Failed to shut down!\n");
}