Skip to content

Adding a SizeStudy directory - #173

Merged
rogurr merged 3 commits into
OpenDevicePartnership:mainfrom
rogurr:SizeStudy
Aug 19, 2026
Merged

Adding a SizeStudy directory#173
rogurr merged 3 commits into
OpenDevicePartnership:mainfrom
rogurr:SizeStudy

Conversation

@rogurr

@rogurr rogurr commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

The ./uefi/SizeStudy directory contains 2 drivers that both produce a hello world debug message string in the driver entry then exit, one written in C and the other in Rust. They are intended to be a baseline to allow making modifications such as adding C libraries or Rust Patina components to see how the changes affect size.

Copilot AI lite review requested due to automatic review settings August 4, 2026 20:47
@rogurr
rogurr requested a review from a team as a code owner August 4, 2026 20:47
@rogurr rogurr self-assigned this Aug 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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/SizeStudy area intended to serve as a baseline for measuring size impacts of simple UEFI “hello world” style drivers implemented in both C and Rust.

Changes:

  • Introduces a minimal C DXE driver (CHelloWorld) that emits a DEBUG_INFO message and exits successfully.
  • Introduces a Rust DXE driver (RustHelloWorld) with a PL011-UART-backed log implementation that emits an info! message and returns success.
  • Adds documentation describing baseline size/compression comparisons and how to use the directory for experiments.

Reviewed changes

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

Show a summary per file
File Description
uefi/SizeStudy/RustHelloWorld/src/main.rs New Rust DXE driver entrypoint with a simple UART logger and hello-world log message.
uefi/SizeStudy/RustHelloWorld/Cargo.toml New Rust driver manifest defining dependencies and build profile settings.
uefi/SizeStudy/RustHelloWorld/.cargo/config.toml New per-crate cargo configuration for aarch64-unknown-uefi build and linker flags.
uefi/SizeStudy/README.md Documentation for the size study rationale and baseline measurement results.
uefi/SizeStudy/CHelloWorld/CHelloWorld.inf New EDK2 INF for the C DXE driver baseline module.
uefi/SizeStudy/CHelloWorld/CHelloWorld.c New C DXE driver baseline implementation emitting a debug message.

Comment thread uefi/SizeStudy/RustHelloWorld/src/main.rs
Comment thread uefi/SizeStudy/RustHelloWorld/src/main.rs Outdated
Comment thread uefi/SizeStudy/RustHelloWorld/.cargo/config.toml Outdated
Comment thread uefi/SizeStudy/RustHelloWorld/.cargo/config.toml Outdated
Comment thread uefi/SizeStudy/CHelloWorld/CHelloWorld.c
Comment thread uefi/SizeStudy/CHelloWorld/CHelloWorld.inf
Comment thread uefi/SizeStudy/RustHelloWorld/Cargo.toml Outdated
Comment thread uefi/SizeStudy/README.md Outdated
williampMSFT
williampMSFT previously approved these changes Aug 5, 2026
kat-perez
kat-perez previously approved these changes Aug 6, 2026
felipebalbi
felipebalbi previously approved these changes Aug 12, 2026
* Copyright and license properly set to expected text
* Unnecessary config in Rust code removed
Copilot AI review requested due to automatic review settings August 18, 2026 00:25
@rogurr
rogurr dismissed stale reviews from felipebalbi, kat-perez, and williampMSFT via 45b6c60 August 18, 2026 00:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 6 out of 6 changed files in this pull request and generated no new comments.

Suppressed comments (2)

uefi/SizeStudy/CHelloWorld/CHelloWorld.c:6

  • The C driver source header comment style (//// ...) doesn’t match the established UEFI C style in this repo, where sources start with a Doxygen-style /** @file header (e.g. uefi/SrePkg/Application/NvmeBpWrite/NvmeBpWrite.c:1). Aligning the header keeps documentation consistent and improves tooling support.
////
// SizeStudy baseline DXE driver that prints a debug message and exits, written in C.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT

uefi/SizeStudy/RustHelloWorld/Cargo.toml:16

  • log is used from a #![no_std] UEFI binary, but this dependency enables default features. In this repo’s UEFI Rust crates, log is consistently pulled in with default-features = false (e.g. uefi/crates/patina_boot/Cargo.toml, uefi/OdpPkg/Drivers/ODP_PatinaSmbiosDemo/Cargo.toml), which also helps keep the size-study baseline smaller and avoids accidentally relying on std.
  log = { version = "0.4" }

Copilot AI review requested due to automatic review settings August 18, 2026 00:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 6 out of 6 changed files in this pull request and generated no new comments.

Suppressed comments (1)

uefi/SizeStudy/RustHelloWorld/Cargo.toml:17

  • log is pulled in with default features enabled. For a #![no_std] UEFI driver (and especially for a size baseline), this can unnecessarily pull in std support from log and inflate the resulting .efi size. Other UEFI crates in this repo consistently disable log default features.
[dependencies]
  arm-pl011-uart = { version = "0.5.0", default-features = false }
  log = { version = "0.4" }
  spin = { version = "0.10.0", default-features = false, features = ["mutex", "spin_mutex"] }

@rogurr
rogurr merged commit 1c192ab into OpenDevicePartnership:main Aug 19, 2026
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.

6 participants