Skip to content

userlib: Add halt() helper, detect this in the host kernel - #2780

Merged
jamesmunns merged 6 commits into
masterfrom
james/host-detect-dead
Nov 12, 2026
Merged

jamesmunns merged 6 commits into
masterfrom
james/host-detect-dead

Conversation

@jamesmunns

Copy link
Copy Markdown
Contributor

This formalizes the "I'm dead and don't restart me" behavior used in various places in the code by adding a userlib::hl helper for it.

We also can now detect this on host runs, halting the host system if something fatal has occurred. Also adds a flag to opt-out of this new behavior if you are testing something that SHOULD do that.

Stacked on top of #2778 and #2779.

This tweaks the jefe task to allow for host builds, and adds it to the
demo app. Ping/Pong actually works as expected now.
Previously, there were some annoying `Eof:` errors printed by tasks
when the kernel stopped. This PR adds some in-band signaling to allow
the kernel to tell tasks it's time to shut down.
This formalizes the "I'm dead and don't restart me" behavior used
in various places in the code by adding a `userlib::hl` helper for
it.

We also can now detect this on host runs, halting the host system if
something fatal has occurred. Also adds a flag to opt-out of this
new behavior if you are testing something that SHOULD do that.
@jamesmunns
jamesmunns force-pushed the james/host-detect-dead branch from 9440277 to fd2be56 Compare November 11, 2026 14:50

@labbott labbott left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love fn halt as a name for nebulous reasons but I also don't actually have serious objections or a better name (we can see if anyone else does?)

Base automatically changed from james/host-shutdown to master November 11, 2026 15:16
@jamesmunns
jamesmunns merged commit 469f5a5 into master Nov 12, 2026
179 checks passed
@jamesmunns
jamesmunns deleted the james/host-detect-dead branch November 12, 2026 09:58
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