Skip to content

feat(shell): add reboot and poweroff commands - #115

Merged
im-nymii merged 3 commits into
Auri-OS:developfrom
kudasaixc:feat/reboot-poweroff
Jul 17, 2026
Merged

feat(shell): add reboot and poweroff commands#115
im-nymii merged 3 commits into
Auri-OS:developfrom
kudasaixc:feat/reboot-poweroff

Conversation

@kudasaixc

Copy link
Copy Markdown
Contributor

Adds two machine lifecycle commands. Until now the only way to leave the shell was crash, which just halts the CPU.

reboot waits for the 8042 input buffer to drain, then pulses the CPU reset line with outb(0x64, 0xFE).

poweroff triggers an ACPI shutdown through the ports QEMU (0x604) and older QEMU / Bochs (0xB004) expose, which cleanly powers the VM off.

Both fall back to a halt if the hardware action does not fire. Also adds a 16-bit outw helper to io.h for the ACPI writes.

Note: poweroff relies on the virtual ACPI device, so it powers off under QEMU/Bochs (their whole workflow); on real hardware a proper ACPI implementation would be needed, there it just halts.

Built and tested locally with the CI setup (Zig 0.16.0 + NASM, USE_ZIG path) in QEMU:

  • reboot: the boot banner (Starting AuriOS boot sequence) appears a second time, so the machine really reset.
  • poweroff: QEMU exits on its own about 4s after the command with stdin still open, so the ACPI shutdown fired (not just an EOF).

kudasaixc and others added 3 commits July 5, 2026 15:14
Adds two machine lifecycle commands. Until now the only way to leave
the shell was crash, which just halts.

- reboot waits for the 8042 input buffer to drain, then pulses the CPU
  reset line via outb(0x64, 0xFE).
- poweroff triggers an ACPI shutdown through the ports QEMU (0x604)
  and older QEMU / Bochs (0xB004) expose, which cleanly powers the VM
  off.

Adds a 16-bit outw helper to io.h for the ACPI writes. Both fall back
to a halt if the hardware action does not fire.
@im-nymii

Copy link
Copy Markdown
Member

LGTM after review

@im-nymii
im-nymii merged commit 8381db0 into Auri-OS:develop Jul 17, 2026
3 checks passed
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.

2 participants