Contribute
Register

[Guide] Patching LAPTOP DSDT/SSDTs

...
Everything worked.
However I did not notice in the boot log the message of disabling nvidia...

It may not be working 100% then.... The nvidia drivers should not load (not even enough to process nv_disable=1).

At any rate, once again many thanks to all your help and patience with me. If one thing should be added to your tutorial in the beginning of this thread or your new tutorial, in my opinion should be "to watch for region address changes" and "how to avoid them.

Yeah... maybe. Most would not understand what the heck that means though...
 
It may not be working 100% then.... The nvidia drivers should not load (not even enough to process nv_disable=1).



Yeah... maybe. Most would not understand what the heck that means though...

Nothing is loaded, I checked the IORegistry and Also about Mac. I will post a new IORegistry dump if you wish, or if you want to examine it differently please tell me how or give me the commands I will do them and post the result.
 
Nothing is loaded, I checked the IORegistry and Also about Mac. I will post a new IORegistry dump if you wish, or if you want to examine it differently please tell me how or give me the commands I will do them and post the result.

Post ioreg. Actually... and patchmatic output. I'd like to use your files as a guide as they have all the complexities you'd run into. Native Clover F4 files too, I suppose.
 
Post ioreg. Actually... and patchmatic output. I'd like to use your files as a guide as they have all the complexities you'd run into. Native Clover F4 files too, I suppose.
Here you are:
 

Attachments

  • Rehabman05112010.zip
    1.1 MB · Views: 73
Here you are:

Nvidia is definitely off... it does not even appear on the PCIe bus.

Mission accomplished.... Now you can move onto other things.

Suggestions:
- implement native power management
- remove GenericUSBXHCI.kext to use AppleUSBXHCI.kext instead
- finish implementing HDMI-audio
- proper trackpad driver
- wifi/bluetooth (requires hardware replacement)

I don't think you provided 'patchmatic -extract' output from your live running system...
 
Nvidia is definitely off... it does not even appear on the PCIe bus.

Mission accomplished.... Now you can move onto other things.

Suggestions:
- implement native power management
- remove GenericUSBXHCI.kext to use AppleUSBXHCI.kext instead
- finish implementing HDMI-audio
- proper trackpad driver
- wifi/bluetooth (requires hardware replacement)

I don't think you provided 'patchmatic -extract' output from your live running system...

Sorry, here it is.

And yes, now I will attack the rest, my problem is finding a replacement for wifi/bluetooth as I do not know which one would fit the bill. also I am very inexperienced with HDMI-audio, but the good news is I know where to go to get help :).
Once again many thanks and if I could provide you any material for your tutorial please do not hesitate let me know, I will do my best to get them to you; The best way is to send me an email.
 

Attachments

  • missingPatchmatic.zip
    51.3 KB · Views: 86
Hi, Mr. RehabMan. I met a error in dsdt. And the code is:
HTML:
Store (\_GPE.MMTB (Local2, \_GPE.OSUP (Local2)), Store (Local1, REG6))
Store (\_GPE.MMTB (Local3, \_GPE.OSUP (Local3)), Store (Local2, REG6))

According to the context, I guess it should be:
HTML:
\_GPE.MMTB (REG6)\_GPE.OSUP (REG6)Store (Local1, REG6)
\_GPE.MMTB (REG6)\_GPE.OSUP (REG6)Store (Local2, REG6)

I made a patch for it:
HTML:
into_all all code_regex Store\s\(\\_GPE.MMTB\s\(Local2,\s\\_GPE.OSUP\s\(Local2\)\),\sStore\s\(Local1,\sREG6\)\) replace_matched begin \\_GPE.MMTB (REG6)\n\\_GPE.OSUP (REG6)\nStore (Local1, REG6) end;into_all all code_regex Store\s\(\\_GPE.MMTB\s\(Local3,\s\\_GPE.OSUP\s\(Local3\)\),\sStore\s\(Local2,\sREG6\)\) replace_matched begin \\_GPE.MMTB (REG6)\n\\_GPE.OSUP (REG6)\nStore (Local2, REG6) end;[ATTACH]137034.vB[/ATTACH]

I'm not sure if it right or not. And here is the dsdt.dsl.
View attachment DSDT_MMTB_OSUP_Error.zip
 
Hi, Mr. RehabMan. I met a error in dsdt. And the code is:
HTML:
Store (\_GPE.MMTB (Local2, \_GPE.OSUP (Local2)), Store (Local1, REG6))
Store (\_GPE.MMTB (Local3, \_GPE.OSUP (Local3)), Store (Local2, REG6))

According to the context, I guess it should be:
HTML:
\_GPE.MMTB (REG6)\_GPE.OSUP (REG6)Store (Local2, REG6)
\_GPE.MMTB (REG6)\_GPE.OSUP (REG6)Store (Local2, REG6)

I made a patch for it:
HTML:
into_all all code_regex Store\s\(\\_GPE.MMTB\s\(Local2,\s\\_GPE.OSUP\s\(Local2\)\),\sStore\s\(Local1,\sREG6\)\) replace_matched begin \\_GPE.MMTB (REG6)\n\\_GPE.OSUP (REG6)\nStore (Local1, REG6) end;into_all all code_regex Store\s\(\\_GPE.MMTB\s\(Local3,\s\\_GPE.OSUP\s\(Local3\)\),\sStore\s\(Local2,\sREG6\)\) replace_matched begin \\_GPE.MMTB (REG6)\n\\_GPE.OSUP (REG6)\nStore (Local2, REG6) end;[ATTACH]137034[/ATTACH]

I'm not sure if it right or not. And here is the dsdt.dsl.
View attachment 137034

Your translation is not correct.

In order to disassemble it correctly based on the incorrectly output from iasl, you need a little knowledge of the internal AML format, how iasl works, and some ability to disassemble it properly in your head...

So if we take just the first line of your example (the second one was no doubt a second instance of the same code, but using Local3 instead of Local2):
Code:
Store (\_GPE.MMTB (Local2, \_GPE.OSUP (Local2)), Store (Local1, REG6))

Disassembling it (in your head) under the assumption that MMTB takes zero parameters. Strategy is "keep the opcodes", "consume the operands as required by the opcodes":
Code:
//Store (\_GPE.MMTB (Local2,
[B]Store(\_GPE.MMTB(), Local2)[/B]

//\_GPE.OSUP (Local2)).
[B]\_GPE.OSUP(Local2)[/B]

// Store (Local1, REG6)
[B]Store(Local1, REG6)[/B]

The error is caused because iasl guesses incorrectly about the number of parameters for _GPE.MMTB. It guesses two. Actual params is zero.

You can create refs.txt:
Code:
External(\_GPE.MMTB, MethodObj, 0)

And then disassemble giving iasl this extra hint...
Code:
iasl -fe refs.txt -da -dl *.aml

The correctly disassembled code (from iasl, not my head this time) is this:
Code:
                Store (\_GPE.MMTB (), Local2)
                \_GPE.OSUP (Local2)
                Store (Local1, REG6)

This same code was in my DSDT for the HP Envy and my u430, and refs.txt comes from my current Envy and u430 repos...

Adding a bit of context, you can see the intention of the code:
Code:
                Store (REG6, Local1)  // save REG6
                Store (0x00F0F000, REG6) // set REG6 to fixed value
                Store (\_GPE.MMTB (), Local2) // retrieve value from MMTB
                \_GPE.OSUP (Local2) // call OSUP with it
                Store (Local1, REG6)  // restore REG6 to original value

Or, re-written a bit:
Code:
                Store (REG6, Local1)  // save REG6
                Store (0x00F0F000, REG6) // set REG6 to fixed value
                \_GPE.OSUP (\_GPE.MMTB ()) // call OSUP with MMTB return
                Store (Local1, REG6)  // restore REG6 to original value

On the Envy and my u430, the whole block is protected by:
Code:
            If (LOr (LEqual (BID, BICO), LEqual (BID, BICC)))
            {
...

On my u430, I used ACPIDebug to determine if the condition involving BID was true. It was false. So the code will never execute, which is a good thing... because MMTB is not defined anywhere (it is probably in Windows) and the code is not protected with CondRefOf. So if it were executed it would cause the _WAK method to prematurely terminate (ACPI abort), which would mean code following the MMTB reference in _WAK would not be executed as it should.
 
Wow, thank you for your explanations. I have learn a lot.

And, the laptop is Lenovo Z50. It also has a SSDT that exists many errors (a PTID SSDT). According to your thread, it is useless for hackintosh, so we can just drop it. But I wonder if this file can be fixed.:D
View attachment SSDT-0_PTID.zip
 
Wow, thank you for your explanations. I have learn a lot.

And, the laptop is Lenovo Z50. It also has a SSDT that exists many errors (a PTID SSDT). According to your thread, it is useless for hackintosh, so we can just drop it. But I wonder if this file can be fixed.:D
View attachment 137037

There's no fixing it. And you don't need it anyway... so just drop it.
 
Back
Top