mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Query RSDP address
This commit is contained in:
@@ -7,7 +7,7 @@ extern crate alloc;
|
||||
|
||||
use alloc::vec::Vec;
|
||||
use core::{alloc::Layout, fmt::Write, panic::PanicInfo};
|
||||
use uefi::prelude::entry;
|
||||
use uefi::{prelude::entry, table::cfg};
|
||||
|
||||
#[entry]
|
||||
fn efi_main(
|
||||
@@ -28,6 +28,12 @@ fn efi_main(
|
||||
v.push(2);
|
||||
writeln!(stdout, "v = {:?}", v).unwrap();
|
||||
|
||||
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);
|
||||
writeln!(stdout, "rsdp addr: {:?}", rsdp_addr).unwrap();
|
||||
|
||||
loop {}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user