mirror of
https://github.com/RGBCube/serenity
synced 2025-07-16 21:57:38 +00:00
Kernel: Add shutdown commands for other virtualizers
Source: https://wiki.osdev.org/Shutdown
This commit is contained in:
parent
1a0c11cea2
commit
453affb101
1 changed files with 6 additions and 0 deletions
|
@ -63,7 +63,13 @@ int Process::sys$halt()
|
||||||
dbg() << "syncing mounted filesystems...";
|
dbg() << "syncing mounted filesystems...";
|
||||||
FS::sync();
|
FS::sync();
|
||||||
dbg() << "attempting system shutdown...";
|
dbg() << "attempting system shutdown...";
|
||||||
|
// QEMU Shutdown
|
||||||
IO::out16(0x604, 0x2000);
|
IO::out16(0x604, 0x2000);
|
||||||
|
// If we're here, the shutdown failed. Try VirtualBox shutdown.
|
||||||
|
IO::out16(0x4004, 0x3400);
|
||||||
|
// VirtualBox shutdown failed. Try Bochs/Old QEMU shutdown.
|
||||||
|
IO::out16(0xb004, 0x2000);
|
||||||
|
dbg() << "shutdown attempts failed, applications will stop responding.";
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue