Skip to content

Commit 08b59be

Browse files
author
Jiajie Chen
committed
Use updated ACPI crate to parse ACPI in x86
1 parent 0b0e364 commit 08b59be

File tree

4 files changed

+24
-9
lines changed

4 files changed

+24
-9
lines changed

crate/memory/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#![cfg_attr(not(test), no_std)]
2-
#![feature(alloc)]
32
#![feature(nll)]
4-
#![feature(maybe_uninit)]
53

64
// import macros from log
75
use log::*;

kernel/Cargo.lock

Lines changed: 17 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

kernel/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ x86_64 = "0.6"
7777
raw-cpuid = "6.0"
7878
uart_16550 = "0.2"
7979
pc-keyboard = "0.5"
80-
acpi = "0.2"
80+
acpi = { git = "https://github.com/rust-osdev/acpi" }
81+
aml_parser = { git = "https://github.com/rust-osdev/acpi" }
8182

8283
[target.'cfg(any(target_arch = "riscv32", target_arch = "riscv64"))'.dependencies]
8384
riscv = { git = "https://github.com/rcore-os/riscv", features = ["inline-asm"] }

kernel/src/arch/x86_64/acpi.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
use crate::arch::consts::PHYSICAL_MEMORY_OFFSET;
22
use acpi::{search_for_rsdp_bios, AcpiHandler, PhysicalMapping};
33
use core::ptr::NonNull;
4+
use crate::memory::phys_to_virt;
5+
use core::slice;
46

57
struct Handler;
68

@@ -27,5 +29,7 @@ impl AcpiHandler for Handler {
2729
pub fn init() {
2830
let mut handler = Handler {};
2931
let res = unsafe { search_for_rsdp_bios(&mut handler) };
30-
debug!("ACPI {:#x?}", res);
32+
if let Ok(acpi) = res {
33+
debug!("ACPI {:#x?}", acpi);
34+
}
3135
}

0 commit comments

Comments
 (0)