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