Sonntag, 4. Oktober 2009

4.) [10.6] Prepare a DSDT

DSDT is an acronym for Differentiated System Description Table. I've already wrote about it. Please read this article first as an introduction and to get some general infos. Modifying the original DSDT from your mainboard is the most complicated part of all. Unfortunately Mac OS X 10.6 "Snow Leopard" does not boot with the most of the original DSDTs.

First you might look into the "DSDTs ready for use with Chameleon" thread in the efixusers.com forum. There you can find a lot of already patched DSDTs I've made. Maybe you will find the one you need for your mainboard/BIOS-version already there. If not leave me a request there or continue here...

Using an Ububtu LiveCD is the easiest way to obtain the original DSDT. Boot the Ubuntu LiveCD and start a Terminal: Applications->Accessories->Terminal

In the Terminal run the following commands to dump the DSDT into the file dsdt.aml (will appear on the Desktop):
ubuntu@ubuntu:~$ cd Desktop
ubuntu@ubuntu:~/Desktop$ sudo cat /proc/acpi/dsdt > dsdt.aml


You can go even further and modify the DSDT right here using the Ubuntu LiveCD. To do so install the AML-Disassembler/Compiler "iasl". Open the Synaptic Package Manager:
System->Administration->SynapticPackageManager

Enter "iasl" in Quick search, click on the Checkbox left from the iasl Package and select "Mark for Installation", then click on Apply. This will install the "iasl" compiler/decompiler.


In a first step you must decompile the DSDT. In the still open Terminal run:
ubuntu@ubuntu:~$  iasl -d dsdt.aml

Intel ACPI Component Architecture
AML Disassembler version 20081204 [Jan 10 2009]
Copyright (C) 2000 - 2008 Intel Corporation
Supports ACPI Specification Revision 3.0a

Loading Acpi table from file dsdt.aml
Acpi table [DSDT] successfully installed and loaded
Pass 1 parse of [DSDT]
Pass 2 parse of [DSDT]
Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)
..................................................................................................................................................................................................................................................................................................................................................................................................................................................
Parsing completed
Disassembly completed, written to "dsdt.dsl"
Now fix all Errors and Warnings and the HPET, RTC and TMR device as described here.

Another very important fix for "Snow Leopard" is the CMOS Reset Fix. Without this fix AppleRTC.kext will corrupt the CMOS NVRAM used by the BIOS, so that you must reconfigure the BIOS settings at every Boot/Restart. Open "dsdt.dsl" in your favorite editor and find the RTC device.
Device (RTC)
{
Name (_HID, EisaId ("PNP0B00"))
Name (ATT0, ResourceTemplate ()
{
IO (Decode16,
0x0070, // Range Minimum
0x0070, // Range Maximum
0x00, // Alignment
0x04, // Length
)
IRQNoFlags ()
{8}
})
Name (ATT1, ResourceTemplate ()
{
IO (Decode16,
0x0070, // Range Minimum
0x0070, // Range Maximum
0x00, // Alignment
0x04, // Length
)
})
Method (_CRS, 0, NotSerialized)
{
Return (ATT1)
}
}
And change the length of the IO segment ATT1 (marked red) from 0x04 to 0x02.
Device (RTC)
{
Name (_HID, EisaId ("PNP0B00"))
Name (ATT0, ResourceTemplate ()
{
IO (Decode16,
0x0070, // Range Minimum
0x0070, // Range Maximum
0x00, // Alignment
0x04, // Length
)
IRQNoFlags ()
{8}
})
Name (ATT1, ResourceTemplate ()
{
IO (Decode16,
0x0070, // Range Minimum
0x0070, // Range Maximum
0x00, // Alignment
0x02, // Length
)
})
Method (_CRS, 0, NotSerialized)
{
Return (ATT1)
}
}
Chameleon RC2 introduced a new feature to autodetect the graphic card and the builtin ethernet ports (Time Machine Fix). Unfortunately this works only when the UID of the PCI root device PCI0 is 0. All Gigabyte DSDTs I've fixed are using UID=1 and therefore the autodetection does not work. Find the following _SB -> PCI0 -> Name (UID, 0x01) (marked red):
Scope (\_SB)
{
Device (PWRB)
{
Name (_HID, EisaId ("PNP0C0C"))
Method (_STA, 0, NotSerialized)
{
Return (0x0B)
}
}

Device (PCI0)
{
Name (_HID, EisaId ("PNP0A03"))
Name (_ADR, 0x00)
Name (_UID, 0x01)
Name (_BBN, 0x00)
Method (_S3D, 0, NotSerialized)
...and replace it with Name (UID, 0x00) (marked green):
Scope (\_SB)
{
Device (PWRB)
{
Name (_HID, EisaId ("PNP0C0C"))
Method (_STA, 0, NotSerialized)
{
Return (0x0B)
}
}

Device (PCI0)
{
Name (_HID, EisaId ("PNP0A03"))
Name (_ADR, 0x00)
Name (_UID, 0x00)
Name (_BBN, 0x00)
Method (_S3D, 0, NotSerialized)

Now you have a DSDT with all mandatory patches to run Mac OS X 10.6. Just compile it and use the resulting dsdt.aml along with Chameleon.
ubuntu@ubuntu:~$  iasl -ta dsdt.dsl

Intel ACPI Component Architecture
AML Disassembler version 20081204 [Jan 10 2009]
Copyright (C) 2000 - 2008 Intel Corporation
Supports ACPI Specification Revision 3.0a

ASL Input: dsdt.dsl - 5931 lines, 197099 bytes, 2427 keywords
AML Output: dsdt.aml - 18854 bytes, 667 named objects, 1760 executable opcodes

Compilation complete. 0 Errors, 0 Warnings, 0 Remarks, 31 Optimizations
These are some other useful DSDT patches. You can fix the USB Device Removal Warning for the EHCI ports, make Onboard Sound or the Powerbutton working. I will describe some of them later.

Keine Kommentare:

Kommentar veröffentlichen