Contribute
Register

Guide for Hacking AMI BIOS DSDTs for OSx86 using DSDTSE

Status
Not open for further replies.
Joined
Apr 7, 2010
Messages
74
Motherboard
MSI B75A-G43
CPU
i5-2500K
Graphics
nVidia 8400GS 512 MB DDR3
Mac
  1. Mac mini
Classic Mac
  1. 128K
  2. 512K
  3. Plus
  4. PowerBook
  5. Quadra
  6. Workgroup Server
Mobile Phone
  1. 0
See the attached Guide.

Peter.
 

Attachments

  • Guide for Hacking AMI BIOS DSDTs.pdf.zip
    18.4 KB · Views: 618
I have improved the Guide to include additional suggestions, and I have included the original (1.40, the latest) DSDT for the ASRock P55DE3 mobo, and the fully edited version of that DSDT with all required OSx86 edits, both as .dsl and .aml files, as examples of this successful process.
 

Attachments

  • Guides and Example for AMI BIOS DSDTs.zip
    68 KB · Views: 381
Here are the devices within the ASRock P55DE3 DSDT and their suggested additions, replacements or deletions.

0x00010000 - P0P1
0x00020000 - GFX0
0x00030000 - P0P3
0x00040000 - P0P4
0x00050000 - P0P5
0x00060000 - P0P6

0x00190000 - GBE (IGBE) Change device name

0x001A0000 - USB4 (UHC5) Change device name, add device-id
0x001A0000 - USB5 (UHC6) Change device name, add device-id
0x001A0000 - USB6 (UHC7) Change device name, add device-id
0x001A0000 - USB7 (UHC8) Change device name, add device-id
0x001A0007 - USBE (EHC2) Change device name, add AAPL stuff

0x001B0000 - ____ (HDEF) Add this device

0x001C0000 - BR20
0x001C0001 - BR21
0x001C0002 - BR22
0x001C0003 - BR23
0x001C0004 - BR24
0x001C0005 - BR25
0x001C0006 - BR26
0x001C0007 - BR27

0x001D0000 - USB0 (UHC1) Change device name, add device-id
0x001D0000 - USB1 (UHC2) Change device name, add device-id
0x001D0000 - USB2 (UHC3) Change device name, add device-id
0x001D0000 - USB3 (UHC4) Change device name, add device-id
0x001D0007 - EUSB (EHC1) Change device name, add AAPL stuff

0x001E0000 - BR1E (HUB0) Change device name, if desired

0x001F0000 - SBRG (LPCB) Change device name
0x001F0002 - IDE0 (SATA) Delete this device and insert a true SATA device tree
0x001F0003 - ____ (SBUS) Add this device
0x001F0005 - IDE1 (____) Delete this device, if desired
 

Attachments

  • F12_1.dsl
    273.6 KB · Views: 145
As Google has been harvesting this site, and as the search key "ami bios osx86" gives this specific thread as Google's first hit, and as downloads are not permitted by nonmembers, I am posting the subject Guide itself.

Guide for Hacking AMI BIOS DSDTs for OSx86 using DSDTSE

1) extract the original DSDT using the Ubuntu technique and write it to an MBR-initialized USB flash drive,

2) transport the USB flash drive to a working Intel-based MacOS X system and deposit the extracted DSDT.aml file on the Desktop,

3) launch DSDTSE, pointing it to the .aml file on the Desktop,

4) perform the required edits, which include at least these:

5) add the DTGP method immediately after the definition block statement if the DTGP method is not already included,

6) delete all "Alias (P00n, CPUn)" statements within the Scope (_PR) block,

7) change all _T_0 and _T_1 occurrences to T_0 and T_1, respectively, as required,

8) change all "MUTE, 0x0nnn" occurrences to "MUTE, 0xFFFF", as required,

9) there may be one or perhaps several very compounded if ... then ... else statements present which do not return a value for the final case; find these using the Compile DSDT command and add the required final Return (Zero) statement, as required,

10) lots of work is usually necessary on the USB devices; change EUSB to EHC1 and USBE to EHC2; change USB0 to UHC1, USB1 to UHC2, etcetera, until all have been changed; add the required AAPL stuff to each, right after the final Method (_PRW, 0, NotSerialized) block in each device (use a Gigabyte USB device modification example as a reference),

11) add the HDEF device (usually 0x001B0000), but keep it as simple as possible, usually just the layout ID and pin configurations blocks; add the call to HDEF, usually within the Method (_L0D, 0, NotSerialized) block,

12) change the SBRG device (usually 0x001F0000) to LPCB,

13) delete the IDE0 device and replace it with a true SATA device tree (usually 0x001F0002),

14) add a true SBUS device (usually 0x001F0003), particularly including the AAPL stuff, if it is missing (and it is usually missing),

15) comment-out the entire IDE1 device (usually 0x001F0005), if desired.

I'm sure there are additional tweaks possible, and possibly even necessary, but these are the biggies.

Peter ([email protected])
 
Thanks for sharing your AMI BIOS DSDT knowledge. My question is a little off topic but you may know the answer. I have the DFT P55-T36 mother board and I'm using the DSDT from the tonymacx86 database. I get the following message during boot:

AppleSMBusPCI::start failed to get acpi path for provider

As well, bdmesg:

ACPI table not found: SSDT.aml

Any suggestions?
 

Attachments

  • rubenmr dsdt.zip
    35 KB · Views: 90
Sorry, can't help you with your SSDT issue.
 
I've got the ASRock HM55 and successfully installed 10.6.5. I've extracted the DSDT attached below. In reviewing your guide as well as the edited P55DE3 DSDT, i have a great appreciation for your work. It begs the question, would it be easier to start with your edited DSDT and edit for the PM55 differences?

Your guide suggests deleting the alias statements. Do you get native SpeedStep with this edit? (I seem to recall an InsanelyMac forum recommending retaining the alias statements.)

It appears at least POP1 and GFX0 may be required to specify graphic card information for unsupported cards. Is the nesting of devices is described differently in the AMI DSDT (i.e., SB.PCI0.POP1)?

Thanks again sharing your knowledge of the AMI bios.
 

Attachments

  • dsdt-ASRock_HM55-120510.aml
    27.3 KB · Views: 144
P0P1 is 0x00010000. P0Pn are used on AMI motherboards, but apparently not on Gigabyte motherboards.

GFX0 is 0x00020000, and is usually associated with a GMA950 or similar on-motherboard GPU. Might also be used for accommodating unusual graphics configurations, such as dual graphics cards and multiple monitors per card.

I have no comment about speedstep and the ALIAS statements.

I think you have to start with your own DSDT. However, many if not all of the changes will be the same.

I have indeed encountered situations where a DSDT for one motherboard is perfectly adequate for another, but I would not want to take that to the bank.

(This situation is probably more likely to occur on Gigabyte motherboards which are externally and internally quite similar, such as the GA-H55M-S2H and the GA-P55M-UD2. Both have ALC888b codecs and R8111 LANs. Sure, the -UD2 has on-motherboard Firewire, but that doesn't affect the DSDT. Also the GSATA2 of the -UD2 is adequately handled by the GSATA2 kext, and not through the DSDT).


Here is a more complete Guide which is the same as before, but was revised and extended to include all the indicated additions:


Guide for Hacking AMI BIOS DSDTs for OSx86 using DSDTSE

1) extract the original DSDT using the Ubuntu technique and write it to an MBR- initialized USB flash drive,

2) transport the USB flash drive to a working Intel-based MacOS X system and deposit the extracted DSDT.aml file on the Desktop,

3) launch DSDTSE, pointing it to the .aml file on the Desktop,

4) perform the required edits, which are, at least these:

5) add the DTGP method immediately after the definition block statement if the DTGP method is not already included,


Name (PHID, "ASRock SATA Device Tree 4i + 2e by [email protected] 2010-11-11") // My comment ... PH's ID ... which describes the most significant modification
Method (DTGP, 5, NotSerialized)
{
If (LEqual (Arg0, Buffer (0x10)
{
/* 0000 */ 0xC6, 0xB7, 0xB5, 0xA0, 0x18, 0x13, 0x1C, 0x44,
/* 0008 */ 0xB0, 0xC9, 0xFE, 0x69, 0x5E, 0xAF, 0x94, 0x9B
}))
{
If (LEqual (Arg1, One))
{
If (LEqual (Arg2, Zero))
{
Store (Buffer (One)
{
0x03
}, Arg4)
Return (One)
}

If (LEqual (Arg2, One))
{
Return (One)
}
}
}

Store (Buffer (One)
{
0x00
}, Arg4)
Return (Zero)
}


6) delete all "Alias (P00n, CPUn)" statements within the Scope (_PR) block,


Scope (_PR)
{
Processor (P001, 0x01, 0x00000810, 0x06) {}
Processor (P002, 0x02, 0x00000000, 0x00) {}
Processor (P003, 0x03, 0x00000000, 0x00) {}
Processor (P004, 0x04, 0x00000000, 0x00) {}
Processor (P005, 0x05, 0x00000000, 0x00) {}
Processor (P006, 0x06, 0x00000000, 0x00) {}
Processor (P007, 0x07, 0x00000000, 0x00) {}
Processor (P008, 0x08, 0x00000000, 0x00) {}
}


7) change all _T_0 and _T_1 occurrences to T_0 and T_1, respectively, as required,

8) change all "MUTE, 0x0nnn" occurrences to "MUTE, 0xFFFF", as required,

9) there may be one or perhaps several VERY compounded IF ... THEN ... ELSE statements present which do not return a value for the final case; find these using the Compile DSDT command and add the required final Return (Zero) statement, as required,

10 lots of work is usually necessary on the USB devices; change EUSB to EHC1 and USBE to EHC2; change USB0 to UHC1, USB1 to UHC2, etcetera, until all have been changed; add the required AAPL stuff to each right after the final Method (_PRW, 0, NotSerialized) block in each of those devices (use the Gigabyte USB device modifications as a reference),


Method (_DSM, 4, NotSerialized) // For each UHCn
{
Store (Package (0x02)
{
"device-id",
Buffer (0x04)
{
0x34, 0x3A, 0x00, 0x00
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}


Method (_DSM, 4, NotSerialized) // For each EHCn
{
Store (Package (0x08)
{
"AAPL,current-available",
0x05DC,
"AAPL,current-extra",
0x044C,
"AAPL,current-in-sleep",
0x09C4,
"device-id",
Buffer (0x04)
{
0x3A, 0x3A, 0x00, 0x00
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}


11) add the HDEF device (usually 0x001B0000), but keep it as simple as possible, usually just the layout ID and pin configurations blocks; add the call to HDEF, usually within the Method (_L0D, 0, NotSerialized) block,


Device (HDEF) // Insert before BR20 device
{
Name (_ADR, 0x001B0000)
Method (_PRW, 0, NotSerialized)
{
Return (Package (0x02)
{
0x0D,
0x05
})
}

Method (_DSM, 4, NotSerialized)
{
Store (Package (0x04)
{
"layout-id",
Buffer (0x04)
{
0x78, 0x03, 0x00, 0x00 // 0x78 for an ALC888, others as required
},

"PinConfigurations",
Buffer (Zero) {}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}


12) change the SBRG device (usually 0x001F0000) to LPCB,

13) replace the IDE0/SATA (usually 0x001F0002) device with a true SATA device,


Device (SATA) // 4 internal plus 2 external; Replace IDE0/SATA device
{
Name (_ADR, 0x001F0002)
Name (_SUN, One)
Device (PRT0)
{
Name (_ADR, Zero)
Method (_GTF, 0, NotSerialized)
{
Name (PIB0, Buffer (0x07)
{
0x00, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xF5
})
Return (PIB0)
}

Method (_DSM, 4, NotSerialized)
{
Store (Package (0x02)
{
"io-device-location",
Buffer (0x06)
{
"Int 1"
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}

Device (PRT1)
{
Name (_ADR, One)
Method (_GTF, 0, NotSerialized)
{
Name (PIB1, Buffer (0x07)
{
0x00, 0x00, 0x00, 0x00, 0x00, 0xB0, 0xF5
})
Return (PIB1)
}

Method (_DSM, 4, NotSerialized)
{
Store (Package (0x02)
{
"io-device-location",
Buffer (0x06)
{
"Int 2"
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}

Device (PRT2)
{
Name (_ADR, 0x02)
Method (_GTF, 0, NotSerialized)
{
Name (PIB2, Buffer (0x07)
{
0x00, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xF5
})
Return (PIB2)
}

Method (_DSM, 4, NotSerialized)
{
Store (Package (0x02)
{
"io-device-location",
Buffer (0x06)
{
"Int 3"
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}

Device (PRT3)
{
Name (_ADR, 0x03)
Method (_GTF, 0, NotSerialized)
{
Name (PIB3, Buffer (0x07)
{
0x00, 0x00, 0x00, 0x00, 0x00, 0xB0, 0xF5
})
Return (PIB3)
}

Method (_DSM, 4, NotSerialized)
{
Store (Package (0x02)
{
"io-device-location",
Buffer (0x06)
{
"Int 4"
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}

Device (PRT4)
{
Name (_ADR, 0x04)
Method (_GTF, 0, NotSerialized)
{
Name (PIB4, Buffer (0x07)
{
0x00, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xF5
})
Return (PIB4)
}

Method (_DSM, 4, NotSerialized)
{
Store (Package (0x02)
{
"io-device-location",
Buffer (0x06)
{
"Ext 5"
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}

Device (PRT5)
{
Name (_ADR, 0x05)
Method (_GTF, 0, NotSerialized)
{
Name (PIB5, Buffer (0x07)
{
0x00, 0x00, 0x00, 0x00, 0x00, 0xB0, 0xF5
})
Return (PIB5)
}

Method (_DSM, 4, NotSerialized)
{
Store (Package (0x02)
{
"io-device-location",
Buffer (0x06)
{
"Ext 6"
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}

Method (_DSM, 4, NotSerialized)
{
Store (Package (0x06)
{
"device_type",
Buffer (0x10)
{
"AHCI Controller"
},

"model",
Buffer (0x1D)
{
"ICH10-R SATA/AHCI Controller"
},

"name",
Buffer (0x1D)
{
"ICH10-R SATA/AHCI Controller"
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}


14) add a true SBUS device (usually 0x001F0003), particularly including the AAPL stuff, if it is missing (and it usually IS missing),


Device (SBUS) // Insert before HDEF device
{
Name (_ADR, 0x001F0003)
OperationRegion (PBAS, PCI_Config, 0x20, 0x02)
Field (PBAS, ByteAcc, NoLock, Preserve)
{
BAS0, 16
}

Method (SMBB, 0, NotSerialized)
{
And (BAS0, 0xFFFE, Local0)
Return (Local0)
}

Device (BUS0)
{
Name (_CID, "smbus")
Name (_ADR, Zero)
Device (DVL0)
{
Name (_ADR, 0x57)
Name (_CID, "diagsvault")
}

Method (_DSM, 4, NotSerialized)
{
Store (Package (0x02)
{
"address",
0x57
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}
}


15) comment-out the entire IDE1/SAT1 device (usually 0x001F0005).

I'm sure there are additional tweaks possible, and possibly even necessary, but these are the biggies.

Peter ([email protected])
 
Thank you for the additional detail. I did a brute force DSDT to get audio and graphics working on my HM55. In the meantime, please confirm your Device (SATA) described in your most recent post replaces the original Device (SATA) and Device (SAT1).
 

Attachments

  • dsdt.aml
    36.9 KB · Views: 127
In general, the so-called SATA devices are really IDE-type devices which are intended to be operated in IDE compatibility mode, although in most instances these will also operate in AHCI mode, too, and with the full number of AHCI-supported devices, even though the prototype in the DSDT has only four supported devices (CHAN 0, PRI AND SEC; CHAN 1, PRI AND SEC).

This is perhaps why some DSDTs have an IDE0/SATA device 0x001F0002 and an IDE1/SAT1 device 0x00F0005 ... IDE0/SATA for SATA-connected devices and IDE1/SAT1 for PATA-connected devices.

The IDE0/SATA device is the one which is completely replaced with a true SATA device tree in my DSDTs, the IDE1/SAT1 device is either deleted entirely, or it is left alone.

As I never run PATA devices on any of my Hacks, I tend to delete the IDE1/SAT1 device.

In my ASRock P55DE3 DSDT, I have replaced the SATA device (which would be IDE0/SATA on other mobos) with my SATA device tree and I have enclosed the IDE1/SAT1 device in /* ... */.

This results in the .aml file being somewhat smaller, yet the .dsl file still contains the original code, suitably commented-out.
 
Status
Not open for further replies.
Back
Top