[0] https://github.com/OpenDevicePartnership/patina-qemu
[1] https://github.com/OpenDevicePartnership/patina-dxe-core-qem...
---
Unrelated: I've been playing around with uefi-rs and it's a surprisingly ergonomic API, especially for someone completely new to UEFI. It also provides a global allocator that can be used to *dynamically* allocate Vec and Box types. It feels like a cheat to safely(!) open a PXE Base Code protocol on a handle, read file size from TFTP, and *dynamically* allocate a Vec<u8> (with size limits of course). I highly recommend people check out uefi-rs as a "side reading" to this project.
Honestly, I need to ask for a security audit for this stub loader — it currently works and can be used to set up a simple SecureBoot boot path.
If you are lucky and have PXE BC available, then you can actually "re-use" the IP address assigned to your machine if you PXE boot into your application. From there, you can issue two TFTP commands, set up a configuration table with LINUX_EFI_INITRD_MEDIA_GUID pointing to the start of initrd in memory (the memory has to have type LOADER_DATA), load the kernel, use LoadedImage::set_load_options to provide kernel parameters (init, loglevel, etc.), and finally call start_image.
Also went down a rabbit hole yesterday and ended up implementing a very basic DHCP client on top of bare SNP. For reference, SNP is essentially writing raw ethernet frames to the transmit buffer of a NIC. I didn't pursue TFTP or PXE protocols because those would be too much to implement myself. In any case, I successfully got an IP address assigned on real hardware.
The coolest part about Rust is that my DHCP implementation was taken from another of my Rust projects where I implemented a basic PXE server. All I had to do was copy-paste one file and rename a std::net import to core::net. That is where Rust truly feels like "cheating" when targetting no_std environments.
treffer•3mo ago
Looking at the members on the repository this seems to be a Microsoft project?
mariuolo•3mo ago
As far as I remmeber, they control the issuance of keys for bootloaders. Or is this project supposed to do away with that?
pjmlp•3mo ago
https://microsoft.github.io/mu/
zang0•3mo ago
Mu has some bits & pieces of Rust code and EDKII is still the upstream for Mu.
Patina is 100% Rust DXE Core implemented from spec.
CaptainOfCoit•3mo ago
7bit•3mo ago
BonusPlay•3mo ago
zamadatix•3mo ago
7bit•3mo ago
Luker88•3mo ago
mjg59•3mo ago
p_l•3mo ago
They are also the one party that is forcing freedom-enabling but formal standard breaking ability of resetting Platform Key, because Microsoft actually documents (or used to) a process to deploy systems signed with your own key as part of the highest security deployment documentation for enterprise customers
als0•3mo ago
yencabulator•3mo ago