ProjectOSX

Welcome Guest!

Returning User? Login here.

Want membership privileges? Register here.

 
Start a new topic Add Reply
> Device Property strings, EFI
fassl
post Feb 21 2009, 01:08 AM
Post #1
I did a rough 1st-draft translation, hope it's OK.. don't know if this was already done - Hagar


EFI (Extensible Firmware Interface)
is in a sense the sucessor of the BIOS, and is used by Apple.
If you wish to know more: http://en.wikipedia.org/wiki/Extensible_Firmware_Interface

On Macs, EFI provides certain vital hardware information which is needed for the setup and booting of OS X. As we don't have EFI on our PCs, but only the oldschool BIOS, this information has to be provided by other means. Formerly, this was achieved by patching the kernel & certain kexts. These days we have bootloaders which can make the most important data avaiable toallow us to boot the vanilla kernel & kexts. One of the bootloaders, in my opinion the best, is Chameleon. It alsoe has a whole load of other features, see the full list on their homepage.

Ok, so now we can use vanilla kernel & kexts, but what about graphics cards, sound cards and netwrking?

This is where the so-called injectors coem into play. Injectors initially took the form of kexts (and sill do, in cases like nvkush & natit) they inject specific information into the IORegistry, so that OS X knows what graphic card we have & what driver to load. The accuracy of this information is very important, as the slightest error can cause the wrong kext to load, or none at all. An alternative way to inject these values are "device-properties" Strings. Modified Bootloaders like Chameleon support these, and I will explain how to make them below in this thread. The newest method for injecting these values is through DSDT. I'll explain more about that in a differen topic.

For soundcards it is often sufficient to inject the "layout-id" so that the AppleHDA.kext loads, although this isn't generally (except with an ALC889 codec) enough to get sound. You also need to patch AppleHDA.kext , there are many good tutorials for this on the web (Google is your friend). As there is a universal driver being worked on it hardly sems worthwhile to pursue this futher, and what's more I'm not going to do so here.

For networking, we just inject one cvalue: "built-in". This is useful for eliminating UUID error 35 and thus getting time machine to work, amongst other things.

How to generate a "device-properties"-string for your Graphics Card

We will need the following:
  • A suitable bootloader installed (Chameleon)
  • gfxutil
  • Property List Editor

You can find the tools Here

A Functioning Injector (Natit/Nvinject/NvinjectGo/Atiinject/NVkush....)
An example-String:


Now lets get cooking:

<you>Extracting your Device-Path</you>
  • Open Terminal(/Applications/Utilities/Terminal.app)
  • cd "Folder containing GFXUTIL"
  • ./gfxutil -f display


Now the tool spits out the device-path of your graphics card, which will look something like this:
CODE
DevicePath = PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)

Leave this window open or copy this string to PciRoot.

<you>Editing the Plist</you>

If the example-string you downloaded doesn't have a .plist, we will have to generate one. Otherwise just edit the plist that's there.
  • ./gfxutil -i hex -o xml "paste the hex data into termional here" string.plist
Now open your example-plist with Property List Editor



Highlighetd here is the Device-Path, replace it with yours (See Point 2)

<you>Get the information from your injector:</you>
  • Open Console (/Applications/Utilities/Console.app)
  • Select system.log on the left
  • type in the name of your injector Injector (e.g NVinject) in the search fireld at the top right

    Should look a lot like this:

    CODE
    NVinject: Probing.
               NVinject: Setting NVPM=<data not shown>
               NVinject: Setting @0,device_type=display
               NVinject: Setting NVCAP=<data not shown>
               NVinject: Setting @0,compatible=NVDA,NVMac
               NVinject: Setting model=Graphics by NVIDIA
               NVinject: Setting @1,name=NVDA,Display-B
               NVinject: Setting device_type=NVDA,Parent
               NVinject: Setting name=display
               NVinject: Setting rom-revision=NVinject 0.2.1
               NVinject: Setting @0,name=NVDA,Display-A
               NVinject: Setting @1,compatible=NVDA,NVMac
               NVinject: Setting @1,device_type=display
  • now add these values to your plist
  • only change the values you get from console
Note: It's likely that the values are of type 'data' (hexadecimal), but you might as well set the the class to a string type and enter the value as simple text (ONLY for values like name, model, etc. NOT for numerical values such as NVCAP:


We get the NVCAP and NVPM values (and other values displayed as: <data not shown>) with:
  • ioreg -lw 0 -p IODeviceTree | grep NVCAP
  • ioreg -lw 0 -p IODeviceTree | grep NVPM
Save the modified plist.

<you>Now we convert this plist back to a hex string</you>
  • ./gfxutil -i xml -o hex YOUR_STRING.plist YOUR_STRING.hex

Our string is now in YOUR_STRING.hex (you can open it with text edit)

<you>Now we need to get the string into the Boot.plist</you>

  • Backup the Boot.plist: cp /Library/Preferences/SystemConfiguration/com.apple.Boot.plist /Library/Preferences/SystemConfiguration/com.apple.Boot.plist.old
  • Open the Boot.plist with Property List Editor
  • click on Root -> New Child "device-properties" ; Class = String ; Value = your generated hex-string



  • save the plist in a folder that you can access, e.g. Desktop
  • Now copy the modified Boot.plist into the correct folder: sudo cp ~/Desktop/com.apple.Boot.plist /Library/Preferences/SystemConfiguration/

Now, we're done ;)

One more thing: The injector has to be deactivated, we do that with:
  • sudo mv /System/Library/Extensions/"your Injector".kext /System/Library/Extensions/"your Injector".kext.old
  • sudo touch /System/Library/Extensions/

Reboot and Good Luck ;)

You can check whether the string injected with:
  • ioreg -lw 0 -p IODeviceTree | grep device-prop



creating a "device-properties"-string for Network Cards
We need the following:
  • A suitable bootloader installed (Chameleon)
  • gfxutil
  • Property List Editor

The Tools are HERE

<you>Extracting the Device-Path</you>
  • Open Terminal (/Applications/Utilities/Terminal.app)
  • cd "Folder containing GFXUTIL"
  • ./gfxutil -f ethernet

Now the Tool spits out the device-path of your network card, which will look something like this:
CODE
DevicePath = PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)

Leave this window open or copy this string to PciRoot.

<you>Editing the Plist</you>
If you've already made a String for your Graphics card, Open it & simply add another device path entry, adding the key built-in with the value <01> as shown below.


save the modified plist.

<you>Now wew convert this plist into a hex string</you>
  • ./gfxutil -i xml -o hex YOUR_STRING.plist YOUR_STRING.hex

Our String is now in YOUR_STRING.hex (can be opened with text edit)

<you>Now we need to add the string to the Boot.plist again:</you>
  • Backup the Boot.plist: cp /Library/Preferences/SystemConfiguration/com.apple.Boot.plist /Library/Preferences/SystemConfiguration/com.apple.Boot.plist.old
  • Open the Boot.plist with Property List Editor
  • click on Root -> New Child "device-properties" ; Class = String ; Value = Your generated hex-string



  • save the plist in a folder you can access, such as Desktop
  • Now copy the modified Boot.plist into the correct folder: sudo cp ~/Desktop/com.apple.Boot.plist /Library/Preferences/SystemConfiguration/

And we're done ;)

Reboot, Good Luck
Valentine
post May 5 2009, 08:58 PM
Post #2
That's nice, but you might want to change the wikilink also to English.

http://en.wikipedia.org/wiki/Extensible_Firmware_Interface
Board: DFI Lanparty JR P45 T2RS (P45 ICH10/ALC885/Yukon/AHCI SATA) - CPU: Intel Core 2 Duo E7400 2.8GHz (Vanilla Kernel 9.7) - Video: Nvidia 8600GT (EFI String) - OS X: 10.5.7 (Retail 10.5.6 + Delta 10.5.7 - EFI partition - Chameleon 2 RC1) Solutions: ICH10: Native 10.5.7 Orange icon fix via IOAHCIBlockStorageInjector.kext - ALC885 sound: Native via DSDT - Mic not working- EFI String: Video & TM fix - SMBios: Chameleon plist - No sleep. All else working out of the box.
Hagar
post May 6 2009, 11:56 AM
Post #3
Done, there's also the matter of that one sentence in the middle still tongue.gif Thanks for the heads-up, valentine!
This Time We're Doing it RIGHT


aprodigy
post May 6 2009, 12:24 PM
Post #4
QUOTE (Hagar @ May 6 2009, 01:56 PM) *
Done, there's also the matter of that one sentence in the middle still :P Thanks for the heads-up, valentine!


fixed ;)
Slice
post May 9 2009, 04:50 PM
Post #5
Sorry. Explain me, please, why I need so complex procedure if I have working injector?
Пожалуйста, прочитайте ЧаВо!
i3-2120 GA-H61M-S1, Radeon HD6670, ALC887(VoodooHDA 2.8.4), OS⌘10.9.2, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
Valentine
post May 9 2009, 06:11 PM
Post #6
Cleaner solution, Fredom from kexts, maintanance.

It's not that hard if you use tools like EFI Studio. Once you have your EFI string for your hardware done,
you never have to care about injector kexts anymore.
All handy in your boot.plist!


Also a lot more women are attracted to you smile.gif

This post has been edited by Valentine: May 9 2009, 06:15 PM
Board: DFI Lanparty JR P45 T2RS (P45 ICH10/ALC885/Yukon/AHCI SATA) - CPU: Intel Core 2 Duo E7400 2.8GHz (Vanilla Kernel 9.7) - Video: Nvidia 8600GT (EFI String) - OS X: 10.5.7 (Retail 10.5.6 + Delta 10.5.7 - EFI partition - Chameleon 2 RC1) Solutions: ICH10: Native 10.5.7 Orange icon fix via IOAHCIBlockStorageInjector.kext - ALC885 sound: Native via DSDT - Mic not working- EFI String: Video & TM fix - SMBios: Chameleon plist - No sleep. All else working out of the box.
Kabyl
post May 20 2009, 07:01 AM
Post #7
QUOTE (Slice @ May 9 2009, 05:50 PM) *
Sorry. Explain me, please, why I need so complex procedure if I have working injector?


Because it's the new fashion, and you have to follow the latest even if it's not the greatest..

Injector kexts are better IMO (NvidiaEFI), but people derived from the right way, and injectors remained just property-list injectors (Natit, NVInject.. etc).
Valentine
post May 20 2009, 09:24 AM
Post #8
What then is the advantage of a injector, Kabyl? Isn't it all about just the device tree in the end what matters?
Board: DFI Lanparty JR P45 T2RS (P45 ICH10/ALC885/Yukon/AHCI SATA) - CPU: Intel Core 2 Duo E7400 2.8GHz (Vanilla Kernel 9.7) - Video: Nvidia 8600GT (EFI String) - OS X: 10.5.7 (Retail 10.5.6 + Delta 10.5.7 - EFI partition - Chameleon 2 RC1) Solutions: ICH10: Native 10.5.7 Orange icon fix via IOAHCIBlockStorageInjector.kext - ALC885 sound: Native via DSDT - Mic not working- EFI String: Video & TM fix - SMBios: Chameleon plist - No sleep. All else working out of the box.
Kabyl
post May 20 2009, 04:11 PM
Post #9
QUOTE (Valentine @ May 20 2009, 10:24 AM) *
What then is the advantage of a injector, Kabyl? Isn't it all about just the device tree in the end what matters?


What matters at the end "for the average user" is a working OS.
Valentine
post May 20 2009, 05:48 PM
Post #10
QUOTE (Kabyl @ May 20 2009, 06:11 PM) *
What matters at the end "for the average user" is a working OS.

Ah I see, let me rephrase: A lot more women are attracted to you using injectors and only injectors! tongue.gif








All that know what your doing: use strings or DSDT.
Board: DFI Lanparty JR P45 T2RS (P45 ICH10/ALC885/Yukon/AHCI SATA) - CPU: Intel Core 2 Duo E7400 2.8GHz (Vanilla Kernel 9.7) - Video: Nvidia 8600GT (EFI String) - OS X: 10.5.7 (Retail 10.5.6 + Delta 10.5.7 - EFI partition - Chameleon 2 RC1) Solutions: ICH10: Native 10.5.7 Orange icon fix via IOAHCIBlockStorageInjector.kext - ALC885 sound: Native via DSDT - Mic not working- EFI String: Video & TM fix - SMBios: Chameleon plist - No sleep. All else working out of the box.
audio01
post Aug 1 2009, 09:00 AM
Post #11
Hi,

This is my first post here... I just discovered Project OS X, and I must say that I'm impressed!!! Congratulations about this wonderful forum!!! Seems that you can find here "THE" people around, and no more struggling in the high signal-to-noise ratio of other forums!

I just wondering, about the different approches to inject the right values in the IOReg tree: injector kexts, device property strings and the newer approach modifying the DSDT... I think by now that I also prefer the injectors. At the end the result should be the same. The pros about injector kexts (or "semi-kexts" with just info.plist) is they ease of use. All other propositions are much more convoluted (even using tools like EFI Studio). Now with kext like NVEnabler, the injectors looks even nicer.

About the DSDT I still didn't have too much time to experiment, but it seems that for getting the best result (and maybe even better than with any other technique) you must know the ASL language and decompile/compile the tables by yourself. Surely this is too new to have any conclusion. Maybe in the future that would be easier.

Anyway, my question is about network. We have injector kexts for video, HD audio, etc. Is there any injector for making the first NIC = en0 (fixing the cvalue I guess)?

Thank you!

And keep this excellent work!!!

This post has been edited by audio01: Aug 1 2009, 09:04 AM
realityiswhere
post Aug 1 2009, 04:12 PM
Post #12
QUOTE (audio01 @ Aug 1 2009, 06:00 AM) *
Hi,

This is my first post here... I just discovered Project OS X, and I must say that I'm impressed!!! Congratulations about this wonderful forum!!! Seems that you can find here "THE" people around, and no more struggling in the high signal-to-noise ratio of other forums!

I just wondering, about the different approches to inject the right values in the IOReg tree: injector kexts, device property strings and the newer approach modifying the DSDT... I think by now that I also prefer the injectors. At the end the result should be the same. The pros about injector kexts (or "semi-kexts" with just info.plist) is they ease of use. All other propositions are much more convoluted (even using tools like EFI Studio). Now with kext like NVEnabler, the injectors looks even nicer.

About the DSDT I still didn't have too much time to experiment, but it seems that for getting the best result (and maybe even better than with any other technique) you must know the ASL language and decompile/compile the tables by yourself. Surely this is too new to have any conclusion. Maybe in the future that would be easier.

Anyway, my question is about network. We have injector kexts for video, HD audio, etc. Is there any injector for making the first NIC = en0 (fixing the cvalue I guess)?

Thank you!

And keep this excellent work!!!


You're very much in luck, Krazubu describes exactly how to set the NIC to en0 using DSDT in this thread. Hope that's what you're looking for wink.gif
Debian Squeeze: HPM8120N - Q6600, 965 northbridge/ICH8-R south, 9500GT (1GB)
Snow Leopard 10.6.6: Alu Macbook: Core 2 Duo 2.0GHz, 2GB Ram, nVidia 9400M.
Android: Samsung Galaxy S Vibrant (GT-i9000m, Froyo) and Samsung Galaxy Tab (Froyo)
Having trouble posting? Have you taken the Quiz yet? --------------------------- If you see spam, report it!
audio01
post Aug 1 2009, 05:26 PM
Post #13
Hi again,

QUOTE (realityiswhere @ Aug 1 2009, 05:12 PM) *
You're very much in luck, Krazubu describes exactly how to set the NIC to en0 using DSDT in this thread. Hope that's what you're looking for wink.gif


Yes, I'm aware of correcting the NIC issue by DSDT edit or device property strings. What I'm looking for is for an injector kext. Never saw one for networking. It would be nice to have one, so everything could be fixed with just dealing with kexts.

Thanks!
Slice
post Aug 7 2009, 10:43 AM
Post #14
QUOTE (Kabyl @ May 20 2009, 07:01 AM) *
Injector kexts are better

No doubt.
It is more flexible, more safe, more clean way to inject properties.
About DSDT... Sometimes the patch is only way to correct a problem (interrupt, power state or sleep). You also can use DSDT to inject properties but you need one more stage to correct: compilation by IASL. And I see no advantages.

And more.
NVEnabler can't be replaced by EFI-strings or by DSDT patch.
Пожалуйста, прочитайте ЧаВо!
i3-2120 GA-H61M-S1, Radeon HD6670, ALC887(VoodooHDA 2.8.4), OS⌘10.9.2, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
AlexanderPD
post Feb 20 2011, 01:23 AM
Post #15
hi, i have a vaio F series with the *in*famous problem of the "only external monitor is working".
I extracted these info for internal lcd (display@A) and external (display@cool.gif:

CODE
    | |   |   | +-o NVDA,Display-A@0  <class IONDRVDevice, id 0x10000032f, regi$
    | |   |   | | | {
    | |   |   | | |   "nativeNDRV" = <"advn">
    | |   |   | | |   "IODeviceMemory" = (({"address"=18446744073206235136,"len$
    | |   |   | | |   "AAPL,gray-page" = <01000000>
    | |   |   | | |   "AAPL,ndrv-interrupt-set" = "IONDRVInterruptSet is not se$
    | |   |   | | |   "built-in" = <01>
    | |   |   | | |   "noNVRAM" = <01000000>
    | |   |   | | |   "com-varp" = <00304c4980ffffff>
    | |   |   | | |   "IOFBDependentID" = 18446743524118251008
    | |   |   | | |   "display-cfg" = <ffffffff>
    | |   |   | | |   "driver-ist" = <c0b4450b80ffffff0100000080ffffffc0b4450b8$
    | |   |   | | |   "name" = <"NVDA,Display-A">
    | |   |   | | |   "AAPL,ndrv-dev" = Yes
    | |   |   | | |   "compatible" = <"NVDA,NVMac">
    | |   |   | | |   "display-connect-flags" = <00000000>
    | |   |   | | |   "AAPL,iokit-ndrv" = <50a6ab807fffffff>
    | |   |   | | |   "VRAM,memsize" = <0000000000000040>
    | |   |   | | |   "IOFBDependentIndex" = 0
    | |   |   | | |   "AAPL,gray-value" = <c38c6400>
    | |   |   | | |   "AAPL,RegEntryID" = <0018320b80ffffffffe7cdf47f000000656d$
    | |   |   | | |   "device_type" = <"display">
    | |   |   | | |   "AAPL,boot-display" = <01000000>
    | |   |   | | | }

CODE
    | |   |   | +-o NVDA,Display-B@1  <class IONDRVDevice, id 0x100000330, regi$
    | |   |   | | | {
    | |   |   | | |   "nativeNDRV" = <"advn">
    | |   |   | | |   "IODeviceMemory" = (({"address"=18446744073206235136,"len$
    | |   |   | | |   "AAPL,gray-page" = <01000000>
    | |   |   | | |   "AAPL,ndrv-interrupt-set" = "IONDRVInterruptSet is not se$
    | |   |   | | |   "noNVRAM" = <01000000>
    | |   |   | | |   "com-varp" = <00f04f4980ffffff>
    | |   |   | | |   "IOFBDependentID" = 18446743524118251008
    | |   |   | | |   "display-cfg" = <ffffffff>
    | |   |   | | |   "driver-ist" = <c0054d0b80ffffff0100000080ffffffc0054d0b8$
    | |   |   | | |   "name" = <"NVDA,Display-B">
    | |   |   | | |   "display-connect-flags" = <00000000>
    | |   |   | | |   "compatible" = <"NVDA,NVMac">
    | |   |   | | |   "AAPL,ndrv-dev" = Yes
    | |   |   | | |   "av-signal-type" = <01000000>
    | |   |   | | |   "AAPL,iokit-ndrv" = <50a6ab807fffffff>
    | |   |   | | |   "VRAM,memsize" = <0000004000000040>
    | |   |   | | |   "IOFBDependentIndex" = 1
    | |   |   | | |   "AAPL,gray-value" = <c38c6400>
    | |   |   | | |   "AAPL,RegEntryID" = <0034350b80ffffffffcbcaf47f000000656d$
    | |   |   | | |   "device_type" = <"display">
    | |   |   | | | }


my goal is to made display@A working, so i analized these info and the only differences are:
display@a have:
"com-varp" = <00304c4980ffffff>
"driver-ist" = <c0b4450b80ffffff0100000080ffffffc0b4450b8$ *moar here*
"VRAM,memsize" = <0000000000000040>
"IOFBDependentIndex" = 0
"AAPL,RegEntryID" = <0018320b80ffffffffe7cdf47f000000656d$ *moar*
"built-in" = <01>
"AAPL,boot-display" = <01000000>

display@b have:
"com-varp" = <00f04f4980ffffff>
"driver-ist" = <c0054d0b80ffffff0100000080ffffffc0054d0b8$ *moar here*
"VRAM,memsize" = <0000004000000040>
"IOFBDependentIndex" = 1
"AAPL,RegEntryID" = <0034350b80ffffffffcbcaf47f000000656d$ *moar*
"av-signal-type" = <01000000>

any clue on what can be the real problem? and.. following this guide i can edit and inject my device-properties, but how i can inject info only for display@a?

Thank you

This post has been edited by AlexanderPD: Feb 20 2011, 01:52 AM

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