-
-
Notifications
You must be signed in to change notification settings - Fork 88
eir: Log image UEFI device paths #1036
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
return &s; | ||
} | ||
|
||
struct UefiAllocator { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be nice to have a comment warning that these allocations should probably not survive past ExitBootServices
.
|
||
auto n = frg::basic_string_view<char16_t>{devPathUtf16}.size(); | ||
frg::string<UefiAllocator> out{n}; | ||
for (size_t i = 0; i < n; ++i) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having a helper function for this in helpers.hpp
would be nicer than copy-pasting this code block, especially now that we can use the UefiAllocator
with frg::string
.
}; | ||
|
||
frg::string<UefiAllocator> devPathToString(efi_device_path_protocol *devPath) { | ||
auto devPathUtf16 = devPathToText->convert_device_path_to_text(devPath, true, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should gracefully handle this protocol not being present on funny UEFI implementations.
|
||
// Get some essential protocols. | ||
efi_guid devPathToTextGuid = EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID; | ||
EFI_CHECK( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should gracefully handle this protocol not being present on funny UEFI implementations.
Small PR that helps with debugging on UEFI boot.