Skip to main content

Crate patina_tianocore

Crate patina_tianocore 

Source
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:

  1. Port a C UEFI driver to Rust targeting raw TianoCore (r-efi).
  2. 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

FeatureDescription
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 log output to ConOut and serial.
memory
TianoCore-backed MemoryManager implementation.
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_main entry point, global allocator, and panic handler.
impl_component_info
Generates a patina_dxe_core::ComponentInfo impl that delegates to your Platform impl.