Jump to content

DSDT editor and patcher

DSDT editor patcher

  • Please log in to reply
990 replies to this topic

#81
oldnapalm

oldnapalm

    InsanelyMac V.I.P.

  • Moderators
  • 6,836 posts
  • Gender:Male
  • Location:Brazil
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.

#82
MacKonsti

MacKonsti

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 228 posts
  • Gender:Male
  • Location:Muppet Show
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!

#83
el coniglio

el coniglio

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 101 posts

... 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.

#84
dimic

dimic

    InsanelyMac Protégé

  • Members
  • Pip
  • 19 posts
  • Gender:Male
  • Location:Ukraine
  • Interests:bikes, traveling, game development.
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?

Attached Files



#85
oldnapalm

oldnapalm

    InsanelyMac V.I.P.

  • Moderators
  • 6,836 posts
  • Gender:Male
  • Location:Brazil

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.

#86
bmasogne

bmasogne

    InsanelyMac Protégé

  • Just Joined
  • Pip
  • 1 posts
Some Manual or short Video, how to ADD/Replace/Edit/Remove, when extract the DSTD table..., for the "Loosers" ... :) :) :P

#87
dimic

dimic

    InsanelyMac Protégé

  • Members
  • Pip
  • 19 posts
  • Gender:Male
  • Location:Ukraine
  • Interests:bikes, traveling, game development.

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)


#88
Mac_Dude

Mac_Dude

    InsanelyMac Protégé

  • Members
  • PipPip
  • 53 posts
  • Gender:Male
  • Location:Germany
Hello

I edited the speedstep.txt to work with Intel C2D E7300 CPU / added 5-Pstates


http://www.flickr.co...812657/#preview






regards

Mac_Dude

Attached Files



#89
oldnapalm

oldnapalm

    InsanelyMac V.I.P.

  • Moderators
  • 6,836 posts
  • Gender:Male
  • Location:Brazil
@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
[codebox] 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)
}
})
}
}
[/codebox]

#90
valayah

valayah

    InsanelyMac Protégé

  • Just Joined
  • Pip
  • 1 posts
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!!

#91
iWire

iWire

    InsanelyMac Protégé

  • Members
  • Pip
  • 23 posts
  • Gender:Male
  • Location:BFE, Earth

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...

#92
kizwan

kizwan

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 1,422 posts

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://aspiregemston...estigation.html
http://aspiregemston...dt-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.

#93
el coniglio

el coniglio

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 101 posts
@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).

#94
dimic

dimic

    InsanelyMac Protégé

  • Members
  • Pip
  • 19 posts
  • Gender:Male
  • Location:Ukraine
  • Interests:bikes, traveling, game development.

@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://aspiregemston...estigation.html
http://aspiregemston...dt-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.

Attached Files



#95
oldnapalm

oldnapalm

    InsanelyMac V.I.P.

  • Moderators
  • 6,836 posts
  • Gender:Male
  • Location:Brazil

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.insanelym...howtopic=199816

#96
MaLd0n

MaLd0n

    ...filling veins with juice of chaos...

  • Moderators
  • 11,137 posts
  • Gender:Male
  • Location:Rio de Janeiro
PATCHEs

GA G31M S2L
http://www.mediafire...e289zp2ouzu642g

GA P35 DS3
http://www.mediafire...4ugn75c5tt43k3k

G41MT-ES2L
http://www.mediafire...11fd429l4wf3dx9

DSDT fixes for Gigabyte boards
http://www.insanelym...howtopic=192518

#97
oldnapalm

oldnapalm

    InsanelyMac V.I.P.

  • Moderators
  • 6,836 posts
  • Gender:Male
  • Location:Brazil
@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()
Attached File  dsdt.dsl.zip   52.59KB   5 downloads

#98
dimic

dimic

    InsanelyMac Protégé

  • Members
  • Pip
  • 19 posts
  • Gender:Male
  • Location:Ukraine
  • Interests:bikes, traveling, game development.

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 :)

#99
kizwan

kizwan

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 1,422 posts

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:-
Posted Image
What you need to do is reapply the fix again, like this & it will compile again:-
Posted Image

Attached Files



#100
fbifido

fbifido

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 135 posts
  • Gender:Male
  • Location:Jamaica
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





Also tagged with one or more of these keywords: DSDT, editor, patcher


3 user(s) are reading this topic

1 members, 2 guests, 0 anonymous users


© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy