Phase 42
Async Executor
Learn how Async Executor fits into m3OS.
Learning goal
Understand Async Executor in m3OS.
Category
infrastructure
Components touched
Builds on
Unlocked by this phase
Why this phase matters
Learn how Async Executor fits into m3OS.
How it works in m3OS
The roadmap entry defines the learning scope for this phase; a deeper implementation doc has not been matched yet.
How it builds on earlier phases
This phase builds on Crypto Primitives and turns that foundation into Async Executor.
Implementation outline
- Implementation steps have not been extracted yet.
Task progress snapshot
0 of 94 tracked tasks are complete.
Documentation targets
- Documentation deliverables have not been listed yet.
Deferred follow-on work
- No deferred items were listed in the roadmap entry.
Source materials
- Roadmap entry not found.
- Task list
Important code
Code spotlight cards
Code spotlight
Add `PollFd` struct and `poll()` wrapper to syscall-lib
descriptors. Currently sshd inlines syscall3(SYS_POLL, ...) directly — a. Why it matters: The reactor needs poll() to block on multiple file. Focus on `PollFd` and `poll` in `userspace/syscall-lib/src/lib.rs` while you trace the snippet.
Code spotlight
Create async-rt crate skeleton
userspace daemon, not just sshd. The dual std/no_std feature flag pattern. Why it matters: A dedicated crate keeps the executor reusable by any. Focus on `async_rt` and `std` in `userspace/async-rt/Cargo.toml` while you trace the snippet.
[features]
default = ["std"]
std = ["libc"]
alloc = []
[dependencies]
syscall-lib = { path = "../syscall-lib" }
libc = { version = "0.2", optional = true }
[dev-dependencies]
libc = "0.2" Code spotlight
Test and implement Task struct with woken flag
waker.wake() when it has data ready, and the executor must know which task. Why it matters: The Waker is the core async primitive — sunset calls. Focus on `Task` and `task_waker` in `userspace/async-rt/src/task.rs` while you trace the snippet.
/// A single-threaded async task wrapping a future and its waker state.
///
/// This is a compatibility shim that wraps the new `TaskHeader`.
/// It will be removed when the executor is rewritten in Phase 2.
pub struct Task {
#[allow(dead_code)]
pub(crate) future: Pin<Box<dyn Future<Output = ()>>>,
pub(crate) header: Arc<TaskHeader>,
} Key files
How real OSes differ
Success criteria
Related phases
Keep exploring the roadmap
Phase 42
CompleteCrypto Primitives
The OS has a cryptography library providing hash functions, symmetric encryption, and asymmetric key operations. This is the foundation layer that SSH (Phase 43) and future security features build upon.
Phase 43
CompleteSSH Server
An SSH server runs inside the OS, providing encrypted remote shell access. Users can connect from any standard SSH client (`ssh user@host`) with password or public key authentication. This replaces the telnet server for untrusted networks and is a major milestone: the OS is now a secure, networked, multi-user system.