Jump to content

DSDT editor and patcher


oldnapalm
 Share

999 posts in this topic

Recommended Posts

el coniglio,

 

Thanks for the updated patches and the time you have put into this project.

 

oldnapalm,

 

Thank you to for the help and for all the hard work you put into this project.

 

 

 

 

Have a question about the main difference between these EHCI scripts. Will either one accomplish the same thing and work on the D830?

 

I tired both and I did not see any difference.

 

I still have the USB Insertion Error upon wak so nether one of those scripts fix this issue yet it does work for the M1530?

 

First one was written by Slice for the D830/D630 and the second EHCI script written by Brett for the M11330.

 

Keep in mind though both the D830/D630 and M1330/M1530 are basically the same 965P chipsets etc, The 8400M Nvidia card in the M1330 is the same chipset Nvidia card in the D830 NVS QUadra 140M. Both are the Nvidia 7300GT chipset.

 

 

 

SLice's D830 EHCI Script:

 

Device (EHCI)

{

Name (_ADR, 0x001D0007)

OperationRegion (U7CS, PCI_Config, 0x54, 0x04)

Field (U7CS, DWordAcc, NoLock, Preserve)

{

, 15,

PMES, 1

}

 

Method (_DSM, 4, NotSerialized)

{

Store (Package (0x06)

{

"AAPL,clock-id",

Buffer (One)

{

0x01

},

 

"device_type",

Buffer (0x05)

{

"EHCI"

},

 

"device-id",

Buffer (0x04)

{

0x36, 0x28, 0x00, 0x00

}

}, Local0)

DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))

Return (Local0)

}

 

 

 

Brett's M1330 Non CPU Specific EHCI script:

 

Device (EHCI)

{

Name (_ADR, 0x001D0007)

Name (_S1D, 0x02)

Name (_S3D, 0x02)

Method (_DSM, 4, NotSerialized)

{

Store (Package (0x0B)

{

"AAPL,clock-id",

Buffer (One)

{

0x01

},

 

"device_type",

Buffer (0x05)

{

"EHCI"

},

 

"AAPL,current-available",

0x04B0,

"AAPL,current-extra",

0x02BC,

"AAPL,current-in-sleep",

0x03E8,

Buffer (One)

{

0x00

}

}, Local0)

DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))

Return (Local0)

}

Link to comment
Share on other sites

Both patches use method _DSM to inject properties, the main difference is that the first one injects a device ID (I use this patch in my ICH9 desktop, injecting ICH10 IDs to USB devices, and it really fixes sleep), while the second one injects properties "AAPL,current-available", "AAPL,current-extra" and "AAPL,current-in-sleep". About if they work or not in the laptops you mentioned, I can't tell because I don't have any with this "USB Insertion Error" issue upon wake. Can you explain what happens? I didn't understand the issue you have.

Link to comment
Share on other sites

Both patches use method _DSM to inject properties, the main difference is that the first one injects a device ID (I use this patch in my ICH9 desktop, injecting ICH10 IDs to USB devices, and it really fixes sleep), while the second one injects properties "AAPL,current-available", "AAPL,current-extra" and "AAPL,current-in-sleep". About if they work or not in the laptops you mentioned, I can't tell because I don't have any with this "USB Insertion Error" issue upon wake. Can you explain what happens? I didn't understand the issue you have.

 

 

With a flash drive in place. When the system wakes from sleep I get this error:

 

 

The disk was not ejected properly. If possible, always eject a disk before unplugging it or turning it off.

 

 

I thought it was the disk insertion error. Is this error the same thing though?

 

 

Any ideas what I would need to modify in the DSDT script to fix this error?

Link to comment
Share on other sites

Is it the same problem described in this topic?

http://www.insanelymac.com/forum/index.php?showtopic=155345

 

Check this package for the Inspiron 1525, there's a kext EHCISleepEnabler that might help.

http://download.dnfeitosa.com/DellInspiron1525Hackbook.zip

 

Also the IOUSBFamily may have the patch suggested here

http://www.insanelymac.com/forum/index.php...t&p=1097648

 

Some people solved the problem with this DSDT patch suggested by ApexDE, which injects the first and second properties of the patches in your post #76. Notice that "AAPL,clock-id" value is different for each device

http://www.insanelymac.com/forum/index.php...t&p=1240686

Link to comment
Share on other sites

Guys - great tool and extremely useful to boot! Can I ask a question/make a suggestion?

 

I've now created a DSDT for my GA-X58A-UD5 motherboard. It works well, but what would be handy is the ability to check the differences between a 'naked' version, and the tweaked version. Then, take that diff file and create a auto patch for others to use.

 

What do you think?

Link to comment
Share on other sites

You can make a patch package joining all individual patches you used (in the editor format) in one file, like I did for the Asus P5E.

 

About creating an auto patcher based on the original and modified files, El Coniglio can give a better answer, but I believe it's not viable. You can do that using the diff and patch tools (command line) or using a frontend like DiffMerge (http://www.sourcegear.com/diffmerge/) but the patch would be restricted to very similar original files.

Link to comment
Share on other sites

Dear el coniglio, oldnapalm and friends, thank you for this great tool. Allow me to report a couple of things that I just noticed:

 

1. If I have a comment at the device name, it's displayed with the comment on the list (left). For example, I my DSDT.dsl (which I edit manually using Window's excellent EditPlus and coloured codes that I made for DSDT) I enter:

Device (IPIC)  // Device name was (PIC)

for personal reference. So your parser should ignore anything starting with // especially after Method () or Device () etc.

 

2. I would like to suggest that DSDT functions/methods/devices are displayed with another colour, e.g. dark red or other, but not blue. I see you have them in bold, which is good. Namely, these are what I called "ACPI Directives" to keep in e.g. red:

DefinitionBlock, Device, Field, IndexField, Method, Name, Package, Scope, ThermalZone

Please refer to my uploaded file DSDT.stx if needed, it contains colour-codes for EditPlus 3 (Windows) to get what I mean.

 

3. I would like to give you the SpeedStep values for my Q9550 (Intel Core2Quad 2.83MHz) and not Q9550s (it exists I think) for you to add in the patches. Sorry I cannot (yet) offer the actual patch file...

    Scope (\_PR)  // Start of Q9550 CPU P-States code addition
   {
       Processor (\_PR.CPU0, 0x00, 0x00000410, 0x06)
       {
           Name (_PSS, Package (0x06)  // Processor Q9550 has 6 P-States
           {
            // Package {CoreFrequency, Power, TransitionLatency, BusMasterLatency, Control, Status}
               Package (0x06) {Zero, Zero, 0x0A, 0x0A, 0x4824, 0x00},    // Q9550 P-State 1: 0x4824
               Package (0x06) {Zero, Zero, 0x0A, 0x0A, 0x0821, 0x01},    // Q9550 P-State 2: 0x821
               Package (0x06) {Zero, Zero, 0x0A, 0x0A, 0x471E, 0x02},    // Q9550 P-State 3: 0x471E
               Package (0x06) {Zero, Zero, 0x0A, 0x0A, 0x071B, 0x03},    // Q9550 P-State 4: 0x71B
               Package (0x06) {Zero, Zero, 0x0A, 0x0A, 0x4619, 0x04},    // Q9550 P-State 5: 0x4619
               Package (0x06) {Zero, Zero, 0x0A, 0x0A, 0x0616, 0x05}     // Q9550 P-State 6: 0x616
           })

           Name (_PSD, Package (0x05)
           {
            // Number of Entries (0x05), Revision, Domain, Co-Ordination Type (0xFC=SW_ALL), Number of Cores (0x04)
               0x05, Zero, Zero, 0xFC, 0x04
           })

           Name (_CST, Package (0x02)
           {
            // Number of C-States
               0x01,
            // Intel CPU ACPI C-State package:      Register (Type,     Vendor, Class, Address, Access Size), C-State, Worst Latency, Power Consumption
               Package (0x04) {ResourceTemplate () {Register (FFixedHW, 0x01,   0x02,   0x0000, 0x01,     )}, 0x01,    0x9D,          0x03E8}
           })
       }

       Processor (\_PR.CPU1, 0x01, 0x00000410, 0x06)
       {
           Alias (\_PR.CPU0._PSS, _PSS)
           Alias (\_PR.CPU0._PSD, _PSD)
           Alias (\_PR.CPU0._CST, _CST)
       }

       Processor (\_PR.CPU2, 0x02, 0x00000410, 0x06)
       {
           Alias (\_PR.CPU0._PSS, _PSS)
           Alias (\_PR.CPU0._PSD, _PSD)
           Alias (\_PR.CPU0._CST, _CST)
       }

       Processor (\_PR.CPU3, 0x03, 0x00000410, 0x06)
       {
           Alias (\_PR.CPU0._PSS, _PSS)
           Alias (\_PR.CPU0._PSD, _PSD)
           Alias (\_PR.CPU0._CST, _CST)
       }
   }
//  End of Q9550 CPU P-States code addition

Thank you for your excellent work!

Link to comment
Share on other sites

... El Coniglio can give a better answer, but I believe it's not viable.

 

Well, it is possible to make a "diff-like" to place things dinamically (based on parent). It could parse the original file, the patched file then step one node a time checking if any children moved (something was removed or inserted) or if something has changed in the constructor or code (and check recursively into children nodes). BUT I don't think this will be generic enough in order to use on many computers as a manual regex-based patch does. It will be efficient if you just remove or insert new methods/devices. If you have many other little code changes it would replace entire blocks and could make a mess up.

 

@MacKonsti

It removes the comment because the "constructors" lines are regenerated (it splits and stores in a class atributtes during the parse, so I have a set/getLabel, get/setParamAt, etc. I'll make a workaround to get it working, I just have to save the comment into a proper field and put it back when generating the constructor.

Link to comment
Share on other sites

I'm trying to set new values for fan speed for HP 8510p laptop. I made the same under Windows. Basically I need to edit the values:

		Name (C358, Package (0x06)
		   {
			   0x64, 
			   0x4B, 
			   0x3C, 
			   0x32, 
			   0x1E, 
			   0x00
		   })

 

But I can neither compile the whole *.als nor make a patch. As for patch making DSDT Editor doesn't even accept as simple stuff as (which is a part of patches from provided package)

into_all all code_regex AZAL replaceall_matched
 begin
 HDEF
 end;

It says:

// into_all all code_regex AZAL replaceall_matched 

 //  

 Invalid command

What I'm doing wrong?

 

Can somebody take a look at my *.asl file please?

And what is the proper way: to compile and apply whole aml or prepare the patch?

dsdt_01_fan_decreased.asl.zip

Link to comment
Share on other sites

What I'm doing wrong?

Remove the leading spaces and the ";" (it's only needed if there's another patch after it)

into_all all code_regex AZAL replaceall_matched
begin
HDEF
end

 

And what is the proper way: to compile and apply whole aml or prepare the patch?

If you just want to patch the DSDT for yourself you don't need to use the patcher, just check "Editable text", make the changes, compile and save the aml.

 

Use the patcher if you want to make an automated patch to make it easy for other people or if you need to apply it again.

Link to comment
Share on other sites

Remove the leading spaces and the ";" (it's only needed if there's another patch after it)

 

If you just want to patch the DSDT for yourself you don't need to use the patcher, just check "Editable text", make the changes, compile and save the aml.

 

Use the patcher if you want to make an automated patch to make it easy for other people or if you need to apply it again.

 

thank you man. Though seems I hardly have an idea how to make it work. Is there any manuals describing the DSDT? E.g. how can I find anything regarding the CPU temperature or USB at *.asl?

And compiling my ASL I mostly have the errors that like:

Object does not exist (\TZ.C1F0)

so is the solution just an adding at the very top a declaration like below?

External (\TZ.C1F0)

Link to comment
Share on other sites

@Mac_Dude: thanks, I will add it to the patches pack.

 

@dimic: please extract your DSDT again, there's something wrong in the one you attached, in this part

                If (LOr (LNotEqual (Local0, DerefOf (Index (C37B, Arg0))), 
                   C377))
               {
                   Store (0x00, C377)
                   Store (Local0, Index (C37B, Arg0))
                   If (LEqual (Arg0, 0x00))
                   {
                       C376 (Else
                           {
                               If (LLess (Arg0, 0x04))
                               {
                                   C381 (Local0, Arg0)
                               }
                               Else
                               {
                                   Notify (\_TZ.TZ4, 0x81)
                               }
                           })
                   }
               }

Link to comment
Share on other sites

Hey, I have been on here learning for a week now. But my setup is the same.

 

P5E

Q6600

8GB G.SKILL 2GBx4 800mhz

NVIDIA 8800GT

M-AUDIO Firewire 1814

Hannspree HF289H 1920x1200

3 x 1TB SATA Hard Drive

2 x 500GB SATA Hard Drive

1 x CD/DVD SATA CD/DVD

1 x 1TB External USB Hard Drive

 

I have the SL 10.6.3 dmg. But I'm lost with the DSDT stuff. How can I get my dsdt file while in windows? I d/l the patches from the moderator but i guess I'm ready to do this! Need help!!

Link to comment
Share on other sites

Hey, I have been on here learning for a week now. But my setup is the same.

 

P5E

Q6600

8GB G.SKILL 2GBx4 800mhz

NVIDIA 8800GT

M-AUDIO Firewire 1814

Hannspree HF289H 1920x1200

3 x 1TB SATA Hard Drive

2 x 500GB SATA Hard Drive

1 x CD/DVD SATA CD/DVD

1 x 1TB External USB Hard Drive

 

I have the SL 10.6.3 dmg. But I'm lost with the DSDT stuff. How can I get my dsdt file while in windows? I d/l the patches from the moderator but i guess I'm ready to do this! Need help!!

 

Best way extract from live CD Ubuntu...

Link to comment
Share on other sites

I have the SL 10.6.3 dmg. But I'm lost with the DSDT stuff. How can I get my dsdt file while in windows? I d/l the patches from the moderator but i guess I'm ready to do this! Need help!!

You can use Everest application to extract the DSDT file. Right-click at the bottom of the Everest window & choose "ACPI Tool".

 

thank you man. Though seems I hardly have an idea how to make it work. Is there any manuals describing the DSDT? E.g. how can I find anything regarding the CPU temperature or USB at *.asl?

You can read ACPI documentation. Latest documentation is ACPI revision 4. There is no specific documentation for DSDT editing. For example, some manufacturer use ADP1 for AC adapter while other use ACAD. There are a lot of resources about what are you looking for in this forum, at another forum & blogs. For example:-

http://aspiregemstone.blogspot.com/2009/08...estigation.html

http://aspiregemstone.blogspot.com/2009/11/dsdt-testing.html

And compiling my ASL I mostly have the errors that like:

Object does not exist (\TZ.C1F0)

so is the solution just an adding at the very top a declaration like below?

External (\TZ.C1F0)

Is this original code in your DSDT or did you copied it from other DSDT? If this is original code, check for "illegal" IF statement & removed it from your DSDT. "illegal" IF statement is an IF statement that is not in any control method or function.

Link to comment
Share on other sites

@valayah

 

Best way extract from live CD Ubuntu...
You can use Everest application to extract the DSDT file. Right-click at the bottom of the Everest window & choose "ACPI Tool".

You can simply open the editor, click "DSL", "Extract from system" (this will extract and decompile de DSDT in Windows, Linux or MacOS).

Link to comment
Share on other sites

@dimic: please extract your DSDT again, there's something wrong in the one you attached, in this part

Thank you very much for taking a look. I'm moving to a new HDD so couldn't answer earlier.

 

Please find attached newly extracted ASL/(DSL?) from my current Snow Leo (it's iATKOS s3 ver.2 10.6.3 updated to 10.6.4 via Apple Update).

 

Also, I included a set of other extracted ASL files:

1. from my previous SL (HAZARD 10.6.2)

2. from win7 by iasl

3. from win7 by DSTDReader (*.aml) and then decompiled by MS ASL Compiler v.3.0.1

Maybe they help you to investigate what is wrong with the main ASL file.

 

I also tried to get ASL under Ubuntu, but to my shame I couldn't get it. If you want I can make another try.

 

I appreciate your help, man! but please don't spend much time with it. :rolleyes:

 

You can read ACPI documentation. Latest documentation is ACPI revision 4. There is no specific documentation for DSDT editing. For example, some manufacturer use ADP1 for AC adapter while other use ACAD. There are a lot of resources about what are you looking for in this forum, at another forum & blogs. For example:-

http://aspiregemstone.blogspot.com/2009/08...estigation.html

http://aspiregemstone.blogspot.com/2009/11/dsdt-testing.html

Thank you, I have some experience with DSDT under Windows, but I'm guided by some manual like these in links. But I hardly have understanding of whole basic thing. I should digg here.

 

Is this original code in your DSDT or did you copied it from other DSDT? If this is original code, check for "illegal" IF statement & removed it from your DSDT. "illegal" IF statement is an IF statement that is not in any control method or function.

Yes, this is my original code. I extracted it again.

iATKOS_newly_original.asl.zip

another_sample_ASL.zip

Link to comment
Share on other sites

Hey, I have been on here learning for a week now. But my setup is the same.

 

P5E

Q6600

8GB G.SKILL 2GBx4 800mhz

NVIDIA 8800GT

M-AUDIO Firewire 1814

Hannspree HF289H 1920x1200

3 x 1TB SATA Hard Drive

2 x 500GB SATA Hard Drive

1 x CD/DVD SATA CD/DVD

1 x 1TB External USB Hard Drive

 

I have the SL 10.6.3 dmg. But I'm lost with the DSDT stuff. How can I get my dsdt file while in windows? I d/l the patches from the moderator but i guess I'm ready to do this! Need help!!

The easy steps:

1) DSL - Extract from system

2) Patch - Load from file - select "ASUS P5E.txt"

3) Apply

4) AML - Compile

5) AML - Save to file - dsdt.aml

6) Copy dsdt.aml to /Extra

 

More details and kexts for P5E

http://www.insanelymac.com/forum/index.php?showtopic=199816

Link to comment
Share on other sites

@Maldon: thanks, will be added to the pack.

 

@Dimic: I don't understand why, but there are errors decompiling your DSDT

ACPI Error: Argument count mismatch for method \_TZ_.C376 1 0 (20100528/dmextern-387)

I could compile your win7_by_DSDTReader_and_MS_ASL_compiler_v3 with some changes, but don't know if it will work

5a6,11
>     External (C376, MethodObj)    // 0 Arguments
>     External (TZ1_)
>     External (\_TZ_.C376, MethodObj)    // 1 Arguments
>     External (\_TZ_.C375)
>     External (\_TZ_.TZ1_)
>     External (\_TZ_.TZ1_._CRT, IntObj)
13498c13501
<                         C376
---
>                         C376()
14192c14195
<                 \_TZ_.C376
---
>                 \_TZ_.C376()
14283c14286
<                     \_TZ_.C376
---
>                     \_TZ_.C376()

dsdt.dsl.zip

Link to comment
Share on other sites

I could compile your win7_by_DSDTReader_and_MS_ASL_compiler_v3 with some changes, but don't know if it will work
Thank you in any way. I can manipulate with my DSDT under win7. I usually configure fan speed in this way. I would like to make the same for Snow Leo, but so seems it will wait until I have time to dive into it somewhen :)
Link to comment
Share on other sites

Thank you in any way. I can manipulate with my DSDT under win7. I usually configure fan speed in this way. I would like to make the same for Snow Leo, but so seems it will wait until I have time to dive into it somewhen :)

I'm able to fix your DSDT. I just fix the incorrect IF statement (at two places) & it fix the "object doesn't exist" error. Just one warning occur while compiling. However, for unknown reason when I decompiled the fixed DSDT.AML file, it will reproduced buggy DSDT.DSL file. Good news is, this is an easy fix. To prevent the trouble, always use the included DSDT.DSL.

 

When decompiled the fixed DSDT.aml, it will reproduced this wrong if statement which can prevent it from compiling to AML file again:-

wrongifstatement.th.jpg

What you need to do is reapply the fix again, like this & it will compile again:-

correctifstatement.th.jpg

Fixed_dimic.rar

Link to comment
Share on other sites

Can you upload the DSDT fix for these:

 

- Sleep / Shutdown Fix.

- Native PowerManagement correctly loaded

- (this manual - Splash Screen)

- USB/EHCI Speed Fixes.

- USB 1.1 and 2.0 seen as internal with sleep capability

- CMOS reset fix.

- HDEF Audio

- Renamed devices to mac specific ones

- Native SMBus loading

- Full AHCI hotplug capability

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...