Page 1 of 1

Rust acpi crate erroring with RsdpIncorrectSignature

Posted: Mon Sep 15, 2025 9:48 am
by AlulaTheDev
So I've been trying to learn OSDev for a while and keep getting stuck to the point I have to do fundemental rewrites, the latest of which moved my kernel from C to rust. I am using the acpi crate and I have implemented a handler, but I always error during init with RsdpIncorrectSignature.

https://github.com/AlulaOneshot/kobold/ ... ev/acpi.rs
Linked is the offending file. I will be actively monitoring this thread until 12:20. After which I will passively monitor. Help would be greatly appreciated.

Re: Rust acpi crate erroring with RsdpIncorrectSignature

Posted: Mon Sep 15, 2025 10:42 am
by Octocontrabass
AlulaTheDev wrote: ↑Mon Sep 15, 2025 9:48 amLinked is the offending file.
That doesn't look like Rust to me.
AlulaTheDev wrote: ↑Mon Sep 15, 2025 9:48 amI will be actively monitoring this thread until 12:20.
This is a forum, we don't expect you to reply immediately. (And how are we supposed to know what time zone you're in?)

Re: Rust acpi crate erroring with RsdpIncorrectSignature

Posted: Mon Sep 15, 2025 10:48 am
by AlulaTheDev
EST. forgot to specify

Re: Rust acpi crate erroring with RsdpIncorrectSignature

Posted: Mon Sep 15, 2025 10:51 am
by AlulaTheDev
Octocontrabass wrote: ↑Mon Sep 15, 2025 10:42 am
AlulaTheDev wrote: ↑Mon Sep 15, 2025 9:48 amLinked is the offending file.
That doesn't look like Rust to me.
AlulaTheDev wrote: ↑Mon Sep 15, 2025 9:48 amI will be actively monitoring this thread until 12:20.
This is a forum, we don't expect you to reply immediately. (And how are we supposed to know what time zone you're in?)
I am an idiot and linked the old one (as I said I rewrite a lot)
Here is the correct file
https://github.com/AlulaOneshot/kobold/ ... ev/acpi.rs

Re: Rust acpi crate erroring with RsdpIncorrectSignature

Posted: Mon Sep 15, 2025 11:42 am
by Demindiro
I'm not familiar with limine, but my first thought was that static signifies immutable by default, which could be an issue. However, Response<T> uses an UnsafeCell inside, so that should not be an issue.

The second thing I'd check then is whether the response contains the expected values. If it is all zeroes or some other bogus value it's probably wrong.

It looks like you're mapping in pages at the time of request. Personally, I set up an identity mapping of all memory (as reported by UEFI) since I find it much easier to work with as you just need to return the address + a constant offset.

I would also copy the dbg!() macro from Rust's std, it's very useful.

Re: Rust acpi crate erroring with RsdpIncorrectSignature

Posted: Mon Sep 15, 2025 12:00 pm
by AlulaTheDev
It is returning a correct looking RSDP

Re: Rust acpi crate erroring with RsdpIncorrectSignature

Posted: Tue Sep 16, 2025 6:56 am
by AlulaTheDev
I have decided to use uacpi instead, disregard this thread

Re: Rust acpi crate erroring with RsdpIncorrectSignature

Posted: Tue Sep 16, 2025 9:29 am
by Demindiro
FWIW I use acpi v5.2.0 and it works fine for me, both in QEMU and real hardware (last I checked, anyway). Are you sure that the RSDP is intact? One possibility that I forgot to consider is that you may inadvertently be corrupting it somehow, e.g. by accidentally marking it as unallocated.