Jump to content

DSDT editor and patcher


oldnapalm
 Share

999 posts in this topic

Recommended Posts

oldnapalm,

 

Well, This program could open one more than dsdt on the tabs and also could move devices in the tree, who knows, could automatically to rename the devices as a like real mac user choice: iMac, MacPro, macmini, macbook etc :D

I think that one part of your suggestions, being the renaming of devices, can already be done with some scripting lines.

 

BTW: I don't do Java coding. Not yet, but I will start learning later this year (as part of my education) so I personally can't do much at the moment, but I would love to see this translated into a proper OS X GUI app.

Link to comment
Share on other sites

I think that one part of your suggestions, being the renaming of devices, can already be done with some scripting lines.

 

BTW: I don't do Java coding. Not yet, but I will start learning later this year (as part of my education) so I personally can't do much at the moment, but I would love to see this translated into a proper OS X GUI app.

 

:D OS X GUI app, I'm waiting eager for this day !! :)

Link to comment
Share on other sites

I think that one part of your suggestions, being the renaming of devices, can already be done with some scripting lines.

You are right, actually it's very easy.

 

BTW: I don't do Java coding. Not yet, but I will start learning later this year (as part of my education) so I personally can't do much at the moment, but I would love to see this translated into a proper OS X GUI app.

For this you would have to learn Cocoa and Objective-C programming.

Link to comment
Share on other sites

Yes ,as he said .

The most annoying feature bug at the moment is the Load Patch function that can't remember it's previous location, so everytime you want to load a patch it sends you home instead of your patches folder.

 

And I try the new version , the bug is fixed .Great ~~~But something is still there, when I load a dsdt file correct

 

errors ,warning .....and apply patches ,it go back ignore what I have done before. So , I only do this ,when finish correct

 

,I should save .dsl or .aml file to another place and reopen to apple patches ,this bug also exist in windows version.

 

Sorry for my poor english.

 

Regards !

Link to comment
Share on other sites

@pdave54

 

I'm glad you sorted it out. Can you confirm if the "HasPanel" is needed in your case, or just the usual GMA950 desktop patch? Are you using default current kexts now?

 

Can confirm - - No "Has Panel" needed - - All default (vanilla kexts)

 

 

Interestingly after bios re-set, had no errors this time on compile.

Link to comment
Share on other sites

Can confirm - - No "Has Panel" needed - - All default (vanilla kexts)

 

 

Interestingly after bios re-set, had no errors this time on compile.

 

Just compiled dsdt for a friend with a Optiplex GX620

If video in bios is set to auto (even with no other video card installed) then got the "Length error on compile.

Set the video to internal in bios and can compile without error and dsdt works with vanilla kexts

Link to comment
Share on other sites

Just compiled dsdt for a friend with a Optiplex GX620

If video in bios is set to auto (even with no other video card installed) then got the "Length error on compile.

Set the video to internal in bios and can compile without error and dsdt works with vanilla kexts

Thanks, I think the mystery is solved.

Link to comment
Share on other sites

Hello Kizwan and OldNap;

 

I am back again on this thread.

 

The hardware specs are on my sig. Attached were my dsdt.aml and ioreg file, if you want to take a look at it.

 

The story of this notebook is that, originally it has an intel T2390 C2D. It was a Merom on which native power management is not working 100%. the fans spinning almost all the time and the cpu temps were a little bit higher even on idle.

 

So I decided to replace to a more compatible CPU which is a T8300 C2D @ 2.4GHz. This CPU can be found on early MB4,1. I am trying to match my h/w with a MacBook. Now CPU is matched and the gfx is GMAx3100 which is also a match, the same as the chipset which is GM965 ICH-8M. I have ditched my BCM4311 in exchange for a more compatible AR9280. The things that are not working were the ethernet card (RTL8101E) and the SD Card reader (which I don't care).

 

I have installed iAtkos S3 v2 on it and updated to 10.6.4 with no problems.

 

Renamed as MacBook4,1 in SMBios.plist instead of default MacBookpro4,1, then I have native power management working well.

 

There is still one functionality that is not working... sleep on Lid close and wake on lid open. I can get it to sleep thru sleep menu, power button and Fn+F1.

 

I have tried to edit and patch the dsdt with PNLF, I get sleep but when when i try to wake it thru power button it will just go back to sleep again. So i decide to remove the dsdt.

 

Just this time, i have been reading on this thread and I have extracted my dsdt again and decided to patch the RTC device since I have been using RTC kext on /Extra. After doing it I have successfully removed the other kexts as well, I have removed IOAHCIPortInjector, IOACIStorageBlock, EVOReboot... now I have native restart as well as my geekbench score ramped up to 3340 compared to 1138 before the dsdt patch. Matching geekbench scores for MacBook4,1 (early 2008).

 

My question is, do this notebook really have a LID device? It says it has on the IOReg.

 

Any comments and suggestions?

dsdt.aml.zip

Nameci_s_MacBook.ioreg.zip

Link to comment
Share on other sites

Hello Maldon,

 

Thanks man. I have tried PNLF and DTGP previously, but I have given the dsdt.aml that you gave a shot.

 

Yes, the notebook can do sleep on lid close but within a few seconds after waking up it sleeps again.

 

This is from the kernel logs;

 

 

Oct 10 10:04:08 Namecis-MacBook kernel[0]: display: Not usable

Oct 10 10:04:09 Namecis-MacBook kernel[0]: AirPort: Link Up on en1

Oct 10 10:04:41 Namecis-MacBook kernel[0]: read OCP Reg Error

Oct 10 10:04:41 Namecis-MacBook kernel[0]: write OCP Reg Error 0 [Time 1286719481] [Message System Sleep

Oct 10 10:04:51 Namecis-MacBook kernel[0]: Wake reason = power-button

Oct 10 10:04:51 Namecis-MacBook kernel[0]: System Wake

Oct 10 10:04:51 Namecis-MacBook kernel[0]: Previous Sleep Cause: 0

Oct 10 10:04:51 Namecis-MacBook kernel[0]: AirPort: Link Down on en1. Reason 1 (Unspecified).

Oct 10 10:04:52 Namecis-MacBook kernel[0]: en1: 802.11d country code set to 'US'.

Oct 10 10:04:52 Namecis-MacBook kernel[0]: en1: Supported channels 1 2 3 4 5 6 7 8 9 10 11 36 40 44 48 52 56 60 64 100 104 108 112 116 120 124 128 132 136 140 149 153 157 161 165

Oct 10 10:04:52 Namecis-MacBook kernel[0]: AirPort: Link Up on en1

Oct 10 10:04:58 Namecis-MacBook kernel[0]: AppleRTL8169Ethernet: phyWaitForAutoNegotiation TIMEOUT

Oct 10 10:05:01 Namecis-MacBook kernel[0]: read OCP Reg Error

Oct 10 10:05:01 Namecis-MacBook kernel[0]: write OCP Reg Error 0 [Time 1286719501] [Message System Sleep

Oct 10 10:05:19 Namecis-MacBook kernel[0]: Wake reason = power-button

Oct 10 10:05:19 Namecis-MacBook kernel[0]: System Wake

Oct 10 10:05:19 Namecis-MacBook kernel[0]: Previous Sleep Cause: 0

 

"read OCP Reg error"?

 

I think this is causing the issues on sleeping immediately after wake.

 

Any ideas?

Link to comment
Share on other sites

Hello Maldon,

 

Thanks man. I have tried PNLF and DTGP previously, but I have given the dsdt.aml that you gave a shot.

 

Yes, the notebook can do sleep on lid close but within a few seconds after waking up it sleeps again.

Looks like the LID state doesn't change. Try change the _LID control method to this:-

					Device (LID)
				{
					Name (_HID, EisaId ("PNP0C0D"))
					Method (_LID, 0, NotSerialized)
					{
						If (LEqual (LIDS, Zero))
						{
							Store (Zero, LIDS)
						}
						Else
						{
							Store (One, LIDS)
						}
						Return (LIDS)
					}
				}

Let me know whether it is working or not.

Link to comment
Share on other sites

Hello Kizwan, thanks man.

 

It is still the same thing, would not sleep without PNLF hack. With PNLF hack and with your LID hack it can sleep but still do the same thing, sleeps few seconds after it wakes.

 

Anyway, it is not really a big deal because this thing can still sleep thru SLPB as well as on menus and wakes without issues on PWRB. Well a little additional functionality would be great.

Link to comment
Share on other sites

Hello Kizwan, thanks man.

 

It is still the same thing, would not sleep without PNLF hack. With PNLF hack and with your LID hack it can sleep but still do the same thing, sleeps few seconds after it wakes.

 

Anyway, it is not really a big deal because this thing can still sleep thru SLPB as well as on menus and wakes without issues on PWRB. Well a little additional functionality would be great.

Try this with PNLF:-

					Device (LID)
				{
					Name (_HID, EisaId ("PNP0C0D"))
					Method (_LID, 0, NotSerialized)
					{
						Return (LIDS)
					}
					Name (_PRW, Package (0x02)
					{
						0x19, 
						0x03
					})
				}

I add _PRW control method. Brief description of _PRW:-

This object evaluates to a list of power resources that are dependent on this device and additional information needed for wake, including wake GPE and sleep state information. _PRW is only required for devices that have the ability to wake the system from a system sleeping state.

The value was taken from my DSDT.

Link to comment
Share on other sites

I have found this under device EC0

 

Method (_Q16, 0, NotSerialized)

{

Store (0x16, P80H)

Store (LSTE, LIDS)

^^^GFX0.GLID (LIDS)

Notify (LID, 0x80)

}

 

This key is sending notify to LID device? Could it be the other key combination "Alt+Cmd+F12". I think I have to use the LSTE Register to store the LID status value? Am I correct?

 

Yes, oldNap... that time I was not able to do it becuase of a lot of things... :) my bad...

 

Device (LID)

{

Name (_HID, EisaId ("PNP0C0D"))

Name (LIDS, One)

Method (_LID, 0, NotSerialized)

{

Store (^^PCI0.LPCB.EC0.LSTE, LIDS)

XOr (LIDS, One, Local0)

IF (Local0)

{

Notify (SLPB, 0x80)

}

Return (LIDS)

}

}

 

This dirty hack works fine... :P Now move on to the next waking up from sleep thru LID open... add another method in the to notify PWRB?

 

Thanks for all the suggestions. Editing is just like a walk in the park with DSDT Editor, because of the device tree...

Link to comment
Share on other sites

Did you try that code already?

Device (LID0)
{
Name (_HID, EisaId ("PNP0C0D"))		//LID device
Name (LIDS, One)
Method (_LID, 0, NotSerialized)
{
	Store (^^PCI0.LPCB.EC0.LSTE, LIDS) //LID register
	XOr (LIDS, One, Local0)
	IF (Local0)						//if LID is closed
	{
		Notify (SLPB, 0x80)			//Set system to sleep
	}
	Return (LIDS)
}
}

Link to comment
Share on other sites

This dirty hack works fine... :( Now move on to the next waking up from sleep thru LID open... add another method in the to notify PWRB?

It puts the system to sleep without PNLF? I'm not sure if you need another method or just an ELSE for "if LID is closed".

 

Does it mean that my LID device has no capability for Sleep and Wake? Only turning of backlight?

In my Acer it's the same, closing lid only turns off the backlight. I don't know if in Windows the system sleeps, but if it does, I think it's controlled by the OS.

Link to comment
Share on other sites

thanks oldnap, the dirty hack works, see previous post.

 

Does it mean that my LID device has no capability for Sleep and Wake? Only turning of backlight?

I didn't proposed the SLPB trick since I thought you only want to use PNLF for sleep. :(

 

After you modified the Device (LID0), your LID device now have the sleep capability. Yes, with original DSDT, it only turn OFF the display. As for the _Q16 control method you post earlier, it will triggered by either (or both) when you close the LID or by Fn key if it have any & it doesn't sleep the system without the SLPB trick.

Link to comment
Share on other sites

The funny thing is with PNLF patch it sleeps with lid close, but upon waking up it sleeps again after a few seconds, so it does not stay awake... I don't know if that is the right term. The system can sleep without DSDT patch thru Fn+F1 or thru power button menu or thru OS menu with no issues waking thru power button. So I think that control method _Q16 is functional, but there is no method in LID saying otherwise to get the system to sleep even sending notify from _Q16 control method.

 

With SLPB trick it sure sleeps with lid close and wakes up fine with power button.

 

So it seems the original code in the BIOS does not enable the LID device to get the system to sleep.

 

It puts the system to sleep without PNLF? I'm not sure if you need another method or just an ELSE for "if LID is closed".

 

 

In my Acer it's the same, closing lid only turns off the backlight. I don't know if in Windows the system sleeps, but if it does, I think it's controlled by the OS.

 

Else

{

Notify (PWRB, 0x80)

}

 

It does not work, still needs to push the power button to wake. Upon wake it displays, Shutdown/Restart/Sleep menu window. I think I need to add another control method? and what should it be?

Link to comment
Share on other sites

Upon wake it displays, Shutdown/Restart/Sleep menu window.

That means the code inside Else is run when lid is open.

 

Maybe you need to notify another value to SLPB to wake, instead of notifying PWRB.

 

EDIT: you can try adding a _PRW (see kizwan's post #388)

 

 

@kizwan

 

What do you have inside _L19 under scope _GPE?

Is there a Notify (\_SB.PWRB, 0x02)?

Link to comment
Share on other sites

@kizwan

 

What do you have inside _L19 under scope _GPE?

Is there a Notify (\_SB.PWRB, 0x02)?

On my Aspire 9420, sleep when LID close with SLPB trick & it doesn't wake up when LID open. On windows, it doesn't wake up from sleep too when LID open.

		Method (_L19, 0, NotSerialized)
	{
		Store (0x19, P80H)
		Notify (\_SB.SLPB, 0x02)
	}

There is no PWRB device in the DSDT (also not in the original one). If I put PWRB device manually, when I press the power button, Shutdown/Restart/Sleep menu window won't appear.

Link to comment
Share on other sites

Thanks kizwan.

 

I was going to suggest adding _PRW and _L19, but if yours doesn't wake on lid open, I believe it also won't work on Nameci's.

 

Maybe using Notify (\_SB.SLPB, 0x02) or Notify (\_SB.PWRB, 0x02) in _L19 or in Else of _LID method.

 

About _PRW, do you understand what's the second value in the package?

 

If the data type of this package element is a package, then this _PRW package element is itself a package containing two elements. The first is an object reference to the GPE Block device that contains the GPE that will be triggered by the wake event. The second element is numeric and it contains the bit index in the GPEx_EN, in the GPE Block referenced by the first element in the package, of the enable bit that is enabled for the wake event.
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...