New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lay out new architecture for acpi, allowing separation of table discovery and parsing #75
Conversation
Separating the parsing of the ACPI tables sounds like a good idea to me. A couple of notes about the implementation:
|
Thanks very much for the review @phil-opp - great points :) I've rewritten the documentation to be up to date and hopefully be more helpful than it was before the rewrite. Providing the
I still need to migrate the RSDP search over to the new types, but after that this should be ready for a release candidate to be published. I think letting it bake for a few weeks after that is probably wise to allow any issues to crop up before publishing |
Sounds great! Regarding the RSDP search: Have you thought about moving the detection of the physical RSDP address to a separate crate that does not depend on |
That's an interesting idea - it would definitely be cool to see I've split the If this works for you, I'll get |
Awesome, thanks a lot! I just moved the bootloader prototype to the |
Great! I've published |
FWIW, I am still interested. I have just been very busy with life. Thanks for jumping into this. I haven't really looked, but I think it's great to see action here. :) |
This is something we've wanted for a while, as it removes the human error of forgetting to unmap a physical mapping. Having to store the `H` does make some things a bit janky, but we seem to have been able to work around it so far.
This is a pretty rough implementation, but it's strangely difficult to get it to move the handler from the old mapping into the new, since it apparently can't work out that the `H` is going to be the same size in both types. This works.
This is at the heart of the new architecture - we now collect all the ACPI tables without dispatching them ourselves. This makes the library more flexible, at the cost of an extra step if you don't care about which tables you have, but it's turned out much cleaner than I'd hoped overall. Unfortunately the diff algorithm has butchered this, so this is kinda messy.
This is a new (to QEMU) table that isn't detailed in the current version of the ACPI spec. Not sure when Microsoft dreampt it up, but it looks like it was added to QEMU earlier this year.
One of the problems with the new architecture is that to get a nice view of the topology and interrupt model, we need to get a bunch of "unrelated" info out of a couple of the tables. We encapsulate this in `PlatformInfo`, which amalgamates the FADT and MADT into some common info.
* Convenience method `AcpiTables::platform_info` added to aid discoverability * Deny unsafe ops in unsafe fn * Fix errors created by that lint * Make method in MADT private, as it's called as an implementation detail * Remove unneeded Rsdp::oem_id method. We should probably work out some way of exposing OEM details, but so few people probably care about it, it seems a waste to heap-alloc a string for it just in case.
This is just a convenience method that makes it easier to construct an AcpiTables by searching for it on BIOS platforms. It outsources to the `rsdp` crate.
* Note the `rsdp` crate in the documentation of `acpi` * Publish version 2.0.0!
@wt No worries, it would be great to see this integrated into Redox if/when you find the time. Let us know how it goes :) Published as |
This lays out a first draft for a new architecture for the
acpi
crate, which may be published asv2.0.0
. It is the implementation I've reached after discussions in #74 about how theacpi
crate could be more accomodating to OSs that want to separate the discovery and parsing of the ACPI tables between various stages, notably between kernelspace and userspace.cc @wt are you still interested in these changes? What do you think about this potential design, and do you think it would be compatible with Redox's needs?
cc @rust-osdev/acpi for anyone who is interested in as large a change as this one
I'm afraid the diffing algorithm has not treated this kindly, so the diffs aren't the easiest to read. Feel free to ask questions if anything is unclear / I've missed anything :)