Jump to content

DSDT editor and patcher


oldnapalm
 Share

999 posts in this topic

Recommended Posts

Any idea what's the best fix for this? Just remove the IF (or choose between code from IF or ELSE, if both exist)? Or create a method ("_INI"?) and put the code inside it?

(Updated my previous post - I updated it in the same time you post. :rolleyes: )

Link to comment
Share on other sites

@MadMungo: your problem looks the same as mohamed_kairy2002

dsdt.dsl.zip

 

Thankyou oldnapalm, much appreciated. Still has 2 errors and about 20 warnings when compiled but it now compiles and outputs an .aml file.

 

I cannot use any versions of chameleon or spinoffs greater than V2.0 Rc3 rxx as the machine will hard reset right after it has loaded the kexts and done the first bit of patching just before it starts to load the OS proper. Not sure if it is because of something not right in the DSDT file or because the setup is an AMD/ATI combo.

Link to comment
Share on other sites

@macusers

 

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

 

 

^ Reserved method must return a value (_WAK)

At the end of the _WAK method, this must be added

Return(Package(0x02){Zero, Zero})

 

http://www.mediafire.com/?bd5roidf1q4m5fb

 

DSDT

http://www.mediafire.com/?xeieu24qy0046rl

Link to comment
Share on other sites

Follow up with my patching and compiling, please give further advice what to do. Here the screen shot of my issue.

oldnapalm is correct, you should change this:-

Store (Local0, Local0)

to

Store ("Local0", Local0)

I just realized it when I revisit fassl's DSDT Patcher thread.

 

For 916 Warning Result is not used, operator has no effect, change this:-

Or (0x03, PARM)

to

Or (PARM, 0x03, PARM)

Link to comment
Share on other sites

Still has 2 errors and about 20 warnings when compiled but it now compiles and outputs an .aml file.

Actually it's 2 remarks and 20 warnings, but no errors

ASL Input:  dsdt.dsl - 16864 lines, 550504 bytes, 7069 keywords
AML Output: dsdt.aml - 62523 bytes, 1557 named objects, 5512 executable opcodes

Compilation complete. 0 Errors, 20 Warnings, 2 Remarks, 92 Optimizations

 

I cannot use any versions of chameleon or spinoffs greater than V2.0 Rc3 rxx as the machine will hard reset right after it has loaded the kexts and done the first bit of patching just before it starts to load the OS proper. Not sure if it is because of something not right in the DSDT file or because the setup is an AMD/ATI combo.

Does it work with RC3?

 

 

I just realized it when I revisit fassl's DSDT Patcher thread.

Thanks, I didn't remember where I saw it, probably it was in a file patched by DSDT_Patcher.

 

DSDTSE says you can remove the line

This error is produced because a variable tries to store it's value in itself.

/* Store (Local0, Local0) */ /*

For 916 Warning Result is not used, operator has no effect, change this:-

Or (0x03, PARM)

to

Or (PARM, 0x03, PARM)

Thanks for the info.

 

Do these warnings make any difference other than the compiler messages? And what about remarks fixes?

Link to comment
Share on other sites

Actually it's 2 remarks and 20 warnings, but no errors

ASL Input:  dsdt.dsl - 16864 lines, 550504 bytes, 7069 keywords
 AML Output: dsdt.aml - 62523 bytes, 1557 named objects, 5512 executable opcodes

 Compilation complete. 0 Errors, 20 Warnings, 2 Remarks, 92 Optimizations

I think MadMungo is using DSDT Editor for windows which is using IASL ver 4.0a. That is why he see two error when compiling. DSDT Editor for Mac is using IASL ver 4.0. I got the same result like you when compiled it in Mac. @MadMungo, the two error are very easy to fix. Use this formula to fix the Length; Length = Max - Min + 1

Do these warnings make any difference other than the compiler messages? And what about remarks fixes?

I don't think these warnings can prevent DSDT to work properly though. Actually it is safe to ignore them. In my opinion most fix we apply to "fix" these warnings is just to satisfy the compiler without knowing what the effect to the entire function or any function who called it. Maybe we mistakenly make it to divide by 0. LOL ;) For what it's worth, I haven't seen any computer suddenly its DSDT throw an exception while running. :P As for remarks, I think it just an information for programmer. It absolutely safe to ignore.

Link to comment
Share on other sites

I think MadMungo is using DSDT Editor for windows which is using IASL ver 4.0a. That is why he see two error when compiling. DSDT Editor for Mac is using IASL ver 4.0. I got the same result like you when compiled it in Mac. @MadMungo, the two error are very easy to fix. Use this formula to fix the Length; Length = Max - Min + 1

Thanks, I missed that again. Should we update Mac IASL?

Link to comment
Share on other sites

Thanks, I missed that again. Should we update Mac IASL?

I think we should, just to prevent confusion. Can you make patch for this Length error (auto calculate the correct length; Length = Max - Min + 1)? It become common error now.

Link to comment
Share on other sites

Can you make patch for this Length error (auto calculate the correct length; Length = Max - Min + 1)? It become common error now.

Sorry, I can't, but maybe El Coniglio can. I don't know if we need to implement some command in the patcher to do the math or it can be done using code_regex and replace_matched. He went to the north running away from the cold (like when birds fly to the south in north hemisphere). Maybe if he can get some EDGE internet he will reply soon.

Link to comment
Share on other sites

Store (Local0, Local0)

to

Store ("Local0", Local0)

I just realized it when I revisit fassl's DSDT Patcher thread.

 

For 916 Warning Result is not used, operator has no effect, change this:-

Or (0x03, PARM)

to

Or (PARM, 0x03, PARM)

 

Awesome, I will give that a try. Thank you a whole bunch.

 

After following your suggest, now i am down to with just 1 warning, please tell me what to do next.

post-402809-1279758475_thumb.png

Link to comment
Share on other sites

Awesome, I will give that a try. Thank you a whole bunch.

 

After following your suggest, now i am down to with just 1 warning, please tell me what to do next.

 

^ Reserved method must return a value (_WAK)

At the end of the _WAK method, this must be added

Return(Package(0x02){Zero, Zero})

 

capturadetela20100721s2.png

 

Fix http://www.mediafire.com/?bd5roidf1q4m5fb

:(

Link to comment
Share on other sites

Actually it's 2 remarks and 20 warnings, but no errors

ASL Input:  dsdt.dsl - 16864 lines, 550504 bytes, 7069 keywords
AML Output: dsdt.aml - 62523 bytes, 1557 named objects, 5512 executable opcodes

Compilation complete. 0 Errors, 20 Warnings, 2 Remarks, 92 Optimizations

 

Does it work with RC3?

 

Yes it works with Chameleon V2.0 RC2, RC3 & RC4 r684. But so far none of the RC5 versions work.

 

I think MadMungo is using DSDT Editor for windows which is using IASL ver 4.0a. That is why he see two error when compiling. DSDT Editor for Mac is using IASL ver 4.0. I got the same result like you when compiled it in Mac. @MadMungo, the two error are very easy to fix. Use this formula to fix the Length; Length = Max - Min + 1

 

Yep using the most recent windows version of IASL.

 

I don't think these warnings can prevent DSDT to work properly though. Actually it is safe to ignore them. In my opinion most fix we apply to "fix" these warnings is just to satisfy the compiler without knowing what the effect to the entire function or any function who called it. Maybe we mistakenly make it to divide by 0. LOL :) For what it's worth, I haven't seen any computer suddenly its DSDT throw an exception while running. :) As for remarks, I think it just an information for programmer. It absolutely safe to ignore.

 

Ok thanks. I will fix those errors and see what happens.

Any ideas on fixing the warnings because when I go to start doing major edits it will help if I have a clean dsdt even if the current warnings/remarks are not going to adversely effect it.

Link to comment
Share on other sites

This is a list of how to fix warnings & errors found when compiling DSDT. Not much but useful. :thumbsup_anim:

/Library/DSDT/DSDTFiles/dsdt.dsl 8896: Return (Package (0x00) {})

Remark 5071 - Effective AML package length is zero ^

 

All this needed was a Zero instead of (0x00)

Fix:-

Return (Package (Zero) {})

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

dsdt.dsl 3040: And (Local0, 0x0F)

Warning 1104 - ^ Result is not used, operator has no effect

 

Change to And(Local0, 0x0F, Local0). This form will store result of operator back to Local0, probable intention of the statement...

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

./dsdt_fixed.txt 1224: Method (_WED, 1, NotSerialized)

Warning 1087 - ^ Not all control paths return a value (_WED)

 

Fix - add this line at the end of the function involved:-

Return (Package (0x02) {0x00, 0x00})

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

dsdt.dsl 776: Return (^C08F (Arg0, Arg1, Arg2))

Error 4059 - ^ Called method returns no value

Fix - Locate method "^C08F" & add return code (suggest fix same as "Not all control paths return a value")

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

dsdt.dsl 6393: 0x00000000, //Length

Error 4122 - ^ Invalid combination of Length of Min/Max fixed flags

 

Fix - Re-calculate the Length with this formula (calculation in HEX): Length = Range Maximum - Range Minimum + 1

Link to comment
Share on other sites

Sorry, I can't, but maybe El Coniglio can. I don't know if we need to implement some command in the patcher to do the math or it can be done using code_regex and replace_matched. He went to the north running away from the cold (like when birds fly to the south in north hemisphere). Maybe if he can get some EDGE internet he will reply soon.
This is a list of how to fix warnings & errors found when compiling DSDT. Not much but useful. :(

Next week when I get home I'll change the parser so it will fix these warnings/remarks/errors kiswan listed when creating the structure "nodes".

Link to comment
Share on other sites

I successfully patched a dsdt for the ASRock 945G-DVI board to enable the stock gma950 kexts by inserting 2 code blocks. One starting with Method DTGP or someting like that, the other one starting with device _PEGP or something like that. I did it with DSDTSE. I followed a description where to insert the code but it was a vague as usual, as the dsdt of each board is different. I didn't expect that it would work, my dsdt patching experiments never worked. It's just trial and error without understanding the language. But this time it worked. I get full resolution with stock gma950 kexts. Sometimes the system, installed on an usb hd, won't boot. Sometimes it hangs at the spinning beachball, sometimes it kp's but safe boot always works. I don't know whether it's the dsdt.aml or the system. If you install dozens of applications, something can go wrong. I also heard that the stock gma950 kexts of 10.6.3 were considered buggy - I have 10.6.4 running.

 

Anyway I patched the dsdt with DSDTEditor, applying the DTGP and the GMA950 desktop patch. It was compiled without errors. I thought it would be syntactically more correct than my handmade patch and maybe the occasional boot problems would fade away. But it doesn't work. Machine boots with 1024x768 and resolution can't be changed.

 

Sure my fault, if not I thought you are interested in problem reports.

ASRock_945G_DVI__dsdt_patched_manually.zip

ASRock_945G_DVI_dsdt_patched_w._DSDTEditor.zip

Link to comment
Share on other sites

Your PCI0 device has a different _HID from the one I used to make the patch, so it was not applied. I changed the patch to use label instead of _HID, it's more likely the _HID will change than the label (to PCI1 as supposed).

 

Please download here

http://www.insanelymac.com/forum/index.php...st&id=74714

 

Your manually edited file looks correct (GMA950 part at least).

Link to comment
Share on other sites

Your PCI0 device has a different _HID from the one I used to make the patch, so it was not applied. I changed the patch to use label instead of _HID, it's more likely the _HID will change than the label (to PCI1 as supposed).

 

Please download here

http://www.insanelymac.com/forum/index.php...st&id=74714

 

Your manually edited file looks correct (GMA950 part at least).

 

 

Thanks, will try tomorrow.

Link to comment
Share on other sites

Hello guys, any news of the DSDT editor being updated/improved/enhanced? I only read posts about proper compilation... Dear oldnapalm let us know if there's any updated version in your first post. Cheers!

Link to comment
Share on other sites

Your PCI0 device has a different _HID from the one I used to make the patch, so it was not applied. I changed the patch to use label instead of _HID, it's more likely the _HID will change than the label (to PCI1 as supposed).

 

Please download here

http://www.insanelymac.com/forum/index.php...st&id=74714

 

Your manually edited file looks correct (GMA950 part at least).

 

The fixed gma950 desktop patch works for me.

 

What does not work yet, is the ALC888 patch. Perhaps it's the same problem like with the GMA950 desktop patch? Does it depend on another patch than DTGP? If you need the device ID I need to find out first and could use a hint how to do it.

 

May I ask 1 off topic question: people with the same board but different CPUs on it can't use the same dsdt, right?

 

thanks, p.

Link to comment
Share on other sites

What does not work yet, is the ALC888 patch. Perhaps it's the same problem like with the GMA950 desktop patch? Does it depend on another patch than DTGP? If you need the device ID I need to find out first and could use a hint how to do it.

Your DSDT has a device with _ADR 0x001B0000 (name HDAC), the ALC888 patch should be applied there. I don't know if the device name matters in this case (for device functioning), maybe yes. Try renaming it to HDEF (also replace a reference to it). You will also need a legacy kext and patch the AppleHDA binary if version is 10.6.3 or later.

 

May I ask 1 off topic question: people with the same board but different CPUs on it can't use the same dsdt, right?

I think it depends on the BIOS. In my Asus the DSDT changes depending on memory and CPU cores. Looks like Gigabyte boards don't have this problem, but I don't have one so I can't tell for sure.

Link to comment
Share on other sites

May I ask 1 off topic question: people with the same board but different CPUs on it can't use the same dsdt, right?

DSDT depend on BIOS. People with same board, same BIOS version, different memory size & different CPU can use the same DSDT.

Link to comment
Share on other sites

DSDT depend on BIOS. People with same board, same BIOS version, different memory size & different CPU can use the same DSDT.

It may be true for Gigabyte boards, but not for Asus. Check the P5E topic in my signature.

Link to comment
Share on other sites

It may be true for Gigabyte boards, but not for Asus. Check the P5E topic in my signature.

Are you referring to processor speedstep? Of course if you put additional code to the processor scope, in order to get vanilla speedstep, other people with same board but different CPU will not be able to fully utilize your DSDT. :rolleyes: About the different memory size issue (1 stick vs more-than-1 stick) for ASUS P5E board, it is actually bug in BIOS itself. This is understandable since the BIOS was build & optimized for windows. I'm actually referring to the "core" of the DSDT. For example, I have the same board as yours but with different CPU, memory, GPU & sound card (PCI card). I'll still be able to use your DSDT but I will changed it according to my specification. ;) You're right in certain point of view.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...