Jump to content

DSDT editor and patcher


oldnapalm
 Share

1,000 posts in this topic

Recommended Posts

We need more information than the DSDT to suggest which patches should be applied. For example, to know if you need the LPC patch, you have to check if the original ID of your LPC device is listed under IONameMatch of AppleLPC.kext/Contents/Info.plist and if the kext is being loaded.

 

I did not know this, I just though that if you have a pc and a lpc in your dsdt, then you need a fix, as to make it look like a mac. my problem is that there is a lot of dif. mac dsdt.

 

As you already suggested, we would have to merge the "System Info" parser and grab some more info to do this. The initial idea of this editor was not to be a "click and you are done" app, but to help new users to understand the DSDT structure (tree view) and learn how to apply a patch by observing what the automated patches do (patcher preview/before/after). Surely we could implement some of your good suggestions, but it will take some time, since this is a hobby project for both me and my brother (el coniglio) who is the developper of this app. Maybe if he doesn't want to improve it anymore, I will ask him to release the source.

 

 

 

 

I saw you did a good work with the renaming patch, it would be nice if you could help us with this. I won't work on renaming patches because I see no advantage renaming the devices, I'm satisfied with the OS running fine. Some friends reported faster boot using your patch, but I noticed no difference. Did you remove any devices?

all i did was, ask the members of this forum to tell me the names and what to change them to.

 

 

i have never seen a mac dsdt to look at the names use. 

Link to comment
Share on other sites

Thanks rednous!

 

Can you compile under Leopard? The last version I compiled under Snow Leopard simply would not run on Leopard (even compiled as i386).

 

I have only Snow Leopard installed, unfortunately I don't have Leopard :thumbsup_anim:

Link to comment
Share on other sites

Thanks rednous!

 

Can you compile under Leopard? The last version I compiled under Snow Leopard simply would not run on Leopard (even compiled as i386).

Let me make an educated guess: You didn't compile it against the MacOSX10.5.sdk :D

 

/me runs like h&$)) because she has no clue how to do it herself :thumbsup_anim:

Link to comment
Share on other sites

features in this iasl version: Compiler now treats lower case in name space as non-hex letters and returns error. Example, i have this line in my DSDT:

 

Name (_HID, "pnp0c14")

 

And the error after compiling:

 

/Volumes/MacStorage/DSDTMod/TEST/DSDT.dsl   8498:			 Name (_HID, "pnp0c14")
Error	4124 -						Non-hex letters must be upper case ^  (pnp0c14)

 

simply fixed by changing to upper case - PNP0C14

 

Is lower case a problem at all ?

Link to comment
Share on other sites

features in this iasl version: Compiler now treats lower case in name space as non-hex letters and returns error. Example, i have this line in my DSDT:

 

Name (_HID, "pnp0c14")

 

And the error after compiling:

 

/Volumes/MacStorage/DSDTMod/TEST/DSDT.dsl   8498:			 Name (_HID, "pnp0c14")
Error	4124 -						Non-hex letters must be upper case ^  (pnp0c14)

 

simply fixed by changing to upper case - PNP0C14

 

Is lower case a problem at all ?

Not if you fix it.

 

BTW: The use of uppercase is enforced in the ACPI specification (on page 200 / 591) which reads, and I quote:

 

"A valid PNP ID must be of the form “AAA####” where A is an uppercase letter and # is a hex digit.

A valid ACPI ID must be of the form “ACPI####” where # is a hex digit."

 

The correct syntax therefor should be:

Name (_HID, EisaId ("PNP0C14"))

I'm sure that oldernapalm can write up a simple, but effective, script for it.

Link to comment
Share on other sites

I will ask el coniglio to add this to the "auto fix" in next version, which will include the new IASL.

 

 

@Zprood

 

The bug you found is fixed in next release. If "editable text" is checked it was not parsing the manual changes before applying an automatic patch.

Link to comment
Share on other sites

I saw this in my DSDT file and would like to know, what is this for and how can i put "mac os x" in here or do i have to put "freebsd"?

 

 

 

 

Method (OSYS, 0, NotSerialized)

 

 

{

Store (0x10, Local0)

If (CondRefOf (_OSI, Local1))

{

If (_OSI ("Windows 2000"))

{

Store (0x12, Local0)

}

If (_OSI ("Windows 2001"))

{

Store (0x13, Local0)

}

If (_OSI ("Windows 2001 SP1"))

{

Store (0x13, Local0)

}

If (_OSI ("Windows 2001 SP2"))

{

Store (0x13, Local0)

}

If (_OSI ("Windows 2001.1"))

{

Store (0x14, Local0)

}

If (_OSI ("Windows 2001.1 SP1"))

{

Store (0x14, Local0)

}

If (_OSI ("Windows 2006"))

{

Store (0x15, Local0)

}

}

Else

{

If (MCTH (_OS, "Microsoft Windows NT"))

{

Store (0x12, Local0)

}

Else

{

If (MCTH (_OS, "Microsoft WindowsME: Millennium Edition"))

{

Store (0x11, Local0)

}

If (MCTH (_OS, "Linux"))

{

Store (One, Local0)

}

}

}

Return (Local0)

}

 

 

 

 

 

 

 

 

Thank you.

Link to comment
Share on other sites

I saw this in my DSDT file and would like to know, what is this for and how can i put "mac os x" in here or do i have to put "freebsd"? Thank you.

You can remove all references to it. We don't need it on "Darwin" (0x2710). You will however have to patch all places where it is used. Sometimes it makes reading much more fun. Let's take one example:

                    Method (_STA, 0, NotSerialized)
                   {
                       If (LGreaterEqual (OSYS, 0x07D1)) // Windows 2000
                       {
                           If (HPAE)
                           {
                               Return (0x0F)
                           }
                       }
                       Else
                       {
                           If (HPAE)
                           {
                               Return (0x0B)
                           }
                       }

                       Return (Zero)
                   }

All that can basically be replaced with one single line:

Name (_STA, 0x0f)

Much more fun isn't it. Simply because the modified copy of our dsdt.aml will only be used for OS X. Easy.

Link to comment
Share on other sites

that's cool, thanks

 

but if i am going to put the modify dsdt file back into my bios, then i will need the windows info, for dual-booting.

 

will this be the way it looks:

 

Method (_STA, 0, NotSerialized)

{

If (LGreaterEqual (OSYS, 0x07D1)) // Windows 2000

{

If (HPAE)

{

Return (0x0F)

}

}

Else

{

If (LGreaterEqual (OSYS, 0x2710)) // Darwin

{

Name (_STA, 0x0F)

Return (0x0F)

}

Else

{

If (HPAE)

{

Return (0x0B)

}

}

}

 

Return (Zero)

}

Link to comment
Share on other sites

that's cool, thanks

 

but if i am going to put the modify dsdt file back into my bios, then i will need the windows info, for dual-booting. will this be the way it looks:

Method (_STA, 0, NotSerialized)
                   {
                       If (LGreaterEqual (OSYS, 0x07D1)) // Windows 2000
                       {
                           If (HPAE)
                           {
                               Return (0x0F)
                           }
                       }
                       Else
                       {
                          If ([color="#FF0000"]LGreaterEqual[/color] (OSYS, 0x2710)) // Darwin
                            {
                                 [color="#FF0000"]Name (_STA, 0x0F)[/color]
                                 Return (0x0F)
                            }
                         [color="#FF8C00"]Else
                          {
                            If (HPAE)
                             {
                               Return (0x0B)
                             }
                          }[/color]
                       }

                       Return (Zero)
                   }

Oh but that will make things much more complicated. And please note that my example was... well just an example. I've marked a few lines with red and orange. Red is an error (LGreaterEqual should be LEqual) and the orange section could be written as:

						  ElseIf (HPAE)
					  {
						Return (0x0B)
					  }

To reduce the number of opcodes (for optimization). And since my Name (_STA, 0x0F) was a full replacement for Method (_STA, 0, NotSerialized) it cannot be used like you did. Hence it being marked red.

Link to comment
Share on other sites

@fbifido,

 

If you're going to put the modified DSDT back into BIOS, you may follow this example. I add Darwin entry like this:-

        Method (_INI, 0, NotSerialized)
       {
           Store (0x07D0, OSYS)
           If (CondRefOf (_OSI, Local0))
           {
               If (_OSI ("Darwin"))
               {
                   // Store (0x2710, OSYS)
                   // change to:-
                   Store (0x07D3, OSYS)
               }

               If (_OSI ("Linux"))
               {
                   Store (One, LINX)
               }

               If (_OSI ("Windows 2001"))
               {
                   Store (0x07D1, OSYS)
               }

               If (_OSI ("Windows 2001 SP1"))
               {
                   Store (0x07D1, OSYS)
               }

               If (_OSI ("Windows 2001 SP2"))
               {
                   Store (0x07D2, OSYS)
               }

               If (_OSI ("Windows 2006"))
               {
                   Store (0x07D6, OSYS)
               }
           }

This is an example for LID sleep fix in DSDT where when the LID is close, my notebook will go to sleep if it is in Mac OS X. While if it is in windows, it will use whatever we set in Control Panel (Power Options).

        Device (LID0)
       {
           Name (_HID, EisaId ("PNP0C0D"))
           Method (_LID, 0, NotSerialized)
           {
               If (ECON)
               {
                   Store (^^PCI0.LPCB.EC0.KLID, Local0)
               }
               Else
               {
                   And (RBEC (0x70), 0x02, Local0)
               }

               If (Local0)
               {
                   Return (One)
               }
               Else
               {
                   // check OS before sleep when LID closed
                   if (LEqual (OSYS, 0x07D3))
                   {
                       Store (OSYS, Debug)
                       Notify (SLPB, 0x80)
                   }
                   Return (Zero)
               }
           }

I set Darwin to 0x07D3 instead of 0x2710 because it is useful if you have entry like this in your DSDT (look for If (LOr (LGreater (OSYS, 0x07D0), LLess (OSYS, 0x07D6)))):-

                    Method (HKDS, 1, NotSerialized)
                   {
                       If (LEqual (Zero, DSEN))
                       {
                           Store (PHSR (0x2D, Zero), Local1)
                           If (LNotEqual (Local1, LDTD))
                           {
                               Store (Local1, LDTD)
                               If (LOr (LGreater (OSYS, 0x07D0), LLess (OSYS, 0x07D6)))
                               {
                                   Notify (PCI0, Zero)
                               }
                               Else
                               {
                                   If (LEqual (IGDD, Zero))
                                   {
                                       Notify (GFX0, Zero)
                                   }
                                   Else
                                   {
                                       Notify (^^^PEGP.VGA, Zero)
                                   }
                               }

                               Sleep (0x02EE)
                           }

This way you'll only need to do minimal changes to your DSDT (just OSYS).

Link to comment
Share on other sites

Hi,

 

I can't compile my dsdt even without modifications (more then 200 errors). Found that FPED is a problem but I don't know what it is. There is FPED in MBP6.1's dsdt and couldn't compile it also. Would you like to help me?

(Posted here also)

Look for "syntax errors", if you fix them, all other errors will be fixed.

 

dsdt_SamsungR780.dsl.zip

(look for "commented out")

Link to comment
Share on other sites

@kizwan

 

I don't think that you want to use:

Notify (PCI0, Zero)

Not for Darwin / Linux because only Windows wants to receive notifications on the PCI bus. This little fact can be found in the DSDT of a real Mac (example):

                        If (LOr (LGreater (OSYS, 0x07D0), LLess (OSYS, 0x07D6)))
                       {
                           Notify (\_SB.PCI0, Arg1) // Windows
                       }
                       Else
                       {
                           Notify (\_SB.PCI0.IGPU, Arg1) // Linux and Darwin
                       }

Just to let you know.

Link to comment
Share on other sites

I hit on that idea, but thanks for help. Are you sure a commented out section is not required for something, what is FPED?

I have no idea, there are 3 ocurrences, 2 commented out and

	External (FPED, MethodObj)	// 0 Arguments

The compiler won't accept an IF in that place, so the way I found to compile was removing it. Probably there's a better solution, but I don't know it. Maybe creating a method?

 

You may find more about FPED in other ACPI tables, you can dump them using Linux.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...