feat: disconnect Bluetooth devices, flush disks on shutdown/reboot, display progress in login.elf window

This commit is contained in:
2026-06-06 18:27:19 +02:00
parent b51ab42eb9
commit cee21738ee
24 changed files with 418 additions and 12 deletions
+14
View File
@@ -369,6 +369,15 @@ namespace montauk {
return (int)syscall0(Montauk::SYS_SUSPEND);
}
// Graceful power-off request channel. The desktop posts a pending action
// (Montauk::POWER_REQ_SHUTDOWN / POWER_REQ_REBOOT) then exits; login.elf
// reads it with POWER_REQ_QUERY (read-and-clear), runs the shutdown stages,
// and finally calls shutdown()/reset(). Returns the pending action for a
// query, or 0 when posting one.
inline int power_request(int action) {
return (int)syscall1(Montauk::SYS_POWER_REQUEST, (uint64_t)(int64_t)action);
}
// Mouse
inline void mouse_state(Montauk::MouseState* out) { syscall1(Montauk::SYS_MOUSESTATE, (uint64_t)out); }
inline void set_mouse_bounds(int32_t maxX, int32_t maxY) {
@@ -436,6 +445,11 @@ namespace montauk {
inline int fs_mount(int partIndex, int driveNum) {
return (int)syscall2(Montauk::SYS_FSMOUNT, (uint64_t)partIndex, (uint64_t)driveNum);
}
// Flush all block-device write caches and cleanly unmount disk-backed
// volumes ahead of power-off. Returns the number of volumes unmounted.
inline int fs_sync() {
return (int)syscall0(Montauk::SYS_FS_SYNC);
}
inline int fs_format(const Montauk::FsFormatParams* params) {
return (int)syscall1(Montauk::SYS_FSFORMAT, (uint64_t)params);
}