LAI: Lightweight AML Interpreter
Posted: Sun Jul 21, 2019 1:50 pm
While some people on this forum might remember LAI, there is no official announcement thread for it yet. Hence, I am posting this thread to change this fact. While I am the one posting the thread, I want to make clear that LAI is by no means a solo achivement of mine: the original code was written by Nour (formerly known as omarrx024 on this forum). qookie, thomtl, Itay, toor and me did most of the work to bring it into its current shape.
What is LAI? LAI is a portable interpreter library for AML, the ACPI machine language. As such, it is an alternative to the much more heavyweight ACPICA library. Like ACPICA, LAI parses the ACPI tables that contain AML (i.e., the DSDT and SSDT tables), constructs the ACPI namespace, and is able to evaluate nodes (control methods or other objects) of this namespace. Unlike ACPICA, however, LAI a minimal interpreter - it executes AML but it does not provide a full solution to every ACPI-related task. I do not perceive this to be a shortcoming of LAI: instead, when working with ACPICA on managarm, I noticed that the OS kernel often wants to use its own high level code anyway.
What is the current state of LAI? Today, LAI can execute most AML code (but some exotic opcodes might remain unimplemented until someone posts a bug report about encountering them ). As demonstrated by qookie in the screenshot thread, LAI can handle PCI routing on a variety of hardware and on all widely-used VMs. The project is quite active - bug reports are usually fixed within a few days. Thus, while LAI is not as mature as ACPICA, we encourage you to try it out in your own OSes if you are in need of a working ACPI implementation.
The project can be found at: https://github.com/qword-os/lai. You might also want to take a look at our core API documentation. We have Linux-based unit tests and CI for the project at https://github.com/qword-os/lai_tools. Feel free to ask any questions about the project and let us know if you plan to use LAI in your own projects!
What is LAI? LAI is a portable interpreter library for AML, the ACPI machine language. As such, it is an alternative to the much more heavyweight ACPICA library. Like ACPICA, LAI parses the ACPI tables that contain AML (i.e., the DSDT and SSDT tables), constructs the ACPI namespace, and is able to evaluate nodes (control methods or other objects) of this namespace. Unlike ACPICA, however, LAI a minimal interpreter - it executes AML but it does not provide a full solution to every ACPI-related task. I do not perceive this to be a shortcoming of LAI: instead, when working with ACPICA on managarm, I noticed that the OS kernel often wants to use its own high level code anyway.
What is the current state of LAI? Today, LAI can execute most AML code (but some exotic opcodes might remain unimplemented until someone posts a bug report about encountering them ). As demonstrated by qookie in the screenshot thread, LAI can handle PCI routing on a variety of hardware and on all widely-used VMs. The project is quite active - bug reports are usually fixed within a few days. Thus, while LAI is not as mature as ACPICA, we encourage you to try it out in your own OSes if you are in need of a working ACPI implementation.
The project can be found at: https://github.com/qword-os/lai. You might also want to take a look at our core API documentation. We have Linux-based unit tests and CI for the project at https://github.com/qword-os/lai_tools. Feel free to ask any questions about the project and let us know if you plan to use LAI in your own projects!