20 lines
596 B
C++
20 lines
596 B
C++
#define MODULE "power"
|
|
|
|
#include "misc/shutdown.h"
|
|
#include "interrupts/Interrupts.h"
|
|
#include "io/IO.h"
|
|
#include "log/Log.h"
|
|
#include "misc/hang.h"
|
|
|
|
[[noreturn]] void shutdown()
|
|
{
|
|
Interrupts::disable();
|
|
kinfoln("Attempting shutdown using the Bochs method");
|
|
IO::outw(0xB004, 0x2000);
|
|
kinfoln("Attempting shutdown using the QEMU method");
|
|
IO::outw(0x604, 0x2000);
|
|
kinfoln("Attempting shutdown using the VirtualBox method");
|
|
IO::outw(0x4004, 0x3400);
|
|
kerrorln("Failed to shutdown, halting. It is now safe to turn off your computer manually, though.");
|
|
hang();
|
|
} |