Jump to content

Decompiled original Apple DSDTs


Andy Vandijck
 Share

144 posts in this topic

Recommended Posts

well it's not just a matter of battery meter I guess. I haven't tried anything yet but if we could make that applesmartbattery control our batteries we could have better battery performances as well... I mean, a friend of mine's old mbp with a 4000mah battery shows 2 hours left at 47%, I will pm superhai :)

 

btw these are the pieces of code that make the two devices communicate:

 

under BAT0:

 

					Method (UBSS, 0, NotSerialized)
					{
						\_SB.PCI0.LPCB.EC.SMB0.SBRW (0x0A, 0x01, RefOf (BSSW))
					}

					Method (UBIF, 0, NotSerialized)
					{
						\_SB.PCI0.LPCB.EC.SMB0.SBRW (0x0B, 0x18, RefOf (Local0))
						Multiply (Local0, 0x0A, Index (PBIF, 0x01))
						\_SB.PCI0.LPCB.EC.SMB0.SBRW (0x0B, 0x10, RefOf (Local0))
						Multiply (Local0, 0x0A, Index (PBIF, 0x02))
						\_SB.PCI0.LPCB.EC.SMB0.SBRW (0x0B, 0x19, RefOf (Local0))
						Store (Local0, Index (PBIF, 0x04))
						\_SB.PCI0.LPCB.EC.SMB0.SBRB (0x0B, 0x21, RefOf (Local0))
						Store (Local0, Index (PBIF, 0x09))
						Store (Buffer (0x01)
							{
								0x00
							}, Index (PBIF, 0x0A))
						\_SB.PCI0.LPCB.EC.SMB0.SBRB (0x0B, 0x22, RefOf (Local0))
						Store (Local0, Index (PBIF, 0x0B))
						\_SB.PCI0.LPCB.EC.SMB0.SBRB (0x0B, 0x20, RefOf (Local0))
						Store (Local0, Index (PBIF, 0x0C))
					}

					Method (UBST, 0, NotSerialized)
					{
						\_SB.PCI0.LPCB.EC.SMB0.SBRW (0x0B, 0x09, RefOf (Local2))
						Store (Local2, Index (PBST, 0x03))
						\_SB.PCI0.LPCB.EC.SMB0.SBRW (0x0B, 0x0A, RefOf (Local0))
						If (And (Local0, 0x8000))
						{
							Not (Local0, Local0)
							And (Increment (Local0), 0xFFFF, Local0)
						}

						Multiply (Local0, Local2, Local0)
						Divide (Local0, 0x03E8, , Index (PBST, 0x01))
						\_SB.PCI0.LPCB.EC.SMB0.SBRW (0x0B, 0x0F, RefOf (Local0))
						Multiply (Local0, 0x0A, Index (PBST, 0x02))
						Store (0x00, Local1)
						If (PWRS)
						{
							\_SB.PCI0.LPCB.EC.SMB0.SBRW (0x0B, 0x16, RefOf (Local0))
							If (LNot (And (Local0, 0x40)))
							{
								Store (0x02, Local1)
							}
						}
						Else
						{
							Store (0x01, Local1)
						}

						Store (Local1, Index (PBST, 0x00))
					}

 

and under SMB0:

 

					Method (SBRW, 3, NotSerialized)
					{
						Store (One, Local0)
						If (LNot (Acquire (\_SB.PCI0.LPCB.EC.SMB0.SMTX, 0xFFFF)))
						{
							If (LEqual (SPTR, 0x00))
							{
								Store (ShiftLeft (Arg0, 0x01), SADR)
								Store (Arg1, SCMD)
								Store (0x09, SPTR)
								Store (SBPC (0x03E8), Local0)
								If (LNot (Local0))
								{
									Store (SBDW, Arg2)
								}
							}

							Release (\_SB.PCI0.LPCB.EC.SMB0.SMTX)
						}

						Return (Local0)
					}

					Method (SBRB, 3, NotSerialized)
					{
						Store (One, Local0)
						Store (Buffer (0x01)
							{
								0x00
							}, Local1)
						If (LNot (Acquire (\_SB.PCI0.LPCB.EC.SMB0.SMTX, 0xFFFF)))
						{
							If (LEqual (SPTR, 0x00))
							{
								Store (ShiftLeft (Arg0, 0x01), SADR)
								Store (Arg1, SCMD)
								Store (0x0B, SPTR)
								Store (SBPC (0x03E8), Local0)
								If (LNot (Local0))
								{
									Store (SBFR, Arg2)
								}
							}

							Release (\_SB.PCI0.LPCB.EC.SMB0.SMTX)
						}

						Return (Local0)
					}

Link to comment
Share on other sites

I was wrong, the battery meter is actually shown but it detects no battery. However, it seems like it tries to find it at startup, 'cos at the beginning it says Power Source: Battery and then it becomes AC Adapter, while in system profiler the battery info appears (empty). I tried different combinations of code but without luck so far.

 

btw, could anyone extract the dsdt from the macbooklate3,1.ioreg posted on the first page? it's dramatically similar to my laptop's hardware... pls

Link to comment
Share on other sites

I was wrong, the battery meter is actually shown but it detects no battery. However, it seems like it tries to find it at startup, 'cos at the beginning it says Power Source: Battery and then it becomes AC Adapter, while in system profiler the battery info appears (empty). I tried different combinations of code but without luck so far.

 

btw, could anyone extract the dsdt from the macbooklate3,1.ioreg posted on the first page? it's dramatically similar to my laptop's hardware... pls

Yes it would be interesting to have such an ioreg...

I know it's UBST that reports the battery status so if we can get that to work, it should be a step in the right way...

Link to comment
Share on other sites

andy, what I understood so far is that UBST method is just meant to dial with SMB0 device and report the right values to the _BST one, which we all have in our dsdts... I don't know if it's actually necessary to keep it since for example in my laptop those values are already there (XST0,1,2,3). however it would be interesting to hear something from superhai...

Link to comment
Share on other sites

andy, what I understood so far is that UBST method is just meant to dial with SMB0 device and report the right values to the _BST one, which we all have in our dsdts... I don't know if it's actually necessary to keep it since for example in my laptop those values are already there (XST0,1,2,3). however it would be interesting to hear something from superhai...

Yes, that is true, the SMB0 device (SMBus device) reports this right back to the UBST method.

Read SMBus specifications for more info... (Freely available on the net...)

Link to comment
Share on other sites

  • 2 weeks later...
Hello,

 

I'm looking for an iMac8,1 (Anniversary) ioreg and/or ACPIdump if someone has one please let me know.

I don't wan't to abuse but 3,06GHz model would be better, thanks

 

A noob asking: DSDT patcher don't works for me cause seems that my DSDT is near correct...

So do i need some workaround on the ACPI ? (I have an IOACPITree in IOreg showing all names execpt SMbus and my DRAM controller witch is not supported)

 

SMBusPCI is loadable but don't see any changes in ioreg but IOSMbusFamily works with Slice method.

In ioreg the smbus device-id is shown <"0)"> so it's why i have to force IOSMbusFamily.kext

 

DRAM controller have a correct device-id shown as <e0 29 00 00> but the only test i've done with NB support by Slice result in a KP.

 

Anyway it's just for testing and learning cause even used as DDR my DDR3 works pretty fast without issues.

And i know that even true macbook pro with DDR3 may use DDR3 the same way.

 

I don't pretend to be good as the less good here. Excuse me if i disturb you and then don't answer me

 

bye

For the iMac8,1 ioreg dump I can not help you as I only have one for an iMac5,1.

My latest SMBIOS is capable of being set for DDR3 as Apple added this since 10.5.6 (AppleSMBIOS-33).

Link to comment
Share on other sites

seriously guys, is anybody able to extract the dsdt table from this file??

 

macbooklate3_1.ioreg.zip

 

edit: i found a macbook3,1 dsdt from another topic.. dunno if it's the very same but I think this is the real deal for a lot of laptops, here it is

 

DSDT_Macbook3.1.dsl.zip

Sure, can do, will use this file to extract the DSDT table and post the dsl after decompilation...

Link to comment
Share on other sites

@coconup: Same here i'm almost tempted to load the dsdt as is just to see what happens. however i'm sure this is probably not advisable. what are the key things that need editing in order to begin loading the dsdt? obviously audio but the graphics card is the same (not sure about revision id though) if this came from the 2.2ghz macbook then i have the same processor. i'm not sure where to start but i think it makes more sense to start with the cleaner mac dsdt and make it more like mine than the other way round. or have i got this completely wrong?

Link to comment
Share on other sites

@coconup: Same here i'm almost tempted to load the dsdt as is just to see what happens. however i'm sure this is probably not advisable. what are the key things that need editing in order to begin loading the dsdt? obviously audio but the graphics card is the same (not sure about revision id though) if this came from the 2.2ghz macbook then i have the same processor. i'm not sure where to start but i think it makes more sense to start with the cleaner mac dsdt and make it more like mine than the other way round. or have i got this completely wrong?

To my knowledge the Mac DSDT only works on true Mac but you can adapt + perfect your own DSDT so it is more like the MacBook one (not mentioning adding the system identification on top... you can instead of your own system id...).

You can also add some of the APP000X stuff...

 

seriously guys, is anybody able to extract the dsdt table from this file??

 

macbooklate3_1.ioreg.zip

 

edit: i found a macbook3,1 dsdt from another topic.. dunno if it's the very same but I think this is the real deal for a lot of laptops, here it is

 

DSDT_Macbook3.1.dsl.zip

NOTE: The dsl you've posted is from a MacBook4,1, just look at the top.

DefinitionBlock ("macbook.aml", "DSDT", 1, "APPLE ", "MacBook", 0x00040001)

Haven't had time yet to look at the ioreg file... (I'll get to that though...).

Link to comment
Share on other sites

I did reply this on January on the SSDT bootloader thread cause my Sony Vaio laptop´s DSDT and Macbook 3,1 are nearly equal

 

Auto quote:

Hi, here i have attached ALL the acpi tables from my Sony Vaio Cr11R/Z laptop, i use Appleintelcpupowermanagement.kext for speedstep (i get same cpu temperatures as genericintelcpupowermanagement. kext from Superhai, and faster cpu response when stepping with apple kext, fan also works as spected).

The only problem i have is when i shutdown the laptop, it restarts, (This has been my nightmare since 10.5.1).

I edited my battery on DSDT several months ago cause was the only different code from Macbook and i just had success as some of you here, just got the battery icon, but still there is missing real time checking for the battery status, so i have kept my main battery DSDT code.

 

Tables included:

APIC,APIC-1,BOOT,DSDT,FACP,HPET,MCFG,RSDT,SLIC,SSDT,SSDT-1,SSDT-2,SSDT-3,SSDT-4.

 

 

Extra information:

I have modified my Sony dsdt, ported code from Macbook3.1 for bluetooth, network card, Airport (for my dell 1390), added DTGP method to _wak, Changed (DEVICE) names to match Macbook names, Added _SUN to network pci´s for Profiler recognition, added HPET and RTC patch, then flashed it to bios (That´s why my dsdt will be different from other Sony vaio´s when readed from memory).

I haven´t add Video or audio injection cause incompatibility with ALC262 and ATIx2300

 

I have even loaded the whole DSDT.aml from the macbook3,1, just changing a little the cpu code, harware adresses and getting back my PCI IRQ´s (LNKA,LNKB,LNKC...etc) to the macbook code and removing the IRQ to DEVICE (SMC). (As pointed by Roisoft, thanks, bro.) smile.gif

 

Hope this info helps.

 

Attached:

Sony Vaio ACPI Tables and Ioreg

Mackbook 3,1 DSDT.dsl and Ioreg

DSDT_Mackbook_3_1.zip

Sony_Vaio_CR11z_R_ACPI_tables_and_IOREG.zip

Link to comment
Share on other sites

k well i loaded the 3,1 dsdt (the one anv posted) and it just sat at the grey loading screen little thing spinning to its hearts content but no further. i tried to boot into single user mode to remove the dsdt.aml but it started looping "battery reported power at zero" or something to that effect. obviously this is to do with the different locations of my battery and the apple battery. i'm going to edit the dsdt so that it sees my bat and continue through verbose mode editing until it boots. it picked up the firewire port though, so not a dead loss.

Link to comment
Share on other sites

k well i loaded the 3,1 dsdt (the one anv posted) and it just sat at the grey loading screen little thing spinning to its hearts content but no further. i tried to boot into single user mode to remove the dsdt.aml but it started looping "battery reported power at zero" or something to that effect. obviously this is to do with the different locations of my battery and the apple battery. i'm going to edit the dsdt so that it sees my bat and continue through verbose mode editing until it boots. it picked up the firewire port though, so not a dead loss.

All of the addresses need to be set for the addresses of your hardware.

Add also the needed interrupt links of your HW...

That should make it work...

Also you might be thinking of adding the HPET procedure as used in MacBookPro5,1 but with your HPET's address of course... it is a serialized entry...

Link to comment
Share on other sites

Currently collected:

-iMac5,1

-iMac7,1

-MacPro3,1

-MacBook2,1

-MacBook3,1

-MacBook4,1

-MacBookPro5,1

-MacBookAir1,1

 

These could be used for fixing up your devices.

I've used this to enable the Apple ACPI Power adapter to attach properly on the power supply of my Packard Bell EasyNote MZ-35 200 notebook.

You can also add for example the backlight control (APP0003 I think) and then it will enable the driver + control.

Many more is possible...

 

Like I say, a manual DSDT fix saves the day...

 

Enjoy and feast your eyes.

 

NOTE: Any other genuine Mac IORegistryExplorer saves (.ioreg files) are welcome, I can use these for more stuff like this...

If you don't have IORegistryExplorer (from XCode, preferred dump format) please make the dump with the following four commands:

 

echo "IOService:" > [MACHINE_ID].txt

 

ioreg -l -p IOService -w 99999 >> [MACHINE_ID].txt

 

echo "IODeviceTree:" >> [MACHINE_ID].txt

 

ioreg -l -p IODeviceTree -w 99999 >> [MACHINE_ID].txt

 

This will ensure all of the for various things needed data is there...

 

 

Also added my ioreg files...

New DSDTs... enjoy...

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...

I'm looking for the DSDT and SSDT tables from a macbook1,1.

 

An ioreg would do also as i can export the tables from this.

 

I've got a laptop with a T2400 processor and after wiki'ing mac books. It looks as if this macbook is the closest match. i.e. Processor, chipset and GMA950 Graphics.

 

I've successfully got my laptop to work (cpus=1) with the macpro1,1 dsdt and ssdt tables. But since the macpro1,1 is a desktop type computer it doesn't require the battery, cst or ist sections in the tables.

 

Can anyone help me?

 

Much appreciated!!

 

--

AB

Link to comment
Share on other sites

  • 2 months later...

attached you will find MacBook1,1 Dumped.

 

Contains:

 

IORegistryExplorer Dump

Andys Instructions Dump

decompiled dsdt

decompiled ssdt

 

Later This evening i have the possibility to dump MacMini1,1 when it is needed just tell me.

Edit: the mini is running tiger, is the procedure to get dsdt the same?

 

MacBook1_1.zip

Link to comment
Share on other sites

  • 3 weeks later...
  • 6 months later...
  • 8 months later...

New .ioreg files + extracted info available from following rapidshare link:

http://rapidshare.com/files/432521215/ioregs_collection.zip

Link to comment
Share on other sites

 Share

×
×
  • Create New...