From 1af2309fb42d48b374a89313cf576c9cc742d65e Mon Sep 17 00:00:00 2001 From: Michael Kubacki Date: Fri, 25 Aug 2023 09:03:31 -0400 Subject: [PATCH] Add HelloWorldRustDxe to QemuQ35Pkg and QemuSbsaPkg Adds the driver to both packages to demonstrate a Rust based UEFI DXE driver executing during boot on a X64 and AARCH64 system. A workspace Cargo.toml file is added for cargo make. Since this repo is the "leaf of a dependency chain" in that it builds binaries that are integrated into the platform build, the `Cargo.lock` file is checked in per the guidance in: https://doc.rust-lang.org/cargo/faq.html#why-do-binaries-have-cargolock-in-version-control-but-not-libraries Signed-off-by: Michael Kubacki --- Cargo.lock | 40 +++++++++++++++++++++++++++ Cargo.toml | 14 ++++++++++ Platforms/QemuQ35Pkg/QemuQ35Pkg.dsc | 1 + Platforms/QemuQ35Pkg/QemuQ35Pkg.fdf | 1 + Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc | 1 + Platforms/QemuSbsaPkg/QemuSbsaPkg.fdf | 1 + 6 files changed, 58 insertions(+) create mode 100644 Cargo.lock create mode 100644 Cargo.toml diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 00000000..b62662f8 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,40 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "HelloWorldRustDxe" +version = "0.1.0" +dependencies = [ + "RustAdvancedLoggerDxe", + "RustBootServicesAllocatorDxe", + "r-efi", +] + +[[package]] +name = "RustAdvancedLoggerDxe" +version = "0.1.0" +dependencies = [ + "r-efi", + "spin", +] + +[[package]] +name = "RustBootServicesAllocatorDxe" +version = "0.1.0" +dependencies = [ + "r-efi", + "spin", +] + +[[package]] +name = "r-efi" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "575fc2d9b3da54adbdfaddf6eca48fec256d977c8630a1750b8991347d1ac911" + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 00000000..748acbb3 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,14 @@ +[workspace] + +# Add packages that generate binaries here +members = [ + "Common/MU/MsCorePkg/HelloWorldRustDxe" +] + +# Add packages that generate libraries here +[workspace.dependencies] +RustAdvancedLoggerDxe = {path = "Common/MU/AdvLoggerPkg/Crates/RustAdvancedLoggerDxe"} +RustBootServicesAllocatorDxe = {path = "Common/MU/MsCorePkg/Crates/RustBootServicesAllocatorDxe"} + +r-efi = "4.0.0" +spin = "0.5.2" diff --git a/Platforms/QemuQ35Pkg/QemuQ35Pkg.dsc b/Platforms/QemuQ35Pkg/QemuQ35Pkg.dsc index 4e1cc354..b7d6582d 100644 --- a/Platforms/QemuQ35Pkg/QemuQ35Pkg.dsc +++ b/Platforms/QemuQ35Pkg/QemuQ35Pkg.dsc @@ -1355,6 +1355,7 @@ QemuQ35Pkg/Library/ResetSystemLib/StandaloneMmResetSystemLib.inf MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmpDxe.inf MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/UsbMouseAbsolutePointerDxe.inf MsCorePkg/AcpiRGRT/AcpiRgrt.inf + MsCorePkg/HelloWorldRustDxe/HelloWorldRustDxe.inf DfciPkg/Application/DfciMenu/DfciMenu.inf MsGraphicsPkg/PrintScreenLogger/PrintScreenLogger.inf diff --git a/Platforms/QemuQ35Pkg/QemuQ35Pkg.fdf b/Platforms/QemuQ35Pkg/QemuQ35Pkg.fdf index 0f123cdb..3dd509b2 100644 --- a/Platforms/QemuQ35Pkg/QemuQ35Pkg.fdf +++ b/Platforms/QemuQ35Pkg/QemuQ35Pkg.fdf @@ -518,6 +518,7 @@ INF MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/UsbMouseAbsolutePointerDxe. INF DfciPkg/Application/DfciMenu/DfciMenu.inf INF MsGraphicsPkg/PrintScreenLogger/PrintScreenLogger.inf INF SecurityPkg/Hash2DxeCrypto/Hash2DxeCrypto.inf +INF MsCorePkg/HelloWorldRustDxe/HelloWorldRustDxe.inf INF MsCorePkg/AcpiRGRT/AcpiRgrt.inf #SHARED_CRYPTO Crypto Bin Modules diff --git a/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc b/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc index 2391ca30..17542a01 100644 --- a/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc +++ b/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc @@ -1056,6 +1056,7 @@ MsWheaPkg/MsWheaReport/Dxe/MsWheaReportDxe.inf MsCorePkg/MuVarPolicyFoundationDxe/MuVarPolicyFoundationDxe.inf MsCorePkg/AcpiRGRT/AcpiRgrt.inf + MsCorePkg/HelloWorldRustDxe/HelloWorldRustDxe.inf MsGraphicsPkg/PrintScreenLogger/PrintScreenLogger.inf SecurityPkg/Hash2DxeCrypto/Hash2DxeCrypto.inf diff --git a/Platforms/QemuSbsaPkg/QemuSbsaPkg.fdf b/Platforms/QemuSbsaPkg/QemuSbsaPkg.fdf index 736f2df0..42a8ba6d 100644 --- a/Platforms/QemuSbsaPkg/QemuSbsaPkg.fdf +++ b/Platforms/QemuSbsaPkg/QemuSbsaPkg.fdf @@ -406,6 +406,7 @@ READ_LOCK_STATUS = TRUE INF MsGraphicsPkg/PrintScreenLogger/PrintScreenLogger.inf INF MsCorePkg/AcpiRGRT/AcpiRgrt.inf INF SecurityPkg/Hash2DxeCrypto/Hash2DxeCrypto.inf + INF MsCorePkg/HelloWorldRustDxe/HelloWorldRustDxe.inf # # DFCI support