dortania / bugtracker

Dortania Bugtracker
108 stars 7 forks source link

[ACPI-Quirks] SyncTableIds not effective? #316

Closed xXiaoXiang closed 1 year ago

xXiaoXiang commented 1 year ago

[Question description] During my recent attempt to add custom SLIC table by using OpenCore, I found that the SyncTableIds quirk is not effective when I manually insert an SLIC table in the ACPI on a system without native SLIC support. Whether checking the SyncTableIs or not does nothing different to the XSDT table' OEM ID and OEM Table ID. tempsnip

[Personal analysis of the problem] I believe that it's because the quirks are processed before the SLIC table was added so that it did not find any SLIC table to match. Even though my problem may be irrelevant to the main purpose of this bootloader program (i.e., booting a MacOS system), I think it could do an additional backward check which is to check whether any new SLIC table was added, and if so, sync the OEM ID and OEM Table ID to the FCAP and XSDT table (The OEM ID and OEM Table ID in these two table is checked by Windows). Another question is that what did the OpenCore do to the XSDT table? I found that even if I use OpenCore to patch ALL OEM ID and OEM Table ID (by adding a patch to find and replace the corresponding hex of the original IDs to the SLIC's IDs), and after that the OEM ID and OEM Table ID in ALL ACPI tables were changed except the XSDT table: tempsnip2

Maybe the XSDT is generated after the patch process of OpenCore? But where did it get the original OEM ID from? I have changed all the OEM IDs in the ACPI tables.

1Revenger1 commented 1 year ago

You likely want Acidanthera's bugtracker for this. Acidanthera works on OpenCore, we just work on the guides here.

If you are injecting your own SLIC table though, then it likely is an order of operations thing. OpenCore drops tables first, processes quirks, does any patches under ACPI->Patch, then adds ACPI tables. I believe this order is notated in the ACPI section of the Configuration.pdf.

Relevant code section: https://github.com/acidanthera/OpenCorePkg/blob/c4c8e3412a5d9b10dc8ee2739478b85061de71d6/Library/OcMainLib/OpenCoreAcpi.c#L255

I'm not exactly sure if your solution would be accepted. Normally any tables added are not patched, as they can reimplement ACPI methods which were patched away in the Patch section.

xXiaoXiang commented 1 year ago

Thank you for your reply, I think I will put a request on the thing to see if the developer team thinks it worth a fix.