Repository navigation
Update uefi crate to 0.41 - #584
ICRA-SOURCE wants to merge 2 commits into
Conversation
|
The ubuntu 20.04 docker build now fails because archive.ubuntu.comare unreachable. Please re-run the job, since this looks like infrastructure failure unrelated to the PR |
Freax13
left a comment
There was a problem hiding this comment.
Thank you for your contribution!
Bumped
uefito0.41.
Adapted UEFI entry point, protocol handling, graphics output (GOP), file/PXE loading, and memory map descriptors to the
uefi 0.41API.Split
uefi/srcinto 7 focused modules for better readability.Detached UEFI serial drivers from COM ports before initializing the bootloader logger so serial output works reliably in integration tests.
Added an entry under
# UnreleasedinChangelog.md.
Can you split this into separate commits (or at the very least move the split into 7 modules into a separate commit)? Having all of these changes in single commit makes it difficult to review them because the diff doesn't show what lines where changed and which were simply moved into a module.
Freax13
left a comment
There was a problem hiding this comment.
I'm very concerned about the number of drive-by-fixes (or rather drive-by-rewordings?) in this PR. Many lines of code were changed and the reason behind this is not immediately obvious to me. I pointed out a few in the comments but this list of by no means exhaustive.
Please limit your changes to the ones mentioned in the PR description and refrain from rewording unrelated code.
Detached UEFI serial drivers from COM ports before initializing the bootloader logger so serial output works reliably in integration tests.
I'll note that this PR doesn't actually change this. This was already implemented in #580. Why was the COM port change mentioned in the description for this PR?
| if let Some(err) = error_loading_config { | ||
| log::warn!("Failed to deserialize the config file {:?}", err); | ||
| log::warn!("Config parse error: {err:?}"); | ||
| } else { | ||
| log::info!("Reading configuration from disk was successful"); | ||
| log::info!("Boot config loaded successfully"); | ||
| } |
There was a problem hiding this comment.
Why were these messages changed?
| fn allocate_pages(size: usize) -> Option<*mut u8> { | ||
| let pages = size.div_ceil(4096); | ||
| let nn_ptr = boot::allocate_pages(AllocateType::AnyPages, MemoryType::LOADER_DATA, pages) | ||
| .map_err(|e| log::error!("allocate_pages failed: {e:?}")) | ||
| .ok()?; | ||
|
|
||
| let ptr = nn_ptr.as_ptr(); | ||
|
|
||
| unsafe { ptr::write_bytes(ptr, 0, size) }; | ||
| Some(ptr) | ||
| } |
There was a problem hiding this comment.
Why was this functions signature and implementation changed? AFAICT both callers immediately end up calling slice::from_raw_parts_mut anyway, so we might as well continue doing it in this function.
| pub fn load_kernel(image: Handle, boot_mode: BootMode) -> Option<Kernel<'static>> { | ||
| let slice = load_file(image, "kernel-x86_64\0", boot_mode)?; | ||
| Some(Kernel::parse(slice)) | ||
| } |
There was a problem hiding this comment.
Why was the change from RAMDISK_FILE replaced with "kernel-x86_64\0"?
|
|
||
| // Disconnect the UEFI console from the serial device. | ||
| // Our own logger takes full ownership of the serial device. | ||
| // Added solely to ensure integration tests pass by detaching the UEFI serial driver from COM1. |
| } | ||
|
|
||
| let mut kernel = load_kernel(boot_mode); | ||
| fn main_inner(image: Handle) -> Status { |
uefito0.41.uefi 0.41API.uefi/srcinto 7 focused modules for better readability.# UnreleasedinChangelog.md.