acidanthera / bugtracker

Acidanthera Bugtracker
385 stars 44 forks source link

OpenCore not appying ACPI patches when use custom DSDT.aml #2175

Closed Drovosek01 closed 1 year ago

Drovosek01 commented 1 year ago

I return to the problem of why ACPI renaming patches to OpenCore were not applied. https://github.com/acidanthera/bugtracker/issues/2174

Experimentally, it was found out that ACPI patches are not applied if you use your custom DSDT in the folder with OC/ACPI. Why? Is it written about this somewhere in the documentation? (I didn't find information there that ACPI patches won't be applied when using custom DSDT) https://github.com/acidanthera/OpenCorePkg/blob/master/Docs/Configuration.pdf

It seems that the OpenCore developers mean that since we use a custom DSDT, then we have already done all the renaming ourselves with pens? But again, this implication is not written anywhere.

On my x79 macOS Monterey does not start the first time, unless you remove the extra sockets and cores/processors in DSDT. I conducted experiments on the official OpenCore 0.87 Debug

P.S. In version 0.87, they put Sample.plist, which gives an error in ocvalidate, because the ShowPicker key is not of the boolean type there

vit9696 commented 1 year ago

I downloaded 0.8.7 from the releases page (https://github.com/acidanthera/OpenCorePkg/releases) and checked Sample.plist and SampleCustom.plist with ocvalidate. Both contain no issues. I am afraid it is a problem on your side:

user@anisadenia OpenCore-0.8.7-DEBUG % cd Utilities/ocvalidate 
user@anisadenia ocvalidate % ls
README.md       ocvalidate      ocvalidate.exe      ocvalidate.linux
user@anisadenia ocvalidate % ./ocvalidate ../../Docs/Sample.plist 

NOTE: This version of ocvalidate is only compatible with OpenCore version 0.8.7!

Completed validating ../../Docs/Sample.plist in 1 ms. No issues found.
user@anisadenia ocvalidate % ./ocvalidate ../../Docs/SampleCustom.plist 

NOTE: This version of ocvalidate is only compatible with OpenCore version 0.8.7!

Completed validating ../../Docs/SampleCustom.plist in 1 ms. No issues found.
user@anisadenia ocvalidate % xattr -cr /Users/user/Downloads/OpenCore-0.8.7-RELEASE.zip 
user@anisadenia ocvalidate % ./ocvalidate ~/Downloads/OpenCore-0.8.7-RELEASE/Docs/SampleCustom.plist 

NOTE: This version of ocvalidate is only compatible with OpenCore version 0.8.7!

Completed validating /Users/user/Downloads/OpenCore-0.8.7-RELEASE/Docs/SampleCustom.plist in 1 ms. No issues found.
user@anisadenia ocvalidate % ./ocvalidate ~/Downloads/OpenCore-0.8.7-RELEASE/Docs/Sample.plist      

NOTE: This version of ocvalidate is only compatible with OpenCore version 0.8.7!

Completed validating /Users/user/Downloads/OpenCore-0.8.7-RELEASE/Docs/Sample.plist in 1 ms. No issues found.

As for the order of the ACPI changes, they are documented on the first page of the ACPI section 4.1:

ACPI changes apply globally (to every operating system) with the following effective order: • Delete is processed. • Quirks are processed. • Patch is processed. • Add is processed.

There also is an explanation why it works this way:

Applying the patches early makes it possible to write so called “proxy” patches, where the original method is patched in the original table and is implemented in the patched table.

I understand that you have difficulties with your setup, and I hope that you can also understand that this is a bugtracker, not a support forum. You are to ask for help on the support forums, not here.

Drovosek01 commented 1 year ago

Thank you for paying attention @vit9696

I already understood about the procedure for applying patches in conjunction with SSDT, but now the problem is different: If I put the DSDT.aml file in /EFI/OC/ACPI, then all ACPI patches that are written and included in the config are not applied. I checked this using the example of the SAT0 renaming patch to SATA and tracked the changes in the IORegistryExplorer application.

Can someone also experiment as follows:

  1. If you are not using a custom DSDT, then extract it via SysReport or Clover
  2. Fix compilation errors in DSDT, if any, and compile DSDT (save to .aml file)
  3. Move DSDT.aml to /EFI/OC/ACPI and enable it in the config
  4. Check if there is a "Device (SAT0)" or "Device (PIC)" in DSDT
  5. If there is a SAT0 device, then check the presence of SAT0 in IORegistryExplorer and add a patch renaming SAT0 to SATA to the config (here you can find the patch code itself - https://applelife.ru/threads/optimizacija-dsdt-novejshij-kompiljator.31891/page-175#post-1021278 )
  6. Reboot with NVRAM reset and check the availability of SATA in IORegistryExplorer

As I already wrote - my patch is not executed in the presence of a custom DSDT.aml

I can record a video demonstration of all my actions if it helps the investigation and this bug is fixed in OpenCore

vit9696 commented 1 year ago

SSDT or DSDT do not matter. All the patches apply before injecting any table.

andreszerocross commented 1 year ago

ACPI patch will not be applied if you use custom ACPI.

If you use custom DSDT.aml in EFI/OC/ACPI then all patch of ACPI will not affect to your custom DSDT.aml because patch only applied to original DSDT.aml table. Original DSDT.aml will be overidden by your custom DSDT.aml.

All patch only will be applied to original acpi table only. This work since long ago for OpenCore

Drovosek01 commented 1 year ago

SSDT or DSDT do not matter. All the patches apply before injecting any table.

All patch only will be applied to original acpi table only. This work since long ago for OpenCore

Thanks for the clarification. Now I understand.

If you have the opportunity, please add this in plain text (information that if a custom DSDT is used, then it should be completely fixed, because renaming patches will not affect it)