serenity
serenity copied to clipboard
Userland: Add starter AML parser for ACPI data
Begining of a parser for the newly exposed DSTS table in /sys/firmware/acpi. It only implements one opcode, making it possible to partially parse the DSTS table in my computer/qemu.
Hopefully the parser can be extended into an interpreter and used by the kernel to get the correct APCI data.
There is lots of debug output at the moment, most of it will be removed as the parser grows
I am not against building the ACPI code in userland as long as we are standing clear on that it's only temporary (so we will need to make a library to ensure it happens). ACPI AML parsing should be allowed to be done in userland, to aid debugging of the AML, but the actual parsing for doing power management stuff should happen only in the kernel space (we are not building a microkernel here, and despite the advertisements of how safe a microkernel is, I am still not convinced that if badly written AML, or even worse, malicious AML blob was inserted, that an actual separation will help anyway here), therefore to prevent code duplication, a library with the code being implemented there is the best approach.
I am not against building the ACPI code in userland as long as we are standing clear on that it's only temporary (so we will need to make a library to ensure it happens). ACPI AML parsing should be allowed to be done in userland, to aid debugging of the AML, but the actual parsing for doing power management stuff should happen only in the kernel space (we are not building a microkernel here, and despite the advertisements of how safe a microkernel is, I am still not convinced that if badly written AML, or even worse, malicious AML blob was inserted, that an actual separation will help anyway here), therefore to prevent code duplication, a library with the code being implemented there is the best approach.
I agree 100%! That has been my intention from the beginning. But kernels are also scary to begin in. Userspace comfy :-)
Feel free to use my branch of an AML parsing implementation I tried about a year ago - https://github.com/supercomputer7/serenity/commits/aml-revised
Sorry for not being very straightforward. Hope you appreciated to use more Serenity's C++
No problem! I'm very happy to get a deep review, especially since this is a new application.
This has conflicts.
In the commit message please change to the following pharses:
it possible to partially parse the DSTS table in my computer/qemu.
=> it possible to partially parse the DSDT table in my computer/qemu.
most of it will be removed as the parser grows
=> most of it will be removed as the parser grows.
In the commit message please change to the following pharses:
it possible to partially parse the DSTS table in my computer/qemu.
=>it possible to partially parse the DSDT table in my computer/qemu.
most of it will be removed as the parser grows
=>most of it will be removed as the parser grows.
Commit message has been updated with your comments
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions!
Typo in commit message:
Begining of a parser for the newly exposed DSDT table in
Begining > beginning
Typo in commit message:
Begining of a parser for the newly exposed DSDT table in
Begining > beginning
Typo has been fixed and rebased to master
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions!
That's not stale!
Hello!
One or more of the commit messages in this PR do not match the SerenityOS code submission policy, please check the lint_commits
CI job for more details on which commits were flagged and why.
Please do not close this PR and open another, instead modify your commit message(s) with git commit --amend and force push those changes to update this PR.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions!
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions!
2023-06-24 12:19 https://discord.com/channels/830522505605283862/830525093905170492/1122108854147240038
IdanHo: We generally don't merge PRs that don't add any new functionality ('dead code'), since there's no guarantee anyone will eventually come and expand on it in future PRs (especially for new contributors) to make it useful in some way I didnt throughly review your PR, but it seems like what it does add would be below my personal threshold for dead code. IdanHo: Note that it does not mean that the single commit in that PR should necessarily be larger, it can also just be more commits in the same PR, that bring it to some more functional state
me_minus: My idea is to first write an AML to ASL decompiler and then a ASL to AML compiler. After that some kind of interpreter (in userspace) and lastly refactor a library that can run AML in kernelspace (and still be usable in userspace)
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions!
This pull request has been closed because it has not had recent activity. Feel free to re-open if you wish to still contribute these changes. Thank you for your contributions!