5T33Z0 / OC-Little-Translated

ACPI Hotpatches and Guides for the OpenCore Bootmanager. Enhance and fine-tune your Hackintosh by adding devices and enabling additional features not covered in the OpenCore Install Guide. Only place that covers how to use OpenCore Legacy Patcher on PCs.
BSD 3-Clause "New" or "Revised" License
524 stars 71 forks source link

[Docs Request] Unified SSDT guide #40

Closed dreamwhite closed 2 years ago

dreamwhite commented 2 years ago

Given that it's pretty useless and counter-productive when debugging, it would be nice to write a small guide that explains how to write a unified SSDT once you're done with your ACPI.

I'll try summing up things:

DefinitionBlock("", "SSDT", 2, "AUTHOR", "HACKSSDT", 0)
{
    #include "SSDT-X.dsl"
    ...

}

Make sure to change AUTHOR and HACKSSDT with your favourite names as well as adding an #include "SSDT-Y.dsl" directive for each SSDT. See the below example:

  1. folder with disassembled SSDTs

image

  1. removed DefinitionBlock for each SSDT. e.g.

image

  1. SSDT with final stuff

image

Please note that in case you're having issue like Existing object has invalid type for Scope operator (_SB.PCI0 [Untyped]) add as an external reference in the final SSDT External (_SB.PCI0, DeviceObj) like below:

image

5T33Z0 commented 2 years ago

Not a fan of unifiying SSDTs into one file. Because this way you can't disable single patches – it's either all or none. You can do this on your fork, I won't support thist here.

Also, Olarila mis-uses this method to sneek in devices which re-brand the "About this Mac section".

dreamwhite commented 2 years ago

Not a fan of unifiying SSDTs into one file. Because this way you can't disable single patches – it's either all or none. You can do this on your fork, I won't support thist here.

That's not a prob for me. Neither do I support this kind of approach, but something like a disclaimer in such cases may be helpful (e.g. "Just use this method once you're done with ACPI patching" or whatever). In any case up to your choice ditching or not, I won't get mad haha

Also, Olarila mis-uses this method to sneek in devices which re-brand the "About this Mac section".

Craprila actually does dogshit work with ACPI. Better not throwing them other insults, they're full of them ahha and hated by any person that has a minimum IQ

5T33Z0 commented 2 years ago

zsh: command not found: iasl

Ditchig this guide since it requires installing iasl in usr/bin which requires write-enabling the system partition on macOS Catalina and newer, showing hidden files etc.

dreamwhite commented 2 years ago

zsh: command not found: iasl

Ditchig this guide since it requires installing iasl in usr/bin which requires write-enabling the system partition on macOS Catalina and newer, showing hidden files etc.

To be honest iasl can be installed in /usr/local/bin without write-enabling the system partition. That's how I installed it since Catalina without risking the system integrity. Otherwise you can add iasl in a custom PATH (e.g. $HOME/.bin/iasl/bin or whatever) but I don't know how many people actually know how to use command line >_>

5T33Z0 commented 2 years ago

Using the SSDT-HPET generated by SSDTTime results in compiling errors:

SSDT-HPET.dsl 25: Name (_SB.PCI0.LPC.HPET._CRS, ResourceTemplate () // _CRS: Current Resource Settings Error 6074 - Name already exists in scope ^ (_SB.PCI0.LPC.HPET._CRS)

Original name creation/declaration below: (_SB.PCI0.LPC.HPET._CRS) SSDT-HPET.dsl 25: Name (_SB.PCI0.LPC.HPET._CRS, ResourceTemplate () // _CRS: Current Resource Settings

SSDT-PNLF.dsl 95: Method (_INI, 0, NotSerialized) // _INI: Initialize Warning 3115 - ^ Not all control paths return a value (_SB.PCI0.IGPU.PNLF._INI)

ASL Input: SSDT-ALL.dsl - 544 bytes 316 keywords 21 source lines

Compilation failed. 1 Errors, 1 Warnings, 0 Remarks No AML files were generated due to compiler error(s) 5t33z0@MacBook-Pro ACPI %

dreamwhite commented 2 years ago

Using the SSDT-HPET generated by SSDTTime results in compiling errors:

SSDT-HPET.dsl 25: Name (_SB.PCI0.LPC.HPET._CRS, ResourceTemplate () // _CRS: Current Resource Settings Error 6074 - Name already exists in scope ^ (_SB.PCI0.LPC.HPET._CRS)

Original name creation/declaration below: (_SB.PCI0.LPC.HPET._CRS) SSDT-HPET.dsl 25: Name (_SB.PCI0.LPC.HPET._CRS, ResourceTemplate () // _CRS: Current Resource Settings

SSDT-PNLF.dsl 95: Method (_INI, 0, NotSerialized) // _INI: Initialize Warning 3115 - ^ Not all control paths return a value (_SB.PCI0.IGPU.PNLF._INI)

ASL Input: SSDT-ALL.dsl - 544 bytes 316 keywords 21 source lines

Compilation failed. 1 Errors, 1 Warnings, 0 Remarks No AML files were generated due to compiler error(s) 5t33z0@MacBook-Pro ACPI %

can you send me your ACPI folder as well as the unified dsl file?

5T33Z0 commented 2 years ago

ACPI_T530.zip

dreamwhite commented 2 years ago

Alright. I have a question: what happens if you disable HPET device like I did here?

dreamwhite commented 2 years ago

Oh wait, I found out why you're having problems: you added twice SSDT-HPET.dsl. Here you are the fixed SSDT: ACPI_T530.zip

5T33Z0 commented 2 years ago

Thanks. I tested the resulting SSDT. The system boots noticeably slower than using individual SSDTs.

Ditching this for real now. Sorry.

dreamwhite commented 2 years ago

Thanks. I tested the resulting SSDT. The system boots noticeably slower than using individual SSDTs.

Ditching this for real now. Sorry.

ouch! I haven't noticed yet any difference but way better ditching for now... Sorry if I lost time for this haha but still worth it learning new stuff

5T33Z0 commented 2 years ago

Maybe it boots faster if you re-organize the structure of the entries so the hierarchy is correct, but this takes forever. And it's pretty much guarenteed that novice users will eff this up.

5T33Z0 commented 2 years ago

Done: https://github.com/5T33Z0/OC-Little-Translated/blob/main/N_SSDT-ALL/README.md

dreamwhite commented 2 years ago

Done: https://github.com/5T33Z0/OC-Little-Translated/blob/main/N_SSDT-ALL/README.md

Thank you so much. In case you wanna debug the slower boot times maybe we can discuss about it later on Discord (dreamwhite#0362 is my tag)