Stop a pending reset outliving the reset it belonged to

Reset out of picture.bin and CosmOS booted and then halted at once, having been told there
was nobody at the keyboard.

The button set two things: the machine's reset request, and a flag of the window's own that
said "end the next console read, so a machine blocked on a key can get to the point where it
notices". The second was only cleared when the console actually asked - and picture.bin never
asks. It draws and halts. So the flag survived the restart and answered the NEXT machine's
first read with the end of input, which for CosmOS means stop.

There is one fact and it now lives in one place. The window asks whether a reset is still
waiting rather than remembering that it asked for one, so the read ends only while a restart
is genuinely on its way and goes back to normal the moment it has happened. The local flag is
gone.

Two pieces of state meaning one thing, one of them cleared on a path the other did not need -
which is the same shape as the console's line editing flag surviving a second run, a fortnight
ago. Worth noticing twice.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW
This commit is contained in:
Anachronaut
2026-08-29 14:59:15 -04:00
co-authored by Claude Opus 5
parent adefce975b
commit f2e26c1852
3 changed files with 15 additions and 7 deletions
+4
View File
@@ -306,6 +306,10 @@ void serviceDevices(void);
// the instruction that asked - the CPU is mid-step and its state is not yet consistent.
int takeResetRequest(void);
// Whether one is waiting, without taking it. For anything that has to behave differently
// while a restart is on its way but is not the thing that performs it.
int resetIsPending(void);
// ---- The button on the front of the case ----
//
// A machine has one, and a window is the case. Writing MACHINE_RESET is how a PROGRAM asks;