diff --git a/Changelog.md b/Changelog.md index f3c2fdd2..f365b38a 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,7 @@ # Unreleased +- Uefi: Look for an ACPI2 RSDP first ([#174](https://github.com/rust-osdev/bootloader/pull/174)) + # 0.10.5 – 2021-05-21 - Fix build on latest Rust nightlies by updating `uefi-rs` dependency ([#170](https://github.com/rust-osdev/bootloader/pull/170)) diff --git a/src/bin/uefi.rs b/src/bin/uefi.rs index c2ecc4a3..2a398383 100644 --- a/src/bin/uefi.rs +++ b/src/bin/uefi.rs @@ -59,9 +59,12 @@ fn efi_main(image: Handle, st: SystemTable) -> Status { rsdp_addr: { use uefi::table::cfg; let mut config_entries = system_table.config_table().iter(); - config_entries - .find(|entry| matches!(entry.guid, cfg::ACPI_GUID | cfg::ACPI2_GUID)) - .map(|entry| PhysAddr::new(entry.address as u64)) + // look for an ACPI2 RSDP first + let acpi2_rsdp = config_entries.find(|entry| matches!(entry.guid, cfg::ACPI2_GUID)); + // if no ACPI2 RSDP is found, look for a ACPI1 RSDP + let rsdp = acpi2_rsdp + .or_else(|| config_entries.find(|entry| matches!(entry.guid, cfg::ACPI_GUID))); + rsdp.map(|entry| PhysAddr::new(entry.address as u64)) }, };