Add interrupt-driven console I/O and Rust std userland support#27
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds interrupt-driven console input, thread parking and wake-up support, timer-based sleep, PLIC integration, and a Rust standard library port for userland applications.
Highlights
stdout-pathaliases and console option suffixescompatiblestring listLazyLockfor boot-time global initializationstdto the userland syscall ABIstddemo covering allocation, collections, file I/O, output, and sleepConcurrency and interrupt behavior
The scheduler now maintains separate ready and parked thread collections. Each thread owns a waker that records notifications before attempting to move the thread back to the ready queue.
This covers wake-ups occurring:
Console reads register their waker while holding the console lock, preventing a race between checking for available input and subscribing to the receive event.
Timer and external interrupt handlers wake parked threads and allow the scheduler to run newly ready work.
Device tree support
/chosen/stdout-pathserial0:115200n8through/aliasescompatiblestring listsRust standard library port
The Rust port reuses the pinned host compiler and builds the target standard library for the custom userland ABI.
Currently supported functionality includes:
dlmallocallocfunctionalitystd::thread::sleepOS thread creation and writable files remain unsupported.
Validation
cargo check: passed-D warnings: passedstduserland demo: passed