Contribute
Register

DSDT Editing From Scratch: Understanding DSDT from the ground up

Status
Not open for further replies.
Joined
Mar 25, 2014
Messages
5
Mac
  1. 0
Classic Mac
  1. 0
Mobile Phone
  1. 0
When it comes to DSDT my brain is a block of swiss cheese and my intention with this post is to fill those holes with a much firmer understanding of how DSDT works... and of course get my machine running OSX in a stable like fashion.

From what I understand there are plenty of patches available that one can use but the dilemma is that you got to have an exact motherboard on the list for which the DSDT Patch was made for. Right now I have to make the best with what I have and cant go buy compatible hardware but I've been told in the forums that this thing has a chance.

I'm, rocking this thing...
S445-10126-main01-mm.jpg
The Gateway SX2801-07e

Intel Pentium E5700

6GB DDR3 RAM

I don't believe I'm going to be finding any patches for this specific motherboard which I believe is: DIG43L/GREYHOUND GATEWAY SX2801-07E LGA775

So I would imagine that means I've go some DSDT editing w/o using patches to make everything work...right?

Thats where nothing makes sense... I'm beginning to become familiar with what the code looks like from staring at it long enough, but I have barely begun to really grasp how the devices plug into this code in the DSDT.

From what I understand you have to figure where the device is in the code and then add new code to make it work... is that considered a patch?

What doesn't make sense is all these device Ids like HDEF, DTGP,PEX0 and sooooo many more in addition to all the numbers and x's that make no logical sense to me at this point... this is like learning a new language... what does it all mean and how does it all come together?

So here is where I am at.

I already have OSX 10.9 Installed...

I managed to get ethernet working with an AppleIntelE1000e.kext

I understand that integrated Intel GMA X4500 will not work so I will be installing a Geforce 210 once I get an HDMI connector so I can take it out of my windows machine and put a bigger card in that one bringing the low profile Geforce 210 card into this machine. I tested it to fit and work OOB. of course I don't know how to test if the QE/CI, whatever it's called is working.

Now for everything else...

here is quick shot of my lspci output:

Matts-iMac:~ Matt$ lspci -nnpcilib: 0000:00:02.0 64-bit device address ignored.
00:00.0 Host bridge [0600]: Intel Corporation 4 Series Chipset DRAM Controller [8086:2e20] (rev 03)
00:02.0 VGA compatible controller [0300]: Intel Corporation 4 Series Chipset Integrated Graphics Controller [8086:2e22] (rev 03)
00:02.1 Display controller [0380]: Intel Corporation 4 Series Chipset Integrated Graphics Controller [8086:2e23] (rev 03)
00:19.0 Ethernet controller [0200]: Intel Corporation 82567V-2 Gigabit Network Connection [8086:10ce]
00:1a.0 USB controller [0c03]: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #4 [8086:3a37]
00:1a.1 USB controller [0c03]: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #5 [8086:3a38]
00:1a.2 USB controller [0c03]: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #6 [8086:3a39]
00:1a.7 USB controller [0c03]: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #2 [8086:3a3c]
00:1b.0 Audio device [0403]: Intel Corporation 82801JI (ICH10 Family) HD Audio Controller [8086:3a3e]
00:1c.0 PCI bridge [0604]: Intel Corporation 82801JI (ICH10 Family) PCI Express Root Port 1 [8086:3a40]
00:1d.0 USB controller [0c03]: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #1 [8086:3a34]
00:1d.1 USB controller [0c03]: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #2 [8086:3a35]
00:1d.2 USB controller [0c03]: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #3 [8086:3a36]
00:1d.7 USB controller [0c03]: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #1 [8086:3a3a]
00:1e.0 PCI bridge [0604]: Intel Corporation 82801 PCI Bridge [8086:244e] (rev 90)
00:1f.0 ISA bridge [0601]: Intel Corporation 82801JIB (ICH10) LPC Interface Controller [8086:3a18]
00:1f.2 SATA controller [0106]: Intel Corporation 82801JI (ICH10 Family) SATA AHCI Controller [8086:3a22]
00:1f.3 SMBus [0c05]: Intel Corporation 82801JI (ICH10 Family) SMBus Controller [8086:3a30]
01:00.0 FireWire (IEEE 1394) [0c00]: VIA Technologies, Inc. VT6315 Series Firewire Controller [1106:3403]
Matts-iMac:~ Matt$

Currently I get 7 warnings when I compile/extract my dsdt.. I posted about them on another forum and was told that it was no big deal.

My next step right now is to get audio working.

What I'm working with is this:
00:1b.0 Audio device [0403]: Intel Corporation 82801JI (ICH10 Family) HD Audio Controller [8086:3a3e]

I found this guide right here that seems to have the solution of enabling this device through adding this code below to my DSDT followed by installing a customized AppleHDA.kext.

Device (HDEF) {
Name (_ADR, 0x001B0000) // _ADR: Address
Method (_PRW, 0, NotSerialized) // _PRW: Power Resources for Wake
{
Return (Package (0x02)
{
0x0D,
0x05
})
}
Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
{
Store (Package (0x06)
{
"layout-id",
Buffer (0x04)
{
0x0C, 0x00, 0x00, 0x00
},
"platformFamily",
Buffer (One)
{
0x00
},
"PinConfigurations",
Buffer (Zero) {}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)

For starters what does this code even mean?

What are all of these 0x00's and similar number sequences?

The guide says to "edit DSDT pointing to 12 (hex 0C) layout ID, as on the HDEF text file attached"... The HDEF text file being the above code.

What is 12 (hex 0C)? what is lay out ID?

What I have done up to this point is attempted to paste this HDEF text into my extracted DSDT right in between Device (P0P4) and Device (P0P5)... the only understanding of why is because thats what the guy who wrote the guide did on his DSDT that he shared in the guide.

So when I go to compile and save this to test if it will work I get 9 errors instead 7 warnings and it refuses to let me save...

I've tried both DSDTSE and MAciASL

It looks like this:
Intel ACPI Component ArchitectureASL Optimizing Compiler version 20091214 [Dec 16 2009]
Copyright (C) 2000 - 2009 Intel Corporation
Supports ACPI Specification Revision 4.0


/Users/Matt/Library/Application Support/EvOSoftware/DSDT/DSDTFiles/dsdt.dsl 6976: If (SS1)
Error 4096 - syntax error, unexpected PARSEOP_IF ^


/Users/Matt/Library/Application Support/EvOSoftware/DSDT/DSDTFiles/dsdt.dsl 7020: \_SB.PCI0.SBRG.SIOS (Arg0)
Error 4064 - Object does not exist ^ (\_SB.PCI0.SBRG.SIOS)


/Users/Matt/Library/Application Support/EvOSoftware/DSDT/DSDTFiles/dsdt.dsl 7021: \_SB.PCI0.NPTS (Arg0)
Error 4064 - Object does not exist ^ (\_SB.PCI0.NPTS)


/Users/Matt/Library/Application Support/EvOSoftware/DSDT/DSDTFiles/dsdt.dsl 7022: \_SB.PCI0.SBRG.SPTS (Arg0)
Error 4064 - Object does not exist ^ (\_SB.PCI0.SBRG.SPTS)


/Users/Matt/Library/Application Support/EvOSoftware/DSDT/DSDTFiles/dsdt.dsl 7023: \_SB.PCI0.GFX0.OPTS (Arg0)
Error 4064 - Object does not exist ^ (\_SB.PCI0.GFX0.OPTS)


/Users/Matt/Library/Application Support/EvOSoftware/DSDT/DSDTFiles/dsdt.dsl 7029: \_SB.PCI0.SBRG.SIOW (Arg0)
Error 4064 - Object does not exist ^ (\_SB.PCI0.SBRG.SIOW)


/Users/Matt/Library/Application Support/EvOSoftware/DSDT/DSDTFiles/dsdt.dsl 7030: \_SB.PCI0.NWAK (Arg0)
Error 4064 - Object does not exist ^ (\_SB.PCI0.NWAK)


/Users/Matt/Library/Application Support/EvOSoftware/DSDT/DSDTFiles/dsdt.dsl 7031: \_SB.PCI0.SBRG.SWAK (Arg0)
Error 4064 - Object does not exist ^ (\_SB.PCI0.SBRG.SWAK)


/Users/Matt/Library/Application Support/EvOSoftware/DSDT/DSDTFiles/dsdt.dsl 7032: \_SB.PCI0.GFX0.OWAK (Arg0)
Error 4064 - Object does not exist ^ (\_SB.PCI0.GFX0.OWAK)


ASL Input: /Users/Matt/Library/Application Support/EvOSoftware/DSDT/DSDTFiles/dsdt.dsl - 7037 lines, 226511 bytes, 3146 keywords
Compilation complete. 9 Errors, 0 Warnings, 0 Remarks, 0 Optimizations


So that is as detailed as I can get as to my status with hackintoshing, I really want to learn this! I have to work with what I got since I cant go buy new parts right now.

I appreciate you taking the time to read this long thread and consider helping figure this out and wrap my head around DSDT editing. I have a feeling this stuff is easy once you've pulled your hair out long enough trying to make things work.

Thanks a Ton for your future help!

:)
 
...
Thats where nothing makes sense... I'm beginning to become familiar with what the code looks like from staring at it long enough, but I have barely begun to really grasp how the devices plug into this code in the DSDT.

From what I understand you have to figure where the device is in the code and then add new code to make it work... is that considered a patch?

DSDT patches are not a panacea. You can't make an unsupported device work with DSDT patches.

What doesn't make sense is all these device Ids like HDEF, DTGP,PEX0 and sooooo many more in addition to all the numbers and x's that make no logical sense to me at this point... this is like learning a new language... what does it all mean and how does it all come together?

It is a computer language. If you're a developer, you should read the ACPI spec for more information: http://acpi.info/spec.htm

Note: HDEF is not a "device-id", but rather a name for a Device in AML. In other words, don't confuse the name you see in DSDT with the PCI device-ids (which are numbers). OS X matches DSDT device names to actual PCI devices by address (and perhaps other details).

Also, DTGP is not a device-id. It is a method name.

Before patching DSDT, you need to have an idea about what issue you're trying to fix and whether it can be fixed with a DSDT edit or not.

My next step right now is to get audio working.

What I'm working with is this:


I found this guide right here that seems to have the solution of enabling this device through adding this code below to my DSDT followed by installing a customized AppleHDA.kext.

You need to have a patched AppleHDA that is specifically for your codec. To find out your audio codec, use Linux to get an audio codec dump. Google 'patch AppleHDA guide' for more information.

These DSDT patches are common for laptops. You can probably use the same for your desktop:

DSDT patches you need for AppleHDA: https://github.com/RehabMan/Laptop-DSDT-Patch
Apply: "Audio Layout 12" (change layout-id from 12 to the layout-id used by the patched AppleHDA)
Apply: "IRQ Fix"

For starters what does this code even mean?

What are all of these 0x00's and similar number sequences?

The _DSM patch is a very common patch which can inject properties into the ioreg for the object within which the _DSM method is placed. In this case, it is injecting three properties "layout-id", "platformFamily", and "PinConfigurations". The "platformFamily" injection is probably unnecessary. The values that follow each property name will be the value of the property.

What I have done up to this point is attempted to paste this HDEF text into my extracted DSDT right in between Device (P0P4) and Device (P0P5)... the only understanding of why is because thats what the guy who wrote the guide did on his DSDT that he shared in the guide.

That particular code will need to also have DTGP defined somewhere. If you look at my patch, you'll see it does away with DTGP, simplifying the process. Also, use of an automated patch can insure the code is inserted into the correct area.
 
Hey man, thanks for your help brotha...

DSDT patches are not a panacea. You can't make an unsupported device work with DSDT patches.

Cool, I figured as much... what I meant was that are a lot of motherboards with the DSDT's already available... but in this case it seems I'm going to have to hunt down how to make every piece of hardware work...

is there anything you see from lspci output that looks like OSX would not support it? that would be good to know so I don't have to put more effort into something that wont work... but I think this will work! :)

If you're a developer, you should read the ACPI spec for more information:
http://acpi.info/spec.htm

I am not a developer, I'm a pretty darn computer savvy guy that is new to hackintoshing and this is a 995 page pdf on this foreign language... any particular section or other resource you recommend for a noob to grasp how DSDT works together with these "methods" and device ids/ pci addresses? and what is ACPI in relation to DSDT?

Note: HDEF is not a "device-id", but rather a name for a Device in AML. In other words, don't confuse the name you see in DSDT with the PCI device-ids (which are numbers). OS X matches DSDT device names to actual PCI devices by address (and perhaps other details).

So is HDEF the name of a device in the DSDT.aml with certain parameters specified in the code for that device and then the device HDEF is the matched up with PCI device id properties to actually tell it how to work?

DTGP is not a device-id. It is a method name.

What is the DTGP method do? how does it work with HDEF?

You need to have a patched AppleHDA that is specifically for your codec. To find out your audio codec, use Linux to get an audio codec dump. Google 'patch AppleHDA guide' for more information.

What is the best way to boot linux from a dvd/cd or usb? is there a particular version of linux you recommend that could be run this way to avoid having to install linux on the actual hard drive?

DSDT patches you need for AppleHDA: https://github.com/RehabMan/Laptop-DSDT-Patch
Apply: "Audio Layout 12" (change layout-id from 12 to the layout-id used by the patched AppleHDA)
Apply: "IRQ Fix"

Could you explain this further?

I took a look at these patches... so are these patches not meant for particular mother boards? meaning you could use these patches generically?

my biggest hickup for not taking action with these DSDT edits is because I thought every piece of code had to be written for a specific mother board. and I was somewhat lost at sea as to understanding what I can and cant use... which is where I got the idea that I would have to edit the DSDT from scratch without using anyone's premade edits that would not be specifically written for my motherboard. is it more hardware/device specific then motherboard specific? for example: this Intel Corporation 82801JI (ICH10 Family) HD Audio Controller that I'm trying to get working...

also what is IRQ fix and how do I apply it?

The _DSM patch is a very common patch which can inject properties into the ioreg for the object within which the _DSM method is placed.

What is the _DSM Method? how does it work and exactly is Ioreg? what does that do? how does it all relate?

That particular code will need to also have DTGP defined somewhere. If you look at my patch, you'll see it does away with DTGP, simplifying the process. Also, use of an automated patch can insure the code is inserted into the correct area.

May I see your guide please?

How do you know right off the bat that this method I am using needs DTGP? obviously I still dont get what DTGP does exactly...

The holes in my head are getting smaller... I feel I'm grasping my understanding much further after reading your very generous response...

Though I still don't get it... I feel progress is being made...

Thank you so much Rehab man!
 
is there anything you see from lspci output that looks like OSX would not support it? that would be good to know so I don't have to put more effort into something that wont work... but I think this will work! :)

I'm not familiar with old computers like yours. You'll find out more as you attempt to install...

I am not a developer, I'm a pretty darn computer savvy guy that is new to hackintoshing and this is a 995 page pdf on this foreign language... any particular section or other resource you recommend for a noob to grasp how DSDT works together with these "methods" and device ids/ pci addresses? and what is ACPI in relation to DSDT?

Without any programming experience, you'll have difficulty understanding DSDT...

So is HDEF the name of a device in the DSDT.aml with certain parameters specified in the code for that device and then the device HDEF is the matched up with PCI device id properties to actually tell it how to work?

DSDT participates with drivers to make things work. Mac firmware injects (into ioreg) various properties to affect various features of the drivers. These properties can also be injected by the bootloader using EFI injection. By looking at real Macs DSDT, the hackintosh community figured out how to inject these properties via _DSM methods, such that all injections don't need to happen inside the bootloader.

What is the DTGP method do? how does it work with HDEF?

The DTGP method is a method copied from real Mac's DSDT. It is a utility method that makes coding of Mac's _DSM methods easier. _DSM methods have to respond appropriately depending on the params passed in, which vary depending on which OS is calling the method. When we patch a DSDT for OS X exclusively, we can skip some of these checks and avoid using DTGP completely (because we know our DSDT _DSM will only be called by OS X). Thus why my patches don't use DTGP.

What is the best way to boot linux from a dvd/cd or usb? is there a particular version of linux you recommend that could be run this way to avoid having to install linux on the actual hard drive?

I use a USB. I have both a 12.04LTS USB and a 14.04LTS USB.

Could you explain this further?

For quick instructions on using MaciASL and applying patches, read the README at the link already provided.

I took a look at these patches... so are these patches not meant for particular mother boards? meaning you could use these patches generically?

Some patches are specific to a given board. Some are generic. Obviously Intel hardware from various OEMs have a lot in common and there are only a few BIOS vendors, so there tend to be a lot of common patches.

my biggest hickup for not taking action with these DSDT edits is because I thought every piece of code had to be written for a specific mother board. and I was somewhat lost at sea as to understanding what I can and cant use... which is where I got the idea that I would have to edit the DSDT from scratch without using anyone's premade edits that would not be specifically written for my motherboard. is it more hardware/device specific then motherboard specific? for example: this Intel Corporation 82801JI (ICH10 Family) HD Audio Controller that I'm trying to get working...

also what is IRQ fix and how do I apply it?

First you need to determine what audio codec you have (all Intel based motherboards use Intel HD audio, but the audio codec varies widely). Until you know what audio codec you have and have a patched AppleHDA for it, there is little point in applying any DSDT patches for audio.

As for "IRQ Fix", it is a DSDT patch that arranges IRQs to how OS X likes. That's all I know. Make sure you read the README so you understand how to use MaciASL to apply patches from MaciASL patch repos.

What is the _DSM Method? how does it work and exactly is Ioreg? what does that do? how does it all relate?

_DSM is a reserved method. DSM stands for "Device Specific Method". It is a generic method that can be used for just about anything. OS X uses it for a very specific purpose... to allow DSDT to inject properties into ioreg.

The ioregistry is a data repository OS X uses to keep track of devices. Device drivers (kexts) use it to store configuration information/runtime data/etc as well. You can read about the IO registry in Apple's developer documentation.

May I see your guide please?

What guide?

How do you know right off the bat that this method I am using needs DTGP? obviously I still dont get what DTGP does exactly...

Read the code. It clearly calls DTGP.
 
Cool, thanks again for your response!

I've been digesting our conversation with multiple read-throughs
and just now having time to reply.

I'm getting closer and closer to figuring this out.

Without any programming experience, you'll have difficulty understanding DSDT...

I have experience with HTML and CSS... does that help?


Make sure you read the README so you understand how to use MaciASL to apply patches from MaciASL patch repos.

Reading this README helped me immensely to understand
how these patches work, (the process of applying a patch using MaciASL)

Thank you for this. :) -->
https://github.com/RehabMan/Laptop-DSDT-Patch

My next concern maybe noobish...

I noticed you recommend using your Rehabman version of MaciASL,
I downloaded it but I'm uncertain how to build the app from the files...

found here: -->
https://github.com/RehabMan/OS-X-MaciASL-patchmatic

Could you please shed some light on how to do that?

Mac's file system is still relatively new to me...

I don't know the first place to look for /usr/local/bin:
and as such I am unable to run the command:
cp patchmatic /usr/local/bin/patchmatic

So for now I am just using the latest version of MaciASL...

A Small Success!

When I compiled my DSDT I had about 9 buffer/package errors
and I just sought out in the list of patches from your repository
the patch that matched the description "Fix_PLD Buffer/Package Error"
and boom all those errors cleared up.

So that was cool! I feel I learned something in that process.

So now to get audio working...

In MaciASL if I choose your "Audio Layout 12" fix It displays that
there will be 2 patches, 0 changes, 0 rejects and the "Apply"
button is grayed out and unclickable...

Does this mean that my audio is already Layout 12?

What should I do?


Moving on...

I downloaded a desktop image of Ubuntu 14.04LTS and burned it to a DVD...

Popped it in and booted Linux from the DVD...

I pulled up the Terminal and entered:
cat /proc/asound/card0/codec#2 > ~/Desktop/codec_dump.txt

after codec#0 and codec#1 did not work. and boom I got a codec_dump.txt

It looks like this...

View attachment codec_dump.txt


What I find interesting is that according to the
codec dump it says
Realtek ALC888...

I thought that my device was a realtek ALC1200
because When I run lspci -nn it outputs this as my audio controller:

00:1b.0 Audio device [0403]: Intel Corporation 82801JI (ICH10 Family) HD Audio Controller [8086:3a3e]

After Googling around I found that original guide
I had mentioned in my first post in this thread about
adding the HDEF and DTGP edits...

The guide led me to believe that
00:1b.0 Audio device
[0403]: Intel Corporation 82801JI (ICH10 Family) HD Audio Controller [8086:3a3e]
was a Realtek ALC1200

but is the codec_dump.txt telling us that its ALC888?


I've been scouring through a ton of internet on getting
audio working and there is a lot of different information
and it has all yet to stick in my head with a full understanding...

So before I make any changes to my DSDT or anything else
I don't fully understand yet I'd like to take a step back
and attack this from a fresh start...

...again here is my codec dump...
View attachment codec_dump.txt

What step would be next?

I've Googled a bit about patching AppleHDA and it looks intensive...

Is patching AppleHDA the next step or is there something
simpler that can be done now that we have the codec dump?

Really I'm looking for some clarity and understanding
on what approach I need to take...


I'd like to avoid doing anything unnecessary that could cause more confusion.

Also I noticed
in Multi-Beast...

the ALC888 under Drivers > Audio > Realtek ALCxxx

Could I run that and get audio working?

What is the difference between ALC888 Legacy v100202
and ALC888 Current v100302?

How would I know which to select?


This thread continues to help me understand more about Hackintoshing..

I am grateful.

Thankyou x infinite

:)






 
I have experience with HTML and CSS... does that help?

That explains all the dizzying use of fonts/formatting/etc in your posts...

Experience with page description languages probably don't help much with low level systems programming.

I noticed you recommend using your Rehabman version of MaciASL,
I downloaded it but I'm uncertain how to build the app from the files...

Read the README for download locations.

/usr/local/bin/patchmatic

You don't need patchmatic to use MaciASL. Patchmatic is for automated patches using Terminal, make, or for those building automated installers.

So now to get audio working...

In MaciASL if I choose your "Audio Layout 12" fix It displays that
there will be 2 patches, 0 changes, 0 rejects and the "Apply"
button is grayed out and unclickable...

Does this mean that my audio is already Layout 12?


No. It means the patch does not apply to your DSDT. You would have to examine what the patch is attempting to do (it looks for a device at 0x001b0000) and determine why your DSDT doesn't have that device (it is common for older desktop boards to omit the HDEF device @1b).

You might refer to my patches for DH67xx: https://github.com/RehabMan/Intel-DH67XX-DSDT-Patch

But there are easier ways to deal with layout-id (HDAEnabler module installed as part of Chimera).

codec dump it says Realtek ALC888...

Supported by Multibeast...
 
Thanks again guys...

Turns out VoodooHDA.kext with AppleHDADisabler.kext into extra/extensions got the audio working.

I downloaded the latest version from sourcefourge.

I repaired permissions, did the reboot and boom it worked!

At first i was confused about VoodooHDA and how to install it because it had extra files like"prefane" that I didn't understand. Paralysis over analysis had me make it way harder then it really was. I sure did learn alot about hackintoshing in the process though... :)

Swoosh!

I believe I now have ethernet, audio, and accelerated graphics working...

is my hackintosh fully operational?

what else is there to tweak?
 
I believe I now have ethernet, audio, and accelerated graphics working...

is my hackintosh fully operational?

what else is there to tweak?

Top question, i would say power management, sleep, lots of other stuff, but with just those 2 you'll have yer hands full for a while, i would start with the power management, sleep, ... will keep you awake :p
 
Status
Not open for further replies.
Back
Top