netkas.org forum
November 22, 2017, 08:34:23 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Information for registering users http://forum.netkas.org/index.php/topic,2246.0.html
 
   Home   Help Search Login Register  
Pages: [1] 2 3 ... 8
  Print  
Author Topic: How To: EFI GFX+Audio Introduction & Tutorial  (Read 248030 times)
MoDs
Newbie

Offline Offline

Posts: 42


« on: January 14, 2008, 09:12:41 PM »

Introduction (for noobs)

This tutorial is divided into three parts: Introduction, GFX, and SFX...

What's that?
I'm quite sure that EFI Emulation (PC EFI) has changed the whole OSx86 scene. It took the whole scene into a whole new level, now, we can have a PC running Mac OS X with stock kernel and kexts. And yet, the diverse combinations of components and configurations that happen to be the case in the PC world has lead to the creation of numerous fixes and howtos for graphics, audio, usb, ethernet, and many others.

How do these fixes work?
Almost all of them are kernel extensions (.kext) that are put in /System/Library/Extensions/.

Mac OS is using something called "Device Tree". This is a map used to guide the kernel load the right driver for each device. These kexts "plug" necessary data into the Device Tree during boot.

NVinject, Titan, and Nitat merely detect your graphics card model and plugs the right data into that map.
ALCinject does the same thing for audio.

This class of kexts are commonly called injectors.

PS: Injectors merely add "guiding data" into the device tree; Mac OS still has to have the appropriate kernel extensions (drivers) for every device. That means for any device X, even with the right data in the device tree, if no drivers are present, the device won't work.

PC EFI "Pluggable Strings"
Currently, PC EFI v8.0 supports what is called "pluggable strings". This can be used to add or plug data (properties) into the device tree during boot using an arbitrary "string" provided by the user.

The "string" is a very long number inserted into the file "/Library/Preferences/SystemConfiguration/com.apple.Boot.plist"

Example string:
Code:
a20300000100000001000000960300001400000002010c00d041030a010000000101060000010101060000007fff040014000000400032002c006e0061006d00650000001100000073656e736f722d706172656e7436000000400032002c00680077006300740072006c002d0070006100720061006d0073002d00760065007200730069006f006e00000008000000000000021c0000006400650076006900630065005f0074007900700065000000100000004e5644412c4765466f7263650e0000006e0061006d00650000000f0000004e5644412c506172656e7422000000400030002c006400650076006900630065005f00740079007000650000000b000000646973706c6179100000006d006f00640065006c0000001a0000004e5649444941204765466f726365203736303020475322000000400031002c006400650076006900630065005f00740079007000650000000b000000646973706c617912000000400032002c007200650067000000080000000000000222000000400032002c006400650076006900630065005f0074007900700065000000120000004e5644412c6770752d64696f646520000000400032002c0063006f006d00700061007400690062006c0065000000160000004e5644412c73656e736f722d706172656e7422000000400032002c002300730069007a0065002d00630065006c006c0073000000080000000000000020000000400031002c0063006f006d00700061007400690062006c00650000000e0000004e5644412c4e564d616314000000400030002c006e0061006d0065000000120000004e5644412c446973706c61792d413a000000400032002c0068007700730065006e0073006f0072002d0070006100720061006d0073002d00760065007200730069006f006e000000080000000000000226000000400032002c0023006100640072006500730073002d00630065006c006c0073000000080000000000000114000000400031002c006e0061006d0065000000120000004e5644412c446973706c61792d4220000000400030002c0063006f006d00700061007400690062006c00650000000e0000004e5644412c4e564d61631e00000072006f006d002d007200650076006900730069006f006e0000000800000033303232100000004e00560043004100500000001800000004000000000003000c00000000000007000000000e0000004e00560050004d0000002000000001000000000000000000000000000000000000000000000000000000

Initially, that file looks something like this:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Kernel</key>
<string>mach_kernel</string>
<key>Kernel Flags</key>
<string></string>
</dict>
</plist>

You add the "string" by adding a new key called "device-properties" as shown in the following example:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Kernel</key>
<string>mach_kernel</string>
<key>Kernel Flags</key>
<string></string>
<key>device-properties</key>
<string>c50400000100000002000000230100000700000002010c00d0...</string>
</dict>
</plist>

NOTE: You can't edit the file (com.apple.Boot.plist) while its in the path "/Library/Preferences/SystemConfiguration/". You will have to copy it to your desktop, modify it, then move it back replacing the old one.

But why use "pluggable strings" anyway? (more critique needed)
Current graphics injectors don't support all cards. For instance, nVidia's 8'th generation cards aren't supported by all injectors. This is so because initially, mac os didn't have drivers for these cards. But now, the 10.5.2 update has the drivers for these cards. Still, not all injectors support them.

Now, there are two options:
1- Wait for new versions of these injectors (bad idea).
2- Do what these injectors do ourselves using "pluggable strings"

The second approach has some advantages:
1- No need to wait.
2- Get rid of additional 3rd part kexts.
3- Get a more real-mac-like PC!

Ok, graphics done, what about audio?
As i said, ALCinject is used to modify the device tree for supporting ALCxxx audio cards (AZALIA). Using the same concept as above, we simply get rid of that kext and add the appropriate data to the device tree ourselves.

I read somewhere that the Ethernet is just another candidate
Why not? Maybe!

NOTE: The "String" we are talking about is also called HEX string, and may be downloaded as a hex file (*.hex)

SEE NEXT...
« Last Edit: January 15, 2008, 11:26:37 AM by MoDs » Logged
MoDs
Newbie

Offline Offline

Posts: 42


« Reply #1 on: January 14, 2008, 09:15:47 PM »

Down to business

First get the latest version of gfxutil from http://forum.netkas.org/index.php/topic,64.0.html

EFI Graphics
1. Go get the appropriate hex files for your graphics card:
- for nVidia users: http://forum.netkas.org/index.php/topic,55.0.html
- for ATI users: http://forum.netkas.org/index.php/topic,61.0.html
- for Intel GMA users: http://forum.netkas.org/index.php/topic,58.0.html

If you've got a HEX file, be sure to remove all lines using TextEdit. A hex string should be in one line. Then use gfxutil to convert it to plist:
Code:
./gfxutil -s -n -v -i hex -o xml in.hex out.plist

* in.hex - input hex file you downloaded.
* out.plist - is the output file you want.

NOTE: If you're using a nVidia 8xxx card AND don't have your leopard upgraded to 10.5.2, be sure to have the 10.5.2 kexts and opengl... Just search for it.

This is an example plist for 7600GS:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PciRoot(0x1)/Pci(0x1,0x0)/Pci(0x0,0x0)</key>
<dict>
<key>@0,compatible</key>
<string>NVDA,NVMac</string>
<key>@0,device_type</key>
<string>display</string>
<key>@0,name</key>
<string>NVDA,Display-A</string>
<key>@1,compatible</key>
<string>NVDA,NVMac</string>
<key>@1,device_type</key>
<string>display</string>
<key>@1,name</key>
<string>NVDA,Display-B</string>
<key>@2,#adress-cells</key>
<string>0x01000000</string>
<key>@2,#size-cells</key>
<string>0x00000000</string>
<key>@2,compatible</key>
<string>NVDA,sensor-parent</string>
<key>@2,device_type</key>
<string>NVDA,gpu-diode</string>
<key>@2,hwctrl-params-version</key>
<string>0x02000000</string>
<key>@2,hwsensor-params-version</key>
<string>0x02000000</string>
<key>@2,name</key>
<string>sensor-parent</string>
<key>@2,reg</key>
<string>0x02000000</string>
<key>NVCAP</key>
<data>
BAAAAAAAAwAMAAAAAAAABwAAAAA=
</data>
<key>NVPM</key>
<data>
AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==
</data>
<key>device_type</key>
<string>NVDA,GeForce</string>
<key>model</key>
<string>NVIDIA GeForce 7600 GS</string>
<key>name</key>
<string>NVDA,Parent</string>
<key>rom-revision</key>
<string>0x32323033</string>
</dict>
</dict>
</plist>

2. Now, you need to know your device path for your graphics card. The easiest way of these is to use gfxutil:
Code:
./gfxutil -f display

The output will be something similar to:
Code:
DevicePath = PciRoot(0x0)/Pci(0x1,0x0)Pci(0x0,0x0)
Here my device path is PciRoot(0x0)/Pci(0x1,0x0)Pci(0x0,0x0)

3. Put your device path in place of the old one in the plist file you got earlier.

4. Optional: If you are currently using NVinject or ATIinject:
    a. Open Console in Applications > Utilities
    b. Click "Show Log List" and highlight system.log
    c. In the Search field, write NVinject or ATIinject.
    d. Look at the current plist you got and see if values in the different keys are identical to what you see in the log. If not, modify the plist accordingly.

5. Convert plist to hex again
Code:
./gfxutil -i xml -o hex in.plist out.hex

6. Add the output hex string into com.apple.Boot.plist as shown in the Introduction part.

7. Remove any injectors you may have for you graphics card: NVinject.kext, ATIinject.kext, Titan.kext, Nitat.kext, ... etc.

8. Delete then rebuild kext cache:
Code:
sudo rm -rf /System/Library/Extensions.mkext
sudo kextcache -k /System/Library/Extensions

9. Reboot and cross your fingers!
« Last Edit: January 15, 2008, 12:38:08 AM by MoDs » Logged
MoDs
Newbie

Offline Offline

Posts: 42


« Reply #2 on: January 14, 2008, 09:16:51 PM »

EFI Audio

Known to be supported: ALCxxx and Sigmatel (thanks to macgirl). Not sure about the others. However, this guide is mainly for ALCxxx users!

Thanks to tom3q, now we can add support for ALCxxx audio cards (and others!) without using ALCinject.kext. However, you still have to use modified AppleHDA.kext.

In brief, you will have to have a working sound before switching to the EFI method. For best results, use Taruga's AppleHDA patcher to get AppleHDA.kext modified the right way. Refer to the main topic dedicated to that patcher: http://forum.insanelymac.com/index.php?showtopic=32859

NOTE: Refer to the "Graphics" section if you got stuck at some point as i won't repeat details i said there here again (laziness rule!!) -- sorry Grin

I already have a GFX string
No problem, additional keys and data necessary for your SFX will be added to your current working gfx plist file.

Open GFX plist file and add the following italic lines in the right place after the gfx part.
--------------------------------------------------------
...
...
      <key>rom-revision</key>
      <string>0x32323033</string>
   </dict>

<key>PciRoot(0x1)/Pci(0x1b,0x0)</key>
   <dict>
      <key>PinConfigurations</key>
      <string></string>
      <key>built-in</key>
      <string>0x00</string>
      <key>layout-id</key>
      <string>0x0000000c</string>
      <key>revision-id</key>
      <string>0x00000001</string>
      <key>subsystem-id</key>
      <string>0x0000a002</string>
      <key>subsystem-vendor-id</key>
      <string>0x00001458</string>
      <key>vendor-id</key>
      <string>0x00008086</string>
   </dict>


</dict>
</plist>
--------------------------------------------------------

I don't have a GFX hex yet
Open TextEdit and write the following (without the --- lines)
--------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PciRoot(0x1)/Pci(0x1b,0x0)</key>
   <dict>
      <key>PinConfigurations</key>
      <string></string>
      <key>built-in</key>
      <string>0x00</string>
      <key>layout-id</key>
      <string>0x0000000c</string>
      <key>revision-id</key>
      <string>0x00000001</string>
      <key>subsystem-id</key>
      <string>0x0000a002</string>
      <key>subsystem-vendor-id</key>
      <string>0x00001458</string>
      <key>vendor-id</key>
      <string>0x00008086</string>
   </dict>
</dict>
</plist>
--------------------------------------------------------

VERY IMPORTANT: Make sure you use "Plain Text" in TextEdit. Format -> Make Plain Text

Continue for both cases

Now the entries in bold are the ones that you will have to change.

1. For the device path PciRoot(0x1)/Pci(0x1b,0x0), get your own using gfxutil: -- see NOTE**
Code:
./gfxutil -f AZAL

2. Now open IORegistryExplorer from /Developer/Applications/Utilities/
  - If you don't have it, download url can be found in Links section.

3. Choose "IODeviceTree" and browse to node "AZAL" as shown in the following picture: -- see NOTE**



4. Correct bold values in plist from properties you get in IORegistryExplorer (in the right hand side)

NOTE: Data values such as <d8 27 00 00> is converted to 0x000027d8. That is, add 0x, then read the data value from right to left.

5. After modifying the plist, save it, create hex file.

6. Put the result hex string into com.apple.Boot.plist. If you already have one there, just replace it.

7. Delete injectors: AppleAzaliaAudio.kext, ALCinject.kext, ...

8. Delete and rebuild caches, then reboot.


** NOTE: If you don't have AZAL, then maybe you can get your sound card device id from windows or using "lspci" command (it's a linux command, but there's a ported mac os version. see download url in Links section). After you get dev id for sound card, find it in IORegistryExplorer and know its name then use the following command to get device path:
Code:
./gfxutil -f <name>
* Make sure to change <name>.
** If <name> contains "@xxxx" then remove everything after "@" and remove the "@" too! EX: "AZAL@1b" --> "AZAL"

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Links

* IORegistryExplorer: http://www.mediafire.com/?4b2ap1lagzh or http://www.megaupload.com/?d=976F0NH5 or http://rapidshare.com/files/83950719/ioreg.zip.html

* lspci for mac os (courtesy of frantisheq): http://www.mediafire.com/?dqnwm2nxr03

* Property List Editor: http://www.mediafire.com/?39xeet39mwg

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Well, i guess that's it for now... Comments and corrections are always welcomed.
I hope it helped you all Smiley

Last Updated: 01/15/2008 1:39 PM GMT

MoDs
« Last Edit: January 15, 2008, 02:42:45 PM by MoDs » Logged
macgirl
Newbie

Offline Offline

Posts: 22



« Reply #3 on: January 14, 2008, 11:13:11 PM »

EFI Audio

Currently, only ALCxxx audio chips are supported. Not sure about the others.
Not true, my Soundcard is not ALCxxx but Sigmatel and I succesfuly created gfx string with my sound "properties", I removed ALCinject and it works.
Logged
FavleX
Newbie

Offline Offline

Posts: 42


Be Educated


« Reply #4 on: January 14, 2008, 11:18:21 PM »


Thank You very much MoDs

Your guide is very complete and well done.Very easy for reading even.

Thumbs Up.

p.s. I got GFX string working on my laptop, now it's time to get a shot with the faboulous SFX one!
Logged
MoDs
Newbie

Offline Offline

Posts: 42


« Reply #5 on: January 14, 2008, 11:19:08 PM »

EFI Audio

Currently, only ALCxxx audio chips are supported. Not sure about the others.
Not true, my Soundcard is not ALCxxx but Sigmatel and I succesfuly created gfx string with my sound "properties", I removed ALCinject and it works.

Corrected. Thanks.
Logged
frantisheq
Jr. Member
**
Offline Offline

Posts: 59



« Reply #6 on: January 14, 2008, 11:20:32 PM »

EFI Audio

Currently, only ALCxxx audio chips are supported. Not sure about the others.
Not true, my Soundcard is not ALCxxx but Sigmatel and I succesfuly created gfx string with my sound "properties", I removed ALCinject and it works.

i can confirm that my Sigmatel 9227 is working
Logged
MoDs
Newbie

Offline Offline

Posts: 42


« Reply #7 on: January 14, 2008, 11:43:57 PM »

Guide is updated. Improvements mainly done for the EFI Audio section.
« Last Edit: January 14, 2008, 11:49:01 PM by MoDs » Logged
bs0d
Newbie

Offline Offline

Posts: 6


« Reply #8 on: January 15, 2008, 12:11:51 AM »

Top Guide.

We are blessed on this forum with great people .. many thanks to you all.
Logged
wig72
Newbie

Offline Offline

Posts: 2


« Reply #9 on: January 15, 2008, 01:33:29 AM »

ioreg Link is broken ?!? Pls. reupload. Thanks & rgds., Wig
Logged
B666
Newbie

Offline Offline

Posts: 16


closer to g0d


« Reply #10 on: January 15, 2008, 02:46:33 AM »

ALC883 = PERFECT!!!!!!
MoDs, THANX A LOT for your atitude, this tutorial is perfect!!!!!!!
This Forum is perfect, thanx for everyone here!!!!!
Logged
BladeRunner
Newbie

Offline Offline

Posts: 31


« Reply #11 on: January 15, 2008, 03:03:34 AM »

Has anyone attempted to get USB audio to work using gfx strings?

I have a small set of speakers that connect via a usb port. They are amplified and draw power from the usb bus. They show in the system profiler, but I can't locate them in the ioreg device tree. The reason for asking is that I need to keep an old apple usb audio kext to make them work.

Code:
USB Bus:

  Host Controller Location: Expansion Slot
  Host Controller Driver: AppleUSBOHCI
  PCI Device ID: 0x0035
  PCI Revision ID: 0x0043
  PCI Vendor ID: 0x1033
  Bus Number: 0x01

USB Audio:

  Version: 0.10
  Bus Power (mA): 500
  Speed: Up to 12 Mb/sec
  Manufacturer: C-Media INC.
  Product ID: 0x0001
  Vendor ID: 0x0d8c

Does anyone think it is possible to correct this using the gfx strings?

bladeRunner
Logged

Hacintosh:
CPU: Intel Pentium 4 3.00GHz [SSE3/PAE/HTT]
Codename: Prescott Package: Socket 478 mPGA
RAM: 2.0GB Disk: 307.36GB/1.13TB
Display: GeForce FX 5500 [256 MB/QE/Stock] 1600x1200@60Hz
OS: Mac OS X 10.5.3 (9D34) Kernel: Darwin 9.2.0
Build: i386 Build Date: Tue Feb 26 21:21:24 SCT 2008
mcmatrix
Newbie

Offline Offline

Posts: 46



« Reply #12 on: January 15, 2008, 09:51:10 AM »

Has anyone attempted to get USB audio to work using gfx strings?

I have a small set of speakers that connect via a usb port. They are amplified and draw power from the usb bus. They show in the system profiler, but I can't locate them in the ioreg device tree. The reason for asking is that I need to keep an old apple usb audio kext to make them work.

Code:
USB Bus:

  Host Controller Location: Expansion Slot
  Host Controller Driver: AppleUSBOHCI
  PCI Device ID: 0x0035
  PCI Revision ID: 0x0043
  PCI Vendor ID: 0x1033
  Bus Number: 0x01

USB Audio:

  Version: 0.10
  Bus Power (mA): 500
  Speed: Up to 12 Mb/sec
  Manufacturer: C-Media INC.
  Product ID: 0x0001
  Vendor ID: 0x0d8c

Does anyone think it is possible to correct this using the gfx strings?

bladeRunner

I think configuring usb connected devices is a little bit tricky at moment.
You can add settings to USB controller which is pci device.
But right now gfxutil doesnt support devices connected to USB.
Maybe sometime i will add full efi device path support to util.

 
« Last Edit: January 15, 2008, 09:53:32 AM by mcmatrix » Logged
gotoh
Jr. Member
**
Offline Offline

Posts: 54


WWW
« Reply #13 on: January 15, 2008, 11:11:05 AM »

But why use "pluggable strings" anyway?
Current graphics injectors don't support all cards. For instance, nVidia's 8'th generation cards aren't supported. This is so because initially, mac os didn't have drivers for these cards. But now, the 10.5.2 update has the drivers for these cards. Still, injectors don't support them.
that's not true... GeForce 8 are supported by natit or nvinject...
GFX string is useful and a quite proper way to have your card working when you don't need to swap hardware often. Injecter method is a bit more flexible. But still there are things which has to be modded to get full support like correct display detection etc...
Logged
MoDs
Newbie

Offline Offline

Posts: 42


« Reply #14 on: January 15, 2008, 11:21:34 AM »

Minor corrections to the Introduction part and mirrors of IORegistryExplorer has been added. Look at the tutorial.

MoDs
« Last Edit: January 15, 2008, 11:41:23 AM by MoDs » Logged
Pages: [1] 2 3 ... 8
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!