mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 01:51:03 +09:00
Kernel+Userland: Addd reboot syscall (#334)
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.
This commit is contained in:
parent
23d45532fc
commit
a27c9e3e01
Notes:
sideshowbarker
2024-07-19 13:10:28 +09:00
Author: https://github.com/Quaker762
Commit: a27c9e3e01
Pull-request: https://github.com/SerenityOS/serenity/pull/334
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/rburchell
7 changed files with 45 additions and 2 deletions
|
@ -293,6 +293,9 @@ static u32 handle(RegisterDump& regs, u32 function, u32 arg1, u32 arg2, u32 arg3
|
|||
IO::out16(0x604, 0x2000);
|
||||
break;
|
||||
}
|
||||
case Syscall::SC_reboot: {
|
||||
return current->process().sys$reboot();
|
||||
}
|
||||
default:
|
||||
kprintf("<%u> int0x82: Unknown function %u requested {%x, %x, %x}\n", current->process().pid(), function, arg1, arg2, arg3);
|
||||
return -ENOSYS;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue