Skip to content

Adding a SizeStudy directory - #173

Open
rogurr wants to merge 1 commit into
OpenDevicePartnership:mainfrom
rogurr:SizeStudy
Open

Adding a SizeStudy directory#173
rogurr wants to merge 1 commit 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 on lines +22 to +25
#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
loop {}
}
Comment on lines +7 to +9
//! Copyright (c) Microsoft Corporation. All rights reserved.
//!
//! SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -0,0 +1,38 @@
# Cargo build configuration for the Patina DXE Core driver
Comment on lines +30 to +38
# Alias to run lib tests on the host without the UEFI/build-std conflict.
# Usage: cargo odp-test
[alias]
odp-test = [
"test",
"--target", "x86_64-unknown-linux-gnu",
"--lib",
"--config", "unstable.build-std=[\"std\",\"core\",\"compiler_builtins\",\"alloc\"]",
]
Comment on lines +1 to +2
#include <Uefi.h>
#include <Library/DebugLib.h>
@@ -0,0 +1,20 @@
[Defines]
Comment on lines +13 to +16
[dependencies]
arm-pl011-uart = { version = "0.5.0", default-features = false }
log = "^0.4"
spin = { version = "0.10.0", default-features = false, features = ["mutex", "spin_mutex"] }
Comment thread uefi/SizeStudy/README.md
Comment on lines +17 to +18
the Rust based driver due to the compiler having segments aligned to 4K instead of Rust's 512 byte alignment. So most
most of the C based driver is unused (zeroed) regions:
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.

5 participants