ProjectOSX

Welcome Guest!

Returning User? Login here.

Want membership privileges? Register here.

> DSDT

Differentiated System Description Table (DSDT) - DSDT is a part of the ACPI specification and it supplies configuration information about a base system. ACPI capable computers come with a preinstalled DSDT from the manufacturer. A common Linux/OS X problem is missing ACPI functionality (fans not running, laptop screens not shutting off, etc.)

This subforum is dedicated to patches/fixes able to be inserted/modified from an extracted dsdt.dsl, which is then compiled into a DSDT.aml for OS X to pick up and use (with a proper bootloader).

These fixes are not permanent, and do not damage your BIOS.

 
Start a new topic Add Reply
> Easy DSDT Fix Guide for Snow, This is an explanatory guide for fixing RTC for snow
apocolipse269
post Aug 28 2009, 06:24 PM
Post #1
Simply DSDT
This guide is intended for people with some osx know how, but no dsdt know how (which there are quite a few), but the layman can possibly fix his DSDT with this guide as well.

First things first, we're going to go download Fassl's DSDT patcher,
it is located here http://www.projectosx.com/forum/index.php?...hl=dsdt_patcher

this is going to be the easiest way to get your DSDT from your bios.
we're not going to be using the DSDT_Patcher program just yet though, first we're going to be fixing the RTC, so we will be using the tools that DSDT_Patcher provides.

First things first, navigate to the folder where you Downloaded/unzipped dsdt_patcher from Fassl
CODE
Home:~ User$ cd ~/Downloads/DSDT_Patcher



Second, we're going to copy the iasl tool to our /usr/bin directory so it can be run from anywhere. IASL is Intels AML Compiler/decompiler. It is extremely strict on the rules of ACPI Specification, which is why we like to use it for OSX86. Most of our mainboards are made by non-Apple manufacturers, and most of them prefer to use the Microsoft AML Compiler, which is a little more relaxed when it comes to DSDT, just like Microsoft windows. (for more information on ACPI Specification visit http://www.acpi.info/spec)

To Copy iasl do this:
CODE
Home:~ DSDT_Patcher$ cp Tools/iasl /usr/bin/


Ok so now we're ready to get our DSDT out of ioreg. The Easy way is to use the getDSDT.sh script found in Tools. So do the following:
CODE
Home:~ DSDT_Patcher$ cd Tools
Home:~ Tools$ ./getDSDT.sh


Now what we have is a file named dsdt.dat, we need to decompile this file to get it in a readable form. since we moved iasl to /usr/bin, we can run it from anywhere (it is in the Tools folder but it doesnt matter now). Type this code to get the DSDT.dsl file.

CODE
Home:~ Tools$ iasl -d dsdt.dat


Now you should have a file named DSDT.dsl, congrats you're halfway there smile.gif

Ok so the first thing we're going to fix is going to be the RTC (or the Real Time Clock). This fix is to repair some errors in the bios with CMOS resets and such. Some of the guides can be a bit confusing on how to fix this, they say to make your RTC device look like this:
CODE
                Device (RTC)
                {
                    Name (_HID, EisaId ("PNP0B00"))
                    Name (_CRS, ResourceTemplate()
                    {
                        IO (Decode16, 0x0070, 0x0070, 0x00, 0x02)
                    })
                }




Well this is correct, but a bit misdirecting. I'm going to explain how to do it yourself by showing you my original RTC0 device (if your device is RTC0 dont worry, its just a difference in naming)
This is my original RTC0 Device in DSDT.dsl:
CODE
            Device (RTC0)
            {
                Name (_HID, EisaId ("PNP0B00"))
                Name (BUF2, ResourceTemplate ()
                {
                    IO (Decode16,
                        0x0070,             // Range Minimum
                        0x0070,             // Range Maximum
                        0x00,               // Alignment
                        0x02,               // Length
                        )
                })
                Name (BUF3, ResourceTemplate ()
                {
                    IO (Decode16,
                        0x0070,             // Range Minimum
                        0x0070,             // Range Maximum
                        0x00,               // Alignment
                        0x02,               // Length
                        )
                    IRQ (Edge, ActiveHigh, Exclusive, )
                        {8}
                })
                Method (_CRS, 0, NotSerialized)
                {
                    If (And (^^LPC0.HPTF, 0x04))
                    {
                        Return (BUF2)
                    }
                    Else
                    {
                        Return (BUF3)
                    }
                }


Now i want you to take a look at this. This code is a lot more complex than the suggested RTC Fix, or so it looks at least. Firstly, you do not want to just copy/replace the RTC device with the one suggested. First look at yours, if it is similar, the fix is to remove the IRQ. If you notice the _CRS name in the "suggested fix" is a "Name", in mine its a "Method", however i have 2 "Name"'s that look almost identical to both eachother, and the _CRS "Name" in the "Suggested Fix", the difference is the second one has an IRQ. The "Method" _CRS in MY DSDT returns either one or the other (BUF2 or BUF3), essentially doing the same thing as the "Name" _CRS in the "Suggested Fix", however the rest of my DSDT Expects _CRS to be a method, therefore I Can't just call it a "Name" and remove the method.

Take a look, these are the lines that need to be removed:
CODE
                    IRQ (Edge, ActiveHigh, Exclusive, )
                        {8}




The appropriate fix for mine specifically is:
CODE
            Device (RTC0)
            {
                Name (_HID, EisaId ("PNP0B00"))
                Name (BUF2, ResourceTemplate ()
                {
                    IO (Decode16,
                        0x0070,             // Range Minimum
                        0x0070,             // Range Maximum
                        0x00,               // Alignment
                        0x02,               // Length
                        )
                })
                Name (BUF3, ResourceTemplate ()
                {
                    IO (Decode16,
                        0x0070,             // Range Minimum
                        0x0070,             // Range Maximum
                        0x00,               // Alignment
                        0x02,               // Length
                        )
                })
                Method (_CRS, 0, NotSerialized)
                {
                    If (And (^^LPC0.HPTF, 0x04))
                    {
                        Return (BUF2)
                    }
                    Else
                    {
                        Return (BUF3)
                    }
                }


Notice I Simply removed the IRQ from BUF3, so it is no longer there. Remember, delete anything in {} directly after the IRQ Call. This isnt absolutely necessary, as it will do nothing (unless there are some calls in there, in which case you do need to remove the {}'s after the IRQ Call, mine just had {8} after it).


If you have line(s) that look like this:
CODE
0x04,               // Length


Simply change the 0x04 to 0x02, this will fix the cmos reset issues (most DSDT's have this to 0x02 already)

Once that's done, save-as a new file named dsdt-fixed.dsl. We will be saving it as a different file for now so we can keep a fresh copy of our raw DSDT.

Now that that's done, lets go back to the DSDT_Patcher directory:
CODE
Home:~ Tools$ cd ..


Ok, now that we're here, we might as well run DSDT_Patcher, which will fix some other minor problems typical in PC DSDT's. to do this, simply run the program like this:
CODE
Home:~ DSDT_Patcher: ./DSDT\ Patcher dsdt-fixed.dsl


You will see some text explaining what it is looking for and what it has fixed, afterwards there will be a prompt for OS Emulation, type "0" for Darwin/OSX. Once it is finished, you will see if there are any compiler errors, warnings, remarks, etc. If there are a lot of errors (more than 200) your dsdt.aml will not be compiled. First thing is to check the RTC Device you edited, make sure that all {} are proper, for every { there must be a }, so after Device (RTC0) you will see one {, now count opens"{" and closes "}" until you get to the end of the device, the end of the device is the } that is indented the same as the open for it. If you still get errors after that, please consult some of the users on IRC or here. irc.osx86.hu #snowleopard or #hackint0sh, there are some dsdt experts there, myself I am fairly versed after reading ACPI Spec, and we will be more than willing to help (provided you have followed the appropriate steps).

If you get 0 errors and a dsdt.aml is popped out, simply copy this file to either / or /Extra (on your Leopard or Snow Leopard installation) and you'll be good to go smile.gif

I Hope this mini-simple DSDT Fix is helpful.

EDIT: Added Code section specifying IRQ Line's

This post has been edited by apocolipse269: Sep 25 2009, 06:50 AM
Jeremy Pack
post Oct 21 2010, 11:43 PM
Post #2
Just wanted to give you props and a huge "thanks" for this insightful guide. My DSDT was slightly different than yours and, thanks to your explanation, I was able to make the appropriate edits fairly simply. Best of all, I understood what I was doing. It worked like a charm for my hardware--BTW--but I'm more thankful for the shared knowledge.

Thanks again! You rock!
Gringo Vermelho
post Oct 22 2010, 06:19 AM
Post #3
Very nice guide with good explanations, thank you.

If any other P5Q-E owners are reading - this fix is not needed on the P5Q-E, "Length" is 0x02 already:

CODE
                Device (RTC0)
                {
                    Name (_HID, EisaId ("PNP0B00"))
                    Name (_CRS, ResourceTemplate ()
                    {
                        IO (Decode16,
                            0x0070,             // Range Minimum
                            0x0070,             // Range Maximum
                            0x00,               // Alignment
                            0x02,               // Length
                            )
                        IRQNoFlags ()
                            {8}
                    })
                }

You can leave the IRQ in as well.

This post has been edited by Gringo Vermelho: Oct 22 2010, 06:25 AM
ASUS P8Z77-V Pro - EVGA GTX 660 - i5-3570K - 10.9.1 retail - Chameleon 2.2 svn r22xx

Add Reply Start a new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: