- Joined
- May 6, 2012
- Messages
- 120
- Motherboard
- MSI Z77A-G43
- CPU
- Core i7 3770K
- Graphics
- Intel HD4000
- Mac
- Classic Mac
- Mobile Phone
Hey, I just fixed all my compilation errors on the MSI Z77A-G43 (BIOS v2.4) and I thought I could share my edits here if anybody else runs into the same troubles. So this is a small guide on how to get your DSDT compiled without any errors or warnings and apply some additional patches to get a nice, clean and more "Apple like" DSDT to start with.
What I'm going to explain:
- Extract your DSDT
- Fix compilation errors
- Name your devices more "Apple like"
- Add DGTP method
What you need:
- A DSDT Editor (I recommend DSDT Editor)
Note that this whole procedure could also be done a little easier with DSDT auto patching for some fixes but doing it manually you learn a lot more and get used to patching DSDT by yourself.
So let's get started:
1. Patch your BIOS to latest version (v2.4)
This is very important because in the worst case scenario you could damage your motherboard. This guide is for BIOS v2.4, so you have to get exactly that same version. It could probably work for earlier or later versions, but your are on your own doing this.
2. Extract your DSDT
This is simple: Open up DSDT editor and choose "File > Extract DSDT".
3. Fix compilation errors
In DSDT Editor choose "IASL > Compile", a window should pop up showing a bunch of errors and warnings:
compile-errors.png
You can see that it tells you we have errors, warnings and remarks. There should be only 1 error and we can fix it right away with DSDT Editor. Simply click on "Fix errors" and it now should say "0 Errors".
But we still have left a lot of warnings and remarks that have to be fixed, so let's move on. We will go through this step by step. You have to double click on each error message and it takes you to the location where the error occured.
2226 Warning ResourceTag larger than Field (Tag: 64 bits, Field: 32 bits)
Replace
With
3318 Warning Result is not used, possible operator timeout will be missed
Replace
With
8787 Warning Not all control paths return a value (_DSM)
8787 Warning Reserved method must return a value (Integer/String/Buffer/Package/Reference required for _DSM)
Put
to the end of Method (_DSM, 4, Serialized), so that it looks like this:
10113 Warning Not all control paths return a value (_HID)
10113 Warning Reserved method must return a value (Integer/String required for _HID)
Replace
With
Lastly we should have a lot of:
5626 Remark Use of compiler reserved name (_T_0)
10350 Remark Use of compiler reserved name (_T_1)
To fix this hit Command + F (to open up search and replace) and enter the following:
search-replace.png
Then click on "Replace All" and close search window.
Now everything should be fixed. Click on "IASL > Compile" and it should compile without any errors, warnings or remarks.
4. Rename your devices
Next up is renaming some devices to get closer to Apple's naming scheme. There might be some more you could rename, but those are the ones I know of and found inside the DSDT.
You need to open up search and replace (Command + F) again for each of this edits and be sure to always click on "Replace All":
Find: GFX0 Replace: IGPU
Find: COPR Replace: MATH
5. Add DGTP method
Lastly we are going to prepare our DSDT for future patching by adding the DGTP method, which is needed if you want to patch HDEF or other things. Simply put this directly at the end of the file before the last "}" and after WAK method.
6. Compile and save DSDT.aml
Click on "IASL > Compile" again to compile your DSDT with latest changes and finally save by clicking on "IASL > Save AML as..."
What I'm going to explain:
- Extract your DSDT
- Fix compilation errors
- Name your devices more "Apple like"
- Add DGTP method
What you need:
- A DSDT Editor (I recommend DSDT Editor)
Note that this whole procedure could also be done a little easier with DSDT auto patching for some fixes but doing it manually you learn a lot more and get used to patching DSDT by yourself.
So let's get started:
1. Patch your BIOS to latest version (v2.4)
This is very important because in the worst case scenario you could damage your motherboard. This guide is for BIOS v2.4, so you have to get exactly that same version. It could probably work for earlier or later versions, but your are on your own doing this.
2. Extract your DSDT
This is simple: Open up DSDT editor and choose "File > Extract DSDT".
3. Fix compilation errors
In DSDT Editor choose "IASL > Compile", a window should pop up showing a bunch of errors and warnings:
compile-errors.png
You can see that it tells you we have errors, warnings and remarks. There should be only 1 error and we can fix it right away with DSDT Editor. Simply click on "Fix errors" and it now should say "0 Errors".
But we still have left a lot of warnings and remarks that have to be fixed, so let's move on. We will go through this step by step. You have to double click on each error message and it takes you to the location where the error occured.
2226 Warning ResourceTag larger than Field (Tag: 64 bits, Field: 32 bits)
Replace
Code:
CreateDWordField (BUF0, \_SB.PCI0._Y0F._LEN, MSLN)
Code:
CreateQWordField (BUF0, \_SB.PCI0._Y0F._LEN, MSLN)
3318 Warning Result is not used, possible operator timeout will be missed
Replace
Code:
Acquire (MUT0, 0x0FFF)
Code:
Acquire (MUT0, 0xFFFF)
8787 Warning Not all control paths return a value (_DSM)
8787 Warning Reserved method must return a value (Integer/String/Buffer/Package/Reference required for _DSM)
Put
Code:
Return (Zero)
Code:
Method (_DSM, 4, Serialized)
{
Name (DRET, Buffer (0x04)
{
0x00
})
If (LEqual (Arg0, Buffer (0x10)
{
/* 0000 */ 0xE1, 0x75, 0x39, 0x6F, 0x82, 0x7A, 0x67, 0x4F,
/* 0008 */ 0x8B, 0x97, 0x15, 0xBE, 0xE0, 0x60, 0xBE, 0xDF
}))
{
If (LEqual (Arg2, Zero))
{
CreateWordField (DRET, Zero, F0SS)
Store (0x02, F0SS)
Return (DRET)
}
If (LEqual (Arg2, One))
{
If (LEqual (^^PEG0.PEGP.LNKV, 0x03))
{
Return (Zero)
}
Return (One)
}
}
Return (Zero)
}
10113 Warning Not all control paths return a value (_HID)
10113 Warning Reserved method must return a value (Integer/String required for _HID)
Replace
Code:
Method (_HID, 0, NotSerialized)
{
If (TCMF) {}
Else
{
Return (0x310CD041)
}
}
Code:
Method (_HID, 0, NotSerialized)
{
If (TCMF)
{
Return (Zero)
}
Else
{
Return (0x310CD041)
}
}
Lastly we should have a lot of:
5626 Remark Use of compiler reserved name (_T_0)
10350 Remark Use of compiler reserved name (_T_1)
To fix this hit Command + F (to open up search and replace) and enter the following:
search-replace.png
Then click on "Replace All" and close search window.
Now everything should be fixed. Click on "IASL > Compile" and it should compile without any errors, warnings or remarks.
4. Rename your devices
Next up is renaming some devices to get closer to Apple's naming scheme. There might be some more you could rename, but those are the ones I know of and found inside the DSDT.
You need to open up search and replace (Command + F) again for each of this edits and be sure to always click on "Replace All":
Find: GFX0 Replace: IGPU
Find: COPR Replace: MATH
5. Add DGTP method
Lastly we are going to prepare our DSDT for future patching by adding the DGTP method, which is needed if you want to patch HDEF or other things. Simply put this directly at the end of the file before the last "}" and after WAK method.
Code:
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. Compile and save DSDT.aml
Click on "IASL > Compile" again to compile your DSDT with latest changes and finally save by clicking on "IASL > Save AML as..."