From nobody Tue Oct 7 13:55:37 2025 X-Original-To: dev-commits-doc-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cgyMY1z7gz6BKqk for ; Tue, 07 Oct 2025 13:55:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cgyMY1W1Cz3N2s; Tue, 07 Oct 2025 13:55:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759845337; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jib8uM+NjYvAXvywaBSfe26czg/s1RulCNyW18kNMZA=; b=XV/QfzpvZFBFem7k5ffDc9iQOtXQUbaR+3Kgqr9WlD/3gd1x3AGmieWeucTKfxmvzLaVcb fYWv13h5ABK6aS3vkUKQ/jXkPV4qmJX/Ha3IvPp/b9Rqe/IruGYehor74DJvVZ/htpO99d YOVmXrPwayOUqUbww6R678ytpgmae741OixdhNiCic8FXYGZuB8/iQOW1/5xMb2W7nD4wq 2k0Ofz+Y9Sbro6ZhpPz28hAxrZap6lg5PjPLNmRHB5AtvVMRaJBafT/q0O6fpHOwBFsPcE wXiSojH/wg53apT8mT7Al9/d7d+Ht8cd5NwW9Rc+sDQr+8NTSU7cDeDyaGPQfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759845337; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jib8uM+NjYvAXvywaBSfe26czg/s1RulCNyW18kNMZA=; b=gLQugVNNN/XO2LOtIMJ7Mw6W4koA5SBYAqt6kHl4bTefzecYgabYDYpDTpuO1KdH3T86oO fjs3gmw1NrmuqtGVC2o4QvgupPPd0mpgGd7PCfA7+/ylG9YNC0eoZUkUwc79TgUzfsuu6o gQYrf2+At5QUb1n3Y6744dx4v3fMPCHApiXl5FiNCj3bGrMMnTC5Z2Kt/xxI8qcwC7DS4z Ij1aZ80oeqRyilR8xatjZ3KfxKl0vPxEJVah6No/wRNEd51ruLELYMKXo5z59nMVFnBVMj aQ39N+jxguAwye8PQcAZxdyhpRE1ErCercrcNenPw13XcikhSIMA926D1bfCgw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759845337; a=rsa-sha256; cv=none; b=DHniXJiMsdfhIsENpSg1C0HKeGOnI0mftwzd7pdDqOo4CI1AOc5G88L0kivjFhMJLBncjl anI8pa8WubS12JHs/seG3UzsvUHpsWY/ASnTebbSgry+GRPQnTlzPXPzBln39UPSRkvUz0 hYezvMNyiJ3sYNSyliqcDXLmb1HYRAIXLFz2smhdH8WLX9tdQnx8XikcfejmGSNtAJPvJa VeIzno15NIlochOf5S8PTDf+CM9CCAATiYb0rMwziMGEYwgoYb8S7AKThe68KbSA/19aQB iqUu/saa7M48YpUH7CTiDD25Ercw9gL2P4PdCCDxry1SgLS9Kf3UABnSVvaO5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cgyMY0vjSzp4s; Tue, 07 Oct 2025 13:55:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 597DtbCn092953; Tue, 7 Oct 2025 13:55:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 597DtbEZ092950; Tue, 7 Oct 2025 13:55:37 GMT (envelope-from git) Date: Tue, 7 Oct 2025 13:55:37 GMT Message-Id: <202510071355.597DtbEZ092950@gitrepo.freebsd.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Lorenzo Salvadore Subject: git: 0b79d53a43 - main - Status/2025Q3/ACPI.adoc: Add report List-Id: Commit messages for all branches of the doc repository List-Archive: https://lists.freebsd.org/archives/dev-commits-doc-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-doc-all@freebsd.org Sender: owner-dev-commits-doc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: salvadore X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0b79d53a431d329fcd7e952f5fd6666fc0e87a13 Auto-Submitted: auto-generated The branch main has been updated by salvadore: URL: https://cgit.FreeBSD.org/doc/commit/?id=0b79d53a431d329fcd7e952f5fd6666fc0e87a13 commit 0b79d53a431d329fcd7e952f5fd6666fc0e87a13 Author: Kayla Powell AuthorDate: 2025-10-07 13:51:43 +0000 Commit: Lorenzo Salvadore CommitDate: 2025-10-07 13:54:52 +0000 Status/2025Q3/ACPI.adoc: Add report Reviewed by: Chris Moerz --- .../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) + +Mentor: Warner Losh + +==== Introduction + +For Google Summer of Code 2025, I have been working on a project under mailto:imp@FreeBSD.org[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