Updates the requirements on [scroll](https://github.com/m4b/scroll) to
permit the latest version.
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
## Description
This PR introduces a "v2" implementation of UefiHidDxe that has
significant refactoring to support unit tests and architectural
improvements.
- UefiHidDxeV2 code coverage with unit tests is ~80% or greater for all
modules of the UefiHidDxe crate
- Better separation between FFI layers and native rust layers
The long term plan is to eventually remove the original UefiHidDxe in
favor of this implementation.
- [x] Impacts functionality?
- Driver provides the same functionality as UefiHidDxe which should be
considered deprecated going forward.
- [ ] Impacts security?
- [ ] Breaking change?
- [x] Includes tests?
- Includes Rust unit tests covering all new modules.
- [x] Includes documentation?
- Standard rustdocs included.
## How This Was Tested
Tested under QEMU using simulated USB keyboard and mouse.
## Integration Instructions
UefiHidDxeV2 is a drop-in replacement for UefiHidDxe; platforms that
wish to move to the new implementation can do so by pulling in the new
UefiHidDxeV2 and adding the necessary mockall crate to their workspace
Cargo.toml.
## Description
Adds HID keyboard support to UefiHidDxe input driver.
- [x] Impacts functionality?
- Adds keyboard support.
- [ ] Impacts security?
- [ ] Breaking change?
- [ ] Includes tests?
- [x] Includes documentation?
- standard rustdocs
## How This Was Tested
Tested with USB keyboard support in QEMU. Early iterations also tested
in hardware.
## Integration Instructions
Platforms will need to add `HiiKeyboardLayout = {path =
"HidPkg/Crates/HiiKeyboardLayout"}` to the `[workspace.dependencies]` in
their cargo.toml if not already present.
## Description
This crate provides a rust wrapper around UEFI HII Keyboard Layout
structures. The relevant structures defined in the UEFI spec are not
well-suited for direct definition in rust; so this crate defines
analogous rust structures and provides serialization/deserialization
support for converting the rust structures into byte buffers and vice
versa. This crate uses the `scroll` crate
(https://github.com/m4b/scroll) to facilitate
serialization/deserialization of the Hii structures.
## Examples and Usage
Retrieving a default (en-US) layout, writing it to a buffer, and then
reading the buffer back into a rust structure:
```
use hii_keyboard_layout::{get_default_keyboard_pkg, HiiKeyboardPkg};
use scroll::{Pread, Pwrite};
let mut buffer = [0u8; 4096];
let package = get_default_keyboard_pkg();
buffer.pwrite(&package, 0).unwrap();
let package2: HiiKeyboardPkg = buffer.pread(0).unwrap();
assert_eq!(package, package2);
```
- [x] Impacts functionality?
- Introduces a new crate providing support for HII layouts.
- [ ] Impacts security?
- [ ] Breaking change?
- [x] Includes tests?
- Includes standard rust unit tests.
- [x] Includes documentation?
- Includes standard rust documentation.
## How This Was Tested
Verified by included unit tests.
## Integration Instructions
This crate requires the "scroll," "num-traits" and "num-drive" crates,
so platforms intending to use it will need to add these as dependencies
in their workspace Cargo.toml files. This PR does this for the workspace
Cargo.toml that is at the root of mu_plus.
Sample:
```
scroll = { version = "0.11", default-features = false, features = ["derive"]}
num-traits = { version = "0.2", default-features = false}
num-derive = { version = "0.4", default-features = false}
## Description
The protocol was upstreamed to r-efi 4.3.0 and can be picked up from
there now.
- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
flow, or firmware?
- Examples: Crypto algorithm change, buffer overflow fix, parameter
validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
- **Tests** - Does the change include any explicit test code?
- Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
on an a separate Web page, ...
## How This Was Tested
- HidPkg build and QEMU Q35 shell boot
## Integration Instructions
N/A
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Note: does not yet support HID keyboards. This is planned future work.
- [x] Impacts functionality?
Adds new input support functionality.
- [ ] Impacts security?
- [ ] Breaking change?
- [ ] Includes tests?
- [x] Includes documentation?
- includes standard RustDocs.
Pointer verified in preboot console (UEFI setup menu and Bitlocker Recovery).
Assuming a project is setup to build rust modules generally, integration of the new stack is accomplished by:
- Remove UsbMouseAbsolutePointerDxe
- Add UsbHidDxe and UefiHidDxe to the build
- [x] Impacts functionality?
Adds new input support functionality.
- [ ] Impacts security?
- [ ] Breaking change?
- [ ] Includes tests?
- [x] Includes documentation?
- includes standard RustDocs.
Pointer verified in preboot console (UEFI setup menu and Bitlocker Recovery).
N/A
- [x] Impacts functionality?
Adds new input support functionality.
- [ ] Impacts security?
- [ ] Breaking change?
- [ ] Includes tests?
- [x] Includes documentation?
- includes standard RustDocs.
Pointer verified in preboot console (UEFI setup menu and Bitlocker Recovery).
N/A
Updates the requirements on [spin](https://github.com/mvdnes/spin-rs) to
permit the latest version.
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Adds a simple Rust based DXE driver to demonstrate how to structure
a DXE driver that only has Rust crate dependencies.
Within the firmware build framework, this is considered a "pure Rust"
DXE driver in that it only has a `Cargo.toml` file in the `[Sources]`
section of the INF with no EDK II library dependencies.
The module uses the `RustAdvancedLoggerDxe` crate (which is a wrapper
around the Advanced Logger protocol) to write debug messages and the
`RustBootServicesAllocatorDxe`.
Co-authored-by: John Schock <joschock@microsoft.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Adds a library crate that serves as a Rust wrapper for access to
the Advanced Logger protocol.
Co-authored-by: John Schock <joschock@microsoft.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>