git: 0b79d53a43 - main - Status/2025Q3/ACPI.adoc: Add report

Lorenzo Salvadore <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.doc
Message-ID <[email protected]>
The branch main has been updated by salvadore:

URL: https://cgit.FreeBSD.org/doc/commit/?id=0b79d53a431d329fcd7e952f5fd6666fc0e87a13

commit 0b79d53a431d329fcd7e952f5fd6666fc0e87a13
Author:     Kayla Powell <[email protected]>
AuthorDate: 2025-10-07 13:51:43 +0000
Commit:     Lorenzo Salvadore <[email protected]>
CommitDate: 2025-10-07 13:54:52 +0000

    Status/2025Q3/ACPI.adoc: Add report
    
    Reviewed by:    Chris Moerz <[email protected]>
---
 .../en/status/report-2025-07-2025-09/ACPI.adoc     | 80 ++++++++++++++++++++++
 1 file changed, 80 insertions(+)

diff --git a/website/content/en/status/report-2025-07-2025-09/ACPI.adoc b/website/content/en/status/report-2025-07-2025-09/ACPI.adoc
new file mode 100644
index 0000000000..14a2f67524
--- /dev/null
+++ b/website/content/en/status/report-2025-07-2025-09/ACPI.adoc
@@ -0,0 +1,80 @@
+=== ACPI Lua Bindings
+
+Links: +
+link:https://www.github.com/kpowkitty/freebsd-src[Github] URL: link:https://www.github.com/kpowkitty/freebsd-src[] +
+link:https://www.github.com/freebsd/freebsd-src/pull/1740[PR: libsa: Add isprint()] URL: link:https://www.github.com/freebsd/freebsd-src/pull/1740[] +
+link:https://www.github.com/freebsd/freebsd-src/pull/1843[PR: loader: Move ACPI RSDP detection] URL: link:https://www.github.com/freebsd/freebsd-src/pull/1843[] +
+link:https://www.github.com/freebsd/freebsd-src/pull/1818[PR: efi: Create libacpi] URL: link:https://www.github.com/freebsd/freebsd-src/pull/1818[] +
+link:https://www.github.com/freebsd/freebsd-src/pull/1819[PR: liblua: ACPICA Lua bindings] URL: link:https://www.github.com/freebsd/freebsd-src/pull/1819[]
+
+Contact: Kayla Powell (AKA Kat) <[email protected]> +
+Mentor: Warner Losh <[email protected]>
+
+==== Introduction
+
+For Google Summer of Code 2025, I have been working on a project under mailto:[email protected][Warner Losh] for ACPI Lua Bindings.
+ACPI (Advanced Power and Configuration Interface) is an interface for managing power in the OS, rather than in the BIOS.
+The goal is to expose ACPI to Lua in the loader for amd64 platforms, with future arm64 support.
+
+==== Outcomes
+
+* Lua is a much simpler, higher level scripting language that enables faster development.
+* It reduces ACPI-related guesswork in the bootloader.
+* It allows users to query and manipulate ACPI data before the kernel is entered, giving them control over loader-time configuration.
+
+==== Remarks
+
+If there are any specialized use cases for ACPI in the loader that my interface does not aid in, please reach out to me, and I will see what I can do.
+For now, this is the interface that I will be committing to the tree for GSoC, so while any extra work will have to come afterwards, I am interested in it (and encourage it).
+
+==== Current status
+
+* Completed:
+** ACPICA initialized in loader for amd64
+*** [.filename]#OsdMemory.c#
+*** [.filename]#osunixxf.c#
+*** AcpiInitializeSubsystem
+*** AcpiInitializeTables
+*** AcpiEnableSubsystem (in reduced hardware mode, with events enabled)
+*** AcpiLoadTables
+*** AcpiWalkNamespace
+*** AcpiEvaluateObject
+*** AcpiAttachData
+*** AcpiGetData
+*** AcpiDetachData
+** Lua bindings
+*** [.filename]#lacpi_walk.c#
+**** Users can walk and read nodes on the namespace
+*** [.filename]#lacpi_object.c#
+**** Users can evaluate objects
+*** [.filename]#lacpi_data.c#
+**** Users can attach, get, and detach data from nodes
+*** Man Page
+* Future plans:
+** [.filename]#lacpi_walk.c# (V2)
+*** Namespace printout format
+** [.filename]#lacpi_walk.c# (V3)
+*** Strategies for walking the namespace
+** arm64 compat
+
+==== Design constraints
+
+The loader is meant to be lightweight and prepare the kernel.
+In order to adhere to that, its initialization of ACPI has been reduced by 130 functions.
+These functions were picked such that they were not necessary for the above interface, or lacked possibility in the loader.
+They are:
+
+* AcpiInitializeObjects
+* AcpiInstallNotifyHandler
+* AcpiRemoveNotifyHandler
+
+Some functions needed to be stubbed in respect to the loader's limited library (specifically in [.filename]#osunixxf.c#).
+Some functions needed to handle physical addresses, rather than virtual memory mappings (specifically in [.filename]#OsdMemory.c#).
+
+==== Testing
+
+* Confirmation tests were performed, demonstrating that the ACPI namespace is initialized correctly by dumping it in the loader (in C and in Lua) and in the kernel (in C) and comparing the results.
+* Regression tests were performed, ensuring FreeBSD builds across all architectures with this change.
+* Unit tests were performed on the Lua bindings, verifying their functionality.
+
+Sponsor: Google Summer of Code 2025
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.