Help with ACPI in Rust

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
skyesp
Posts: 15
Joined: Sat Oct 16, 2021 11:57 am

Help with ACPI in Rust

Post by skyesp »

Hiya all. I must admit I have hit a bit of a roadblock when trying to get started with acpi (or perhaps integrating acpica). I am working in Rust, and I am wondering if anyone could help me get started on integrating acpi into my kernel.
Does anyone know how to start with this? I have seen the ACPICA manual, but it seems a bit unwieldy with over 300 pages, so I am wondering what the best approach would be. I know of the libacpica crate, but the documentation is very lacking as far as I can find, so perhaps one of you lovely people knows how to use it?
Looking forward to your helpful replies :D
davmac314
Member
Member
Posts: 121
Joined: Mon Jul 05, 2021 6:57 pm

Re: Help with ACPI in Rust

Post by davmac314 »

skyesp wrote:Does anyone know how to start with this? I have seen the ACPICA manual, but it seems a bit unwieldy with over 300 pages, so I am wondering what the best approach would be
I'm not trying to be mean, but don't you think there's a reason those 300 pages exist...

Maybe start by reading the intro sections at least, until you get an overall feel for how it works. If you don't understand something in particular you can ask specific questions but "how do I start with ACPICA, without reading the actual documentation" is not likely to go down well.

Oh, and the bad news: to understand ACPICA you probably want to read the ACPI spec as well.
Ethin
Member
Member
Posts: 625
Joined: Sun Jun 23, 2019 5:36 pm
Location: North Dakota, United States

Re: Help with ACPI in Rust

Post by Ethin »

There's an acpi crate for Rust (just called "acpi") but it doesn't parse all devices. So you'll have to do some of that yourself. And either way you should probably learn how all that works anyhow.
isaacwoods
Member
Member
Posts: 47
Joined: Sun Sep 06, 2015 5:40 am

Re: Help with ACPI in Rust

Post by isaacwoods »

Oh, and the bad news: to understand ACPICA you probably want to read the ACPI spec as well.
It's absolutely necessary to read the actual ACPI spec, but I think it's reasonable to wonder why you need another 300 pages to understand the implementation. While it has the benefit of being the reference implementation, ACPICA is a real mess and I'd argue is very difficult to use correctly outside of Linux.
There's an acpi crate for Rust (just called "acpi") but it doesn't parse all devices. So you'll have to do some of that yourself. And either way you should probably learn how all that works anyhow.
The crate is, I'd say, a much better experience than ACPICA, and should be complete enough to get you started on QEMU or something.

Relatedly, if anyone does come across anything that is not supported, please do file an issue, or feel free to contribute (something as large and annoying to implement as ACPI could really do with a single implementation; the C side has managed this pretty well with `lai` so it'd be good to say the same for Rust).
davmac314
Member
Member
Posts: 121
Joined: Mon Jul 05, 2021 6:57 pm

Re: Help with ACPI in Rust

Post by davmac314 »

isaacwoods wrote:It's absolutely necessary to read the actual ACPI spec, but I think it's reasonable to wonder why you need another 300 pages to understand the implementation.
Yeah, I may have misinterpreted the question (as "help with APCICA" rather than "help with APCI, I've looked at APCICA and want alternatives").

skyesp, sorry if I was off-handed.
Post Reply