uefi-async
A lightweight, zero-cost asynchronous executor designed specifically for UEFI environments or bare-metal Rust. It provides a simple task scheduler based on a intrusive linked-list and a procedural macro to simplify task registration.
WIP
currently only nano_alloc feature is supported.
Features
- No-Std Compatible: Designed for environments without a standard library (only requires
alloc). - Intrusive Linked-List: No additional collection overhead for managing tasks.
- Frequency-Based Scheduling: Define tasks to run at specific frequencies (Hz), automatically converted to hardware ticks.
- Macro-Driven Syntax: A clean, declarative DSL to assign tasks to executors.
Architecture
The project consists of two main components:
- The Executor: A round-robin scheduler that polls
TaskNodes based on timing requirements. - The Task Macro: A procedural macro that handles the boilerplate of pinning futures and registering them to executors.
Installation
Add this to your Cargo.toml:
[]
= "*"
Usage
1. Define your tasks
Tasks are standard Rust async functions or closures.
2. Initialize and Run
Use the add! macro to set up your executor.
extern crate alloc;
use Box;
use ;
async
async
extern "efiapi"
or more advanced usage:
extern crate alloc;
use ;
use tick;
async
async
async
extern "efiapi"
Why use uefi-async?
In UEFI development, managing multiple periodic tasks (like polling keyboard input while updating a UI or handling network packets) manually can lead to "spaghetti code." uefi-async allows you to write clean, linear async/await code while the executor ensures that timing constraints are met without a heavy OS-like scheduler.
License
This project is licensed under the MIT License or Apache-2.0. (temporary)