From b53bcfd7cdc5bab8eebdc1c8a53a2e9a433b7697 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 10 Feb 2022 12:18:24 -0700 Subject: [PATCH] Reduce prints from UEFI bootloader --- src/os/uefi/arch/x86_64/mod.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/os/uefi/arch/x86_64/mod.rs b/src/os/uefi/arch/x86_64/mod.rs index 1e3ac79d2a..d37a062207 100644 --- a/src/os/uefi/arch/x86_64/mod.rs +++ b/src/os/uefi/arch/x86_64/mod.rs @@ -60,7 +60,7 @@ fn validate_rsdp(address: usize, v2: bool) -> core::result::Result()) }; let rsdp = unsafe { (rsdp_bytes.as_ptr() as *const Rsdp).as_ref::<'static>().unwrap() }; - println!("RSDP: {:?}", rsdp); + log::debug!("RSDP: {:?}", rsdp); if rsdp.signature != *b"RSD PTR " { return Err(Invalid); @@ -114,7 +114,7 @@ fn find_acpi_table_pointers() { rsdps_area.extend(unsafe { core::slice::from_raw_parts(address as *const u8, length) }); rsdps_area.resize(((rsdps_area.len() + (align - 1)) / align) * align, 0u8); } - Err(_) => println!("Found RSDP that wasn't valid at {:p}", address as *const u8), + Err(_) => log::warn!("Found RSDP that was not valid at {:p}", address as *const u8), } } } @@ -171,8 +171,11 @@ impl Os< match redoxfs::FileSystem::open(block_io, Some(0)) { Ok(ok) => return ok, - Err(err) => { - log::warn!("Failed to open RedoxFS on block I/O {}: {}", i, err); + Err(err) => match err.errno { + // Ignore header not found error + syscall::ENOENT => (), + // Print any other errors + _ => log::error!("Failed to open RedoxFS on block I/O {}: {}", i, err), } } } @@ -278,7 +281,6 @@ pub fn main() -> Result<()> { st: std::system_table(), }; - println!("Parsing and writing ACPI RSDP structures."); find_acpi_table_pointers(); let (page_phys, mut args) = crate::main(&mut os);