Expand description
§patina_tianocore
A bridge crate that lets UEFI drivers target TianoCore and Patina through a single API surface — write once, run on either.
§The Problem
Today the OEM migration path requires two steps:
- Port a C UEFI driver to Rust targeting raw TianoCore (
r-efi). - Rewrite that Rust driver again to use Patina’s component/service model.
§The Solution
Define your platform once via the Platform trait:
ⓘ
use patina_tianocore::prelude::*;
pub struct OemPlatform;
impl Platform for OemPlatform {
fn components(add: &mut impl ComponentAdder) {
add.component(SmbiosProvider::new(3, 9));
add.component(MyCustomDriver::default());
}
fn configs(add: &mut impl ConfigAdder) {
add.config(42u32);
}
}This single impl drives both runtimes:
-
TianoCore today:
ⓘpatina_tianocore::driver_entry!(platform: OemPlatform); -
Patina native later (in
patina-dxe-core-oem):ⓘpatina_tianocore::impl_component_info!(OemPlatform); // That's it — ComponentInfo is auto-generated from Platform. // Then add the platform-specific traits: impl PlatformInfo for OemPlatform { /* MemoryInfo, CpuInfo, Extractor */ }
The component structs, services, configs — everything inside the Platform
methods — transfers with zero changes.
§Feature Flags
| Feature | Description |
|---|---|
tianocore | (default) Back all abstractions with TianoCore / r-efi. The only currently implemented runtime. |
A patina-native feature for the Patina-native runtime will be added when
the corresponding code paths land.
Re-exports§
pub use context::DriverContext;pub use context::DriverResult;pub use platform::ComponentAdder;pub use platform::ConfigAdder;pub use platform::Platform;pub use platform::ServiceAdder;
Modules§
- boot_
services - Re-export and helpers for boot services.
- context
- Driver context — the single entry point for accessing platform services.
- entry
- Entry-point macro for TianoCore DXE drivers.
- logger
- Minimal UEFI logger that routes
logoutput to ConOut and serial. - memory
- TianoCore-backed
MemoryManagerimplementation. - platform
- Write-once platform registration that works on TianoCore and Patina native.
- prelude
- Glob-importable bridge-crate types.
Macros§
- driver_
entry - Generates the TianoCore
efi_mainentry point, global allocator, and panic handler. - impl_
component_ info - Generates a
patina_dxe_core::ComponentInfoimpl that delegates to yourPlatformimpl.