Add documentation to initrd loader

This commit is contained in:
Julian Stecklina 2022-11-24 12:18:23 +01:00
parent 30b61baf38
commit df716e17d6
2 changed files with 9 additions and 2 deletions

View File

@ -185,6 +185,10 @@ fn initrd_verify(boot_services: &BootServices, initrd_efi: &mut RegularFile) ->
} }
impl InitrdLoader { impl InitrdLoader {
/// Create a new [`InitrdLoader`].
///
/// `handle` is the handle where the protocols are registered
/// on. `file` is the file that is served to Linux.
pub fn new( pub fn new(
boot_services: &BootServices, boot_services: &BootServices,
handle: Handle, handle: Handle,
@ -199,8 +203,11 @@ impl InitrdLoader {
range, range,
}); });
// Linux finds the right handle by looking for something that
// implements the device path protocol for the specific device
// path.
unsafe { unsafe {
let dp_proto: *mut u8 = &mut DEVICE_PATH_PROTOCOL[0]; let dp_proto: *mut u8 = DEVICE_PATH_PROTOCOL.as_mut_ptr();
boot_services.install_protocol_interface( boot_services.install_protocol_interface(
Some(handle), Some(handle),

View File

@ -13,7 +13,7 @@ use pe_section::pe_section_as_string;
use uefi::{ use uefi::{
prelude::*, prelude::*,
proto::{ proto::{
console::text::{self, Output}, console::text::Output,
loaded_image::LoadedImage, loaded_image::LoadedImage,
media::file::{File, FileAttribute, FileMode, RegularFile}, media::file::{File, FileAttribute, FileMode, RegularFile},
}, },