Skip to content

feat(syscall): implemented the reboot syscall with shutdown and reboot commands - #180

Merged
FlareCoding merged 2 commits into
masterfrom
pr/power-syscall
Aug 28, 2026
Merged

feat(syscall): implemented the reboot syscall with shutdown and reboot commands#180
FlareCoding merged 2 commits into
masterfrom
pr/power-syscall

Conversation

@FlareCoding

@FlareCoding FlareCoding commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Note

Medium Risk
Exposes kernel power control to any caller that passes the standard Linux magic values, with no additional privilege gate visible in the new handler.

Overview
Adds the Linux reboot(2) syscall on both aarch64 and x86_64 (arch-specific syscall numbers) and wires it into the syscall table via a new sys_power handler.

The handler enforces Linux’s magic1/magic2 checks before acting on restart, power off, or halt commands—calling power::reboot() / power::shutdown() or entering an IRQ-off halt loop—and returns EOPNOTSUPP when restart/shutdown cannot complete on the platform.

Userland gains reboot and shutdown CLI utilities that invoke reboot(RB_AUTOBOOT), RB_POWER_OFF, and a halt fallback, and both apps are included in the applications build list.

Reviewed by Cursor Bugbot for commit c1bca21. Bugbot is set up for automated code reviews on this repo. Configure here.

@FlareCoding FlareCoding changed the title feat(syscall): exposed shutdown and reboot to userland feat(syscall): implemented the reboot syscall with shutdown and reboot commands Aug 28, 2026
cursor[bot]

This comment was marked as resolved.

@FlareCoding
FlareCoding merged commit b785a11 into master Aug 28, 2026
26 of 28 checks passed
@FlareCoding
FlareCoding deleted the pr/power-syscall branch August 28, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant