netkas.org forum
August 29, 2014, 01:09:29 PM *
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: GFXUtil News & Announcements (v0.71b + src)  (Read 275130 times)
mcmatrix
Newbie

Offline Offline

Posts: 46



« on: December 20, 2007, 09:15:04 AM »

12.01.2007 - New version of gfxutil is out. Please test and give feedback!
06.08.2009 - gfxutil sourcecode is now available!
http://rapidshare.com/files/264264563/gfxutil_source.zip.html
You are free to use it and whatever you do please keep the result free for community

http://rapidshare.com/files/83220759/gfxutil.zip.html
Version 0.71b (LATEST)
---------------------
Changelog 0.71b
* _UID value bug is fixed.
* New efi short notation PCI node "PciAdr".
* New switch [-f name] it finds object devicepath with give name from IODeviceTree plane.
* New verbose output format

PropertyList XML format description

Sample plist file:
<?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>DevicePath for Device #n</key>
    <dict>
        <key>binary_value</key>
        <data>base64encoded</data>
        <key>string_value</key>
        <string>helloworld</string>
        <key>boolean_value</key>
        <true/> or <false/>
        <key>uint32_value</key>
        <integer>0x8744</integer> or <integer>12345</integer>
        <key>uint32_value</key>
        <string>0x00000000</string>
        <key>uint16_value</key>
        <string>0x0000</string>
        <key>uint8_value</key>
        <string>0x00</string>
    </dict>
</dict>
</plist>

* Device path can be in hexadecimal (without prefix '0x') or efi shorthand notation device path format.
* All keys are saved like unicode text.
* Binary values are base64 encoded between <data></data> tags.
* Boolean single tag values are saved like uint8 values (true - 0x01, false - 0x00)
* <integer></integer> both hexadecimal and decimal numbers are accepted (hex. values must begin with prefix 0x). Values are saved like uint32.
* <string>0x00000000</string> is saved like uint32 value. Range: 0x00000000 - 0xffffffff
* <string>0x0000</string> is saved like uint16 value. Range: 0x0000 - 0xffff
* <string>0x00</string> is saved like uint8 value. Range: 0x00 - 0xff

String hexadecimal values must preserve its constant length by having needed count of leading zeros. Also values must have hex prefix '0x' or are treated like ordinary text.

Device path search function note!
Supported IODeviceTree registry entries are IOPCIDevice and IOACPIPlatformDevice.
name - may be "IOName" or "name" property value or registry entry name.

Usage examples:

* Converting from hex file to property list file
./gfxutil -i hex -o xml ./r2600.hex ./r2400.plist

* Converting from plist file to hex file
./gfxutil -i xml -o hex ./r2600.plist ./r2400.hex

* Converting from hex to plist using string and number detection
./gfxutil -s -n -i hex -o xml ./r2600.hex ./r2400.plist

* Same as previous example but using additional verbose output
./gfxutil -v -s -n -i hex -o xml ./r2600.hex ./r2400.plist

* Converting from hex to property list file (reading input from stdin)
./gfxutil -i hex -o xml /dev/stdin ./r2400.plist <r2400.hex

* Converting from hex to property list xml (reading input from stdin and output to stdout)
./gfxutil -i hex -o xml /dev/stdin /dev/stdout <r2400.hex >r2400.plist

* You want find device path of devices with name "display" and "ethernet".
./gfxutil -f display
output: DevicePath = PciRoot(0x0)/Pci(0x1,0x0)Pci(0x0,0x0)

./gfxutil -f ethernet
output: DevicePath = PciRoot(0x0)/Pci(0x1c,0x1)/Pci(0x0,0x0)
 

Supported efi shorthand notation syntax description:

Syntax is case insensitive!

Both hexadecimal and decimal numbers are accepted as input values.
Hexadecimal numbers must start with prefix '0x'!

uint8 - 1 byte unsigned number (range 0x0 - 0xff)
uint16 - 2 byte unsigned number (range 0x0  - 0xffff)
uint32 - 4 byte unsigned number (range 0x0 - 0xffffffff)


Acpi(PNPxxxx, uint32 uid) - ACPI device (xxxx is PNP type device HID for example 0a03)
ACPI Device Path. This Device Path is used to describe devices whose enumeration is not
described in an industry-standard fashion. These devices must be described using ACPI AML
in the ACPI name space; this Device Path is a linkage to the ACPI name space.


PciRoot(uint32 uid) - alias for Acpi(PNP0a03,uid)

Pci(uint8 device, uint8 function) - PCI device node
The Device Path for PCI defines the path to the PCI configuration space address for a PCI device.
There is one PCI Device Path entry for each device and function number that defines the path from the root PCI bus to the device. The PCI Device Path entry must be preceded by an ACPI Device Path entry that uniquely identifies the PCI root bus.


PciAdr(uint32 adr) - alias for PCI node with using alternative address value.
adr is PCI device "_ADR" property value that your may find from pci device properties in IOACPIPlane.
for example:
...
o-PCX4@1c0003
  |-_ADR = 1835011     (hex 0x1c0003)
...
PCX4@xxxxyyyy - (add leading zeros)
xxxx - pci device
yyyy - pci function

This ioreg entry in shorthand notation is PciAdr(1835011) or PciAdr(0x1c0003) or Pci(0x1c,0x3)
 
example paths:
PciRoot(0x0)/PciAdr(0x1c0003)/Pci(0x0,0x0)

PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)
same with Acpi
Acpi(PNP0a03,0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)

I TAKE NO RESPONSEBILITY FOR ANY LOSS, DAMAGE OR INJURY ARISING FROM THE USE OF THIS PROGRAM! 



Tips for building hex device path.

Important!
from ioreg tree you have to clarify your pciroot UID!!!
for example:   
+-o PCI0@0  <class IOACPIPlatformDevice, registered, matched, active, busy 0>
    | |   "_UID" = "4"
If there isnt any _UID prop then uid is probably 0

for example your devpath in ioreg:
IOACPIPlane:/_SB/PCI0@0/P0P5@1c0001/ethernet@0
if device hasnt IOACPIPlane or other acpi path then you have to manually design it, follow
hierarchical ioreg devtree starting from pciroot (PCI0@0 or from other pciroot depending on your hardware config) and ending with your chosen device.


How to convert it to hexadecimal efi devicepath?
It's easy Smiley Just follow my guide:

1. ROOT PCI BRIDGE node. ACPI Device Path _HID PNP0A03, _UID 0. ACPI name space \_SB\PCI0. Shorthand notation is Acpi(PNP0A03,0)
  • from ioreg: find _SB/PCI0@0 or similar (if there is PCI1@0 or similar then you probably have to change UID part)
  • into efi: 02010c00d041030a00000000 (last 4 bytes are UID for example if you want set UID = 1 then change last 4 bytes 01000000)
    _HID - the EISA ID of an on-board device. This is used to identify the device.
    _UID - the unit number of an on-board device. This is used to distinguish between same kind of device.

2. first PCI DEVICE node. Shorthand notation is Pci(0x1c,0x1)
  • from ioreg: find _SB/PCI0@0/P0P5@1c0001 or similar
    P0P5@1c0001 -> add leading zeros POP5@001c0001
    POP5@xxxxyyyy
    xxxx - pci device
    yyyy - pci function
    efi template: 01010600yyxx
  • into efi: 01010600011c (pci node is like that 01-hardware path type, 01-pci device type, 0600 - length, 01 - pci function (1 byte), 1c - pci device (1byte) )

3. second PCI DEVICE node. Shorthand notation is Pci(0x0,0x0)
  • from ioreg: find _SB/PCI0@0/P0P5@1c0001/ethernet@0 or similar
    ethernet@0 -> add leading zeros ethernet@00000000
    ethernet@xxxxyyyy
    xxxx - pci device
    yyyy - pci function
    efi template: 01010600yyxx
  • into efi: 010106000000 (pci node is like that 01-hardware path type, 01-pci device type, 0600 - length, 00 - pci function (1 byte), 00 - pci device (1byte) )

4. Device path end node.
into efi: 7fff0400

5. put these parts together and voila
from: IOACPIPlane:/_SB/PCI0@0/P0P5@1c0001/ethernet@0
into: 02010c00d041030a0000000001010600011c0101060000007fff0400

efi device path shorthand notation legend:
pciroot acpi node -  Acpi(PNP0A03,uid)
full hex pciroot - 02010c00d041030a00000000
ACPI - 02010c00
PNP - d041
0A03 - 030a
uid - 00000000

pci node - Pci(device,function)
full hex pci - 01010600011c
PCI - 01010600
function - 0x01
device - 0x1c

efi dev path must end with end node
full hex end node - 7fff0400

NB! All hexadecimal binary strings are using little endian format.
"Little Endian" means that the low-order byte of the number is stored in memory at the lowest address, and the high-order byte at the highest address. (The little end comes first.) For example, a 4 byte uint32

    Byte3 Byte2 Byte1 Byte0

will be arranged in memory as follows:
    Base Address+0   Byte0
    Base Address+1   Byte1
    Base Address+2   Byte2
    Base Address+3   Byte3

and 2 byte short or word or uint16
    Byte1 Byte0

will be arranged in memory as follows:

    Base Address+0   Byte0
    Base Address+1   Byte1
« Last Edit: August 06, 2009, 07:48:44 AM by mcmatrix » Logged
[quark]
Newbie

Offline Offline

Posts: 12


« Reply #1 on: December 20, 2007, 10:43:22 AM »

Very nice tool...

The next milestone should be a GUI version... I think it's not very complicated but very comfortable Wink
+ automatic com.apple.Boot.plist patching...
Logged
0xdeadbeef
Newbie

Offline Offline

Posts: 25



« Reply #2 on: December 20, 2007, 11:22:06 AM »


New version of gfxutil is out.


Nice work! Could I request that you arrange it just to read/write from stdin/stdout if no filenames are given? Give us bash scripters a boost!  Wink

Logged

Conquering the world - 8 hex digits at a time.
netkas
Administrator
Hero Member
*****
Offline Offline

Posts: 543



« Reply #3 on: December 20, 2007, 04:33:44 PM »

good works. and, better to keep Number as Data
Logged
BladeRunner
Newbie

Offline Offline

Posts: 31


« Reply #4 on: December 20, 2007, 05:35:56 PM »

@mcmatrix:

I *really* like the new version.  The use of string data types makes it easy to use the plist editor directly. Previously I had to copy the value data and paste it into an open hexedit file to modify it.

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
hiw99
Newbie

Offline Offline

Posts: 1


« Reply #5 on: December 21, 2007, 03:48:21 PM »

thanks for gfxutil..

but i cant use it.

Follow message, what can i do  Cry

dyld:  lazy symbol binding failed: Symbol not found:  _getopt$UNIX2003
Logged
Thrawnhex
Jr. Member
**
Offline Offline

Posts: 74


« Reply #6 on: December 21, 2007, 04:36:26 PM »

You're using Tiger, right? Only works under leo Wink

Thrawnhex
Logged
netkas
Administrator
Hero Member
*****
Offline Offline

Posts: 543



« Reply #7 on: December 29, 2007, 02:07:12 PM »

gfxutil isn't good yet

for me, gfxstring doesn't work at all after editing with gfxutil

Logged
mcmatrix
Newbie

Offline Offline

Posts: 46



« Reply #8 on: December 29, 2007, 03:54:55 PM »

gfxutil isn't good yet

for me, gfxstring doesn't work at all after editing with gfxutil



Please could you give more detail feedback.
« Last Edit: December 29, 2007, 04:03:39 PM by mcmatrix » Logged
netkas
Administrator
Hero Member
*****
Offline Offline

Posts: 543



« Reply #9 on: December 29, 2007, 04:52:00 PM »

if i converts from bin to hst with gfxutils , then string doesn't work for me, if with own tool - works...
but maybe it necause of how i pasted it to boot.plist, not sure here..
Logged
mcmatrix
Newbie

Offline Offline

Posts: 46



« Reply #10 on: December 29, 2007, 06:13:54 PM »

if i converts from bin to hst with gfxutils , then string doesn't work for me, if with own tool - works...
but maybe it necause of how i pasted it to boot.plist, not sure here..

Seems working for me. (using latest 0.51b version)
I have tried with original x3100 and 8600MGT device_prop hex files.
Converted from org. hex to bin and then back hex. MD5 hash of both hex files was same.
Could you try 0.51b version of gfxutil.
If possible please send me those two files. One converted by gfxutil and second converted by your tool.
Logged
BladeRunner
Newbie

Offline Offline

Posts: 31


« Reply #11 on: December 29, 2007, 08:13:38 PM »

I tried the new version 0.51b but it kept putting all my output as <data>..</data>.  Then just on a whim, I tried using one of the strings made for the 7600gs.  Much to my surprise, the xml data was produced as <string>..</string> just as you said.

Now if I can just get a string made for my GFX 5500 that will work like the 7600 strings I will be happy.
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 02, 2008, 08:22:27 AM »

gfxutil isn't good yet

for me, gfxstring doesn't work at all after editing with gfxutil



Maybe the uppercase and lowercase hex strings are relevant.
Last version of gfxutil now outputs lowercase hex dump.
Before that using uppercase hex my hackmac was not responding to inserted hexstring.

But using lowercase hex string. I got black screen Wink It means that OSX reacts! Smiley

Can someone confirm that lowercase hex thing or i am on wrong way.
Logged
netkas
Administrator
Hero Member
*****
Offline Offline

Posts: 543



« Reply #13 on: January 02, 2008, 10:03:54 AM »

lowercase or uppwercase shouldn't matter cause pcefi convert .e.g both f and F to 0xf
but maybe there is bug in pc_efi about it:D
Logged
mtrr
Newbie

Offline Offline

Posts: 27


« Reply #14 on: January 06, 2008, 06:42:33 PM »

thanks, will give it a try
Logged
Pages: [1] 2 3 ... 8
  Print  
 
Jump to:  

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