|
1 | 1 | # Acpi
|
2 | 2 | 
|
3 |
| -[](https://crates.io/crates/rsdp/) |
4 | 3 | [](https://crates.io/crates/acpi/)
|
5 |
| -[](https://crates.io/crates/aml/) |
6 | 4 |
|
7 |
| -### [Documentation (`rsdp`)](https://docs.rs/rsdp) |
8 |
| -### [Documentation (`acpi`)](https://docs.rs/acpi) |
9 |
| -### [Documentation (`aml`)](https://docs.rs/aml) |
| 5 | +### [Documentation](https://docs.rs/acpi) |
10 | 6 |
|
11 |
| -A library to parse ACPI tables and AML, written in pure Rust. Designed to be easy to use from Rust bootloaders and kernels. The library is split into three crates: |
12 |
| -- `rsdp` parses the RSDP and can locate it on BIOS platforms. It does not depend on `alloc`, so is suitable to use from bootloaders without heap alloctors. All of its |
13 |
| - functionality is reexported by `acpi`. |
14 |
| -- `acpi` parses the static tables (useful but not feature-complete). It can be used from environments that have allocators, and ones that don't (but with reduced functionality). |
15 |
| -- `aml` parses the AML tables (can be useful, far from feature-complete). |
| 7 | +`acpi` is a Rust library for interacting with the Advanced Configuration and Power Interface, a |
| 8 | +complex framework for power management and device discovery and configuration. ACPI is used on |
| 9 | +modern x64, as well as some ARM and RISC-V platforms. An operating system needs to interact with |
| 10 | +ACPI to correctly set up a platform's interrupt controllers, perform power management, and fully |
| 11 | +support many other platform capabilities. |
16 | 12 |
|
17 |
| -There is also the `acpi-dumper` utility to easily dump a platform's ACPI tables (this currently only works on Linux). |
| 13 | +This crate provides a limited API that can be used without an allocator, for example for use |
| 14 | +from a bootloader. This API will allow you to search for the RSDP, enumerate over the available |
| 15 | +tables, and interact with the tables using their raw structures. All other functionality is |
| 16 | +behind an `alloc` feature (enabled by default) and requires an allocator. |
18 | 17 |
|
19 |
| -## Contributing |
20 |
| -Contributions are more than welcome! You can: |
21 |
| -- Write code - the ACPI spec is huge and there are bound to be things we don't support yet! |
22 |
| -- Improve our documentation! |
23 |
| -- Use the crates within your kernel and file bug reports and feature requests! |
| 18 | +With an allocator, this crate provides a richer higher-level interfaces to the static tables, as |
| 19 | +well as a dynamic interpreter for AML - the bytecode format encoded in the DSDT and SSDT tables. |
24 | 20 |
|
25 |
| -Useful resources for contributing are: |
26 |
| -- [The ACPI specification](https://uefi.org/specifications) |
27 |
| -- [OSDev Wiki](https://wiki.osdev.org/ACPI) |
28 |
| - |
29 |
| -You can run the AML test suite with `cargo run --bin aml_tester -- -p tests`. |
30 |
| -You can run fuzz the AML parser with `cd aml && cargo fuzz run fuzz_target_1` (you may need to `cargo install cargo-fuzz`). |
| 21 | +See the library documentation for example usage. You will almost certainly need to read portions |
| 22 | +of the [ACPI Specification](https://uefi.org/specifications) too (however, be aware that firmware often |
| 23 | +ships with ACPI tables that are not spec-compliant). |
31 | 24 |
|
32 | 25 | ## Licence
|
33 | 26 | This project is dual-licenced under:
|
|
0 commit comments