rust-osdev / uefi-rs

Rust wrapper for UEFI.
https://rust-osdev.com/uefi-book
Mozilla Public License 2.0
1.23k stars 154 forks source link

RSDP + devices #206

Closed genderev closed 3 years ago

genderev commented 3 years ago
  1. Why and when is the RSDP not reported? If parsing ACPI is important to your crate, would exporting (in the BootInfo struct) specific entries from ACPI be more reliable than exporting the RSDP as a whole?

  2. What is the purpose of the line let gop = unsafe { &mut *gop.get() }; from src/bin/uefi.rs?

phil-opp commented 3 years ago

To get the RSDP, you can use:

use uefi::table::cfg;

let mut config_entries = system_table.config_table().iter();
let rsdp_addr = config_entries
    .find(|entry| matches!(entry.guid, cfg::ACPI_GUID | cfg::ACPI2_GUID))
    .map(|entry| entry.address);
genderev commented 3 years ago

Hi Phil, thank you for replying.

I should have asked this question in the bootloader repo.

phil-opp commented 3 years ago

No worries!

(Cross linking: the bootloader issue is at https://github.com/rust-osdev/bootloader/issues/152)