summaryrefslogtreecommitdiffstats
path: root/rsdos/src
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-07-31 16:01:46 +0200
committersalmonik <salmonik@tuta.io>2026-07-31 16:01:46 +0200
commitba667148af04963f5d70c647511ea1fad1add21d (patch)
tree06f8faf9128d4d1fc48bbe90b5f50cf65a2e9022 /rsdos/src
parentdocs: CONTEXT.md — paging adoption, heap growth, shell additions (diff)
downloadrs-dos-ba667148af04963f5d70c647511ea1fad1add21d.tar.gz
rs-dos-ba667148af04963f5d70c647511ea1fad1add21d.zip
power: proper shutdown via UEFI ResetSystem (ACPI S5)
- uefi.rs: full EFI_RUNTIME_SERVICES layout with reset_system at index 10 (spec order); EfiResetSystem type + RESET_* constants - power.rs: stash the runtime-services table pre-EBS; poweroff() calls ResetSystem(EfiResetShutdown) — still callable after ExitBootServices because we never call SetVirtualAddressMap, so the pointers keep working with physical addresses; falls back to the hlt loop - shell: 'poweroff' and 'exit' shut the machine down (QEMU exits), 'halt' keeps the plain hlt loop
Diffstat (limited to 'rsdos/src')
-rw-r--r--rsdos/src/main.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/rsdos/src/main.rs b/rsdos/src/main.rs
index 1169785..d9578e2 100644
--- a/rsdos/src/main.rs
+++ b/rsdos/src/main.rs
@@ -37,6 +37,9 @@ pub extern "efiapi" fn efi_main(image_handle: Handle, system_table: *mut SystemT
37 let bs = unsafe { &mut *st.boot_services }; 37 let bs = unsafe { &mut *st.boot_services };
38 let con_out = unsafe { &mut *st.con_out }; 38 let con_out = unsafe { &mut *st.con_out };
39 39
40 // Keep the runtime-services table for later (ResetSystem → poweroff).
41 rsnix::power::init(st.runtime_services);
42
40 // ---- Phase 1: UEFI boot services alive ---- 43 // ---- Phase 1: UEFI boot services alive ----
41 44
42 // Print banner via UEFI console 45 // Print banner via UEFI console