mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
a27c9e3e01
Rolling with the theme of adding a dialog to shutdown the machine, it is probably nice to have a way to reboot the machine without performing a full system powerdown. A reboot program has been added to `/bin/` as well as a corresponding `syscall` (SC_reboot). This syscall works by attempting to pulse the 8042 keyboard controller. Note that this is NOT supported on new machines, and should only be a fallback until we have proper ACPI support. The implementation causes a triple fault in QEMU, which then restarts the system. The filesystems are locked and synchronized before this occurs, so there shouldn't be any corruption etctera.
15 lines
157 B
C++
15 lines
157 B
C++
#include <stdio.h>
|
|
#include <unistd.h>
|
|
|
|
|
|
int main(int, char**)
|
|
{
|
|
if (reboot() < 0){
|
|
perror("reboot");
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
|