Skip to content

Add ODP_PatinaSmbiosDemo driver#90

Merged
kat-perez merged 1 commit into
OpenDevicePartnership:mainfrom
kat-perez:odp-patina-smbios-demo
May 12, 2026
Merged

Add ODP_PatinaSmbiosDemo driver#90
kat-perez merged 1 commit into
OpenDevicePartnership:mainfrom
kat-perez:odp-patina-smbios-demo

Conversation

@kat-perez
Copy link
Copy Markdown
Contributor

Re-opens the work from #82 (which was inadvertently closed; GitHub blocks reopen because the original head repo lost its fork relationship with upstream). Rebased onto current main, and addresses @rogurr's review feedback on #82 (SPDX header added to source files).

Description

Adds ODP_PatinaSmbiosDemo — a UEFI DXE driver under uefi/OdpPkg/Drivers/ that publishes an SMBIOS Type 0 (BIOS Information) record using only the native Patina component model: no EFI_SMBIOS_PROTOCOL, no raw buffer construction, no unsafe boilerplate inside the publishing component.

The driver mirrors ODP_RustDxeDemo's file layout (Cargo.toml, README.md, .depex, src/) but consumes the Patina component model via the patina_tianocore bridge crate (= "0.1" from crates.io).

  • Impacts functionality? — adds new driver
  • Impacts security?
  • Breaking change?
  • Includes tests? — runtime-verified on QEMU OVMF Q35; no unit tests
  • Includes documentation? — README + crate-level docs

How This Was Tested

BUILD_DATE=$(date +%m/%d/%Y) cargo build --target x86_64-unknown-uefi --release produces a PE32+ .efi.

Booted on QEMU + TianoCore OVMF Q35 (/usr/share/OVMF/OVMF_CODE_4M.fd):

BdsDxe: starting Boot0001 ... Sata(0x0,0xFFFF,0x0)
[INFO ] BiosInfoSmbiosPublisher: added Type 0 BIOS info
        (vendor=Acme Inc., version=0.1.0, date=05/07/2026) handle=0x0001

The dispatcher resolves Service<dyn Smbios> from SmbiosProvider, runs BiosInfoSmbiosPublisher, which calls smbios.add_record(&record) and gets handle 0x0001. SMBIOS publication round-trips with no C protocol involved in the publishing component.

Integration Instructions

cd uefi/OdpPkg/Drivers/ODP_PatinaSmbiosDemo
BUILD_DATE=$(date +%m/%d/%Y) cargo build --target x86_64-unknown-uefi --release

Drop the resulting .efi into your platform .fdf:

FILE DRIVER = C74158C9-87BC-448B-86B1-818071938A4C {
  SECTION DXE_DEPEX = <path-to>/OdpPkg/Drivers/ODP_PatinaSmbiosDemo/ODP_PatinaSmbiosDemo.depex
  SECTION PE32      = <path-to>/OdpPkg/Drivers/ODP_PatinaSmbiosDemo/target/x86_64-unknown-uefi/release/ODP_PatinaSmbiosDemo.efi
  SECTION UI        = "ODP_PatinaSmbiosDemo"
}

After booting, Shell> smbiosview -t 0 shows the record with vendor "Acme Inc.".

See uefi/OdpPkg/Drivers/ODP_PatinaSmbiosDemo/README.md for the migration path to a Patina-native DXE core (use impl_component_info! on the same OemPlatform struct from platform.rs — zero source changes to the publishing component).

Closes #78

Copilot AI review requested due to automatic review settings May 11, 2026 17:20
@kat-perez kat-perez requested a review from a team as a code owner May 11, 2026 17:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new UEFI DXE demo driver (ODP_PatinaSmbiosDemo) that publishes an SMBIOS Type 0 record using the Patina component/service model via patina_tianocore, plus supporting build/docs assets for integrating the produced .efi into an EDK II .fdf.

Changes:

  • Introduces a Patina-component-based SMBIOS Type 0 publisher (BiosInfoSmbiosPublisher) and a minimal TianoCore driver shell using driver_entry!.
  • Adds build scaffolding for the new driver (Cargo manifest/lockfile, pinned Rust toolchain, DXE depex).
  • Adds documentation and repo-level .gitattributes handling for binary .depex files.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
uefi/OdpPkg/Drivers/ODP_PatinaSmbiosDemo/src/platform.rs Defines the portable platform registration and the SMBIOS Type 0 publishing component.
uefi/OdpPkg/Drivers/ODP_PatinaSmbiosDemo/src/main.rs Minimal no_std UEFI driver entrypoint wiring via patina_tianocore::driver_entry!.
uefi/OdpPkg/Drivers/ODP_PatinaSmbiosDemo/Cargo.toml Declares the new driver crate and its Patina/SMBIOS dependencies.
uefi/OdpPkg/Drivers/ODP_PatinaSmbiosDemo/Cargo.lock Locks the dependency graph for reproducible builds of the new driver.
uefi/OdpPkg/Drivers/ODP_PatinaSmbiosDemo/rust-toolchain.toml Pins a nightly toolchain and UEFI targets/components for building the driver.
uefi/OdpPkg/Drivers/ODP_PatinaSmbiosDemo/ODP_PatinaSmbiosDemo.depex Adds a minimal DXE dependency expression for early dispatch.
uefi/OdpPkg/Drivers/ODP_PatinaSmbiosDemo/README.md Documents build/integration steps and the Patina-native migration path.
.gitattributes Marks .depex as binary so diffs don’t render raw bytes as text.

Comment thread uefi/OdpPkg/Drivers/ODP_PatinaSmbiosDemo/Cargo.toml
Comment thread uefi/OdpPkg/Drivers/ODP_PatinaSmbiosDemo/rust-toolchain.toml
Comment thread uefi/OdpPkg/Drivers/ODP_PatinaSmbiosDemo/src/main.rs
Comment thread uefi/OdpPkg/Drivers/ODP_PatinaSmbiosDemo/README.md
Comment thread .gitattributes
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.

Comment thread uefi/OdpPkg/Drivers/ODP_PatinaSmbiosDemo/README.md Outdated
Comment thread uefi/OdpPkg/Drivers/ODP_PatinaSmbiosDemo/src/platform.rs
Comment thread uefi/OdpPkg/Drivers/ODP_PatinaSmbiosDemo/src/platform.rs
@kat-perez kat-perez force-pushed the odp-patina-smbios-demo branch from c77ddc1 to 9d6afab Compare May 11, 2026 20:20
@kat-perez kat-perez merged commit 1f9e8db into OpenDevicePartnership:main May 12, 2026
22 checks passed
@kat-perez kat-perez deleted the odp-patina-smbios-demo branch May 12, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

patina-tianocore: create patina_smbios crate example

5 participants