Adding a SizeStudy directory - #173
Open
rogurr wants to merge 1 commit into
Open
Conversation
…ased drivers, per an OEM request.
Contributor
There was a problem hiding this comment.
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 aDEBUG_INFOmessage and exits successfully. - Introduces a Rust DXE driver (
RustHelloWorld) with a PL011-UART-backedlogimplementation that emits aninfo!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 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: |
williampMSFT
approved these changes
Aug 5, 2026
kat-perez
approved these changes
Aug 6, 2026
felipebalbi
approved these changes
Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.