InfiniteMac OSx86

InfiniteMac OSx86 (http://infinitemac.com/forum.php)
-   10.X (http://infinitemac.com/forumdisplay.php?f=36)
-   -   amd_insn_patcher - Instructions would be nice! (http://infinitemac.com/showthread.php?t=6845)

danfloun 01-03-2011 08:08 PM

amd_insn_patcher - Instructions would be nice!
 
Okay so it may be a simple procedure but I can't find nothing of any use on google about the useage of amd_insn_patcher. This confusion arises because stuff seems to change that rapidly, that unless you've been following all this from day one it's just information overload for the rest of us.

One thread I read said that I only needed to patch the bindings, but that was x64 specific, another thread was half the info I needed and assumed we are all geeks :-/

So please, can someone tell me how to patch this damn 10.6.5 Legacy Kernel please!

The amd_insn_patcher zip contains;

amd_insn_patcher
amd_insn_patcher_ext
insn_patcher.c
insn_patcher.h
.DS_Store
Makefile

I assume the .DS_Store is irrelevant.
So what do i do with the rest? /usr/bin /usr/lib?

Yours frustratedly
Danny

andyvand 01-03-2011 09:00 PM

That instruction patcher was designed by me.
You don't need to patch the kernel with it, you can use it to patch /usr/lib/libSystem.B.dylib and any other binaries (containing cpuid's).
From within terminal (install amd_insn_patcher from folder to /usr/bin first) you can use it like this:
amd_insn_patcher <input_file> <output_file>
mv <ouput_file> <input_file>
-> First command makes a patched version (output file is only created if instructions to patch are found) and the second command replaces the original file with the patched file.
amd_insn_patcher_ext is the same but with some extensions for patching up some SSE3 instructions to their SSE2 variants.
Hope this helps you...
Oh yeah, forgot to mention: after patching libSystem.B.dylib you need to update prebinding by running following command:
sudo update_dyld_shared_cache

danfloun 01-03-2011 11:43 PM

Hi,

That's great thanks.
Just what I required!

But, how do I know which binaries need patching? I guess I don't, so am I supposed to try every single binary or just those such as QuickTime, safari iTunes etc?

And when you say the _patcher_ext is for some extensions, by that do you mean kexts?

You obviously put a lot of time into the project and community and for that I thank you.

Cheers
Danny

fumoboy007 01-04-2011 12:46 AM

Quote:

Originally Posted by danfloun (Post 52041)
But, how do I know which binaries need patching? I guess I don't, so am I supposed to try every single binary or just those such as QuickTime, safari iTunes etc?

Since you are using the new legacy kernel, on the fly CPUID patching is available by the kernel. So, you only need to patch:
Code:

/System/Library/QuickTime/QuickTimeComponents.component/Contents/MacOS/QuickTimeComponents
If you are running in 64-bit mode, also patch:
Code:

/usr/lib/libSystem.B.dylib
/usr/lib/dyld

I'm not sure about the dyld one but whatever; it doesn't hurt to patch it anyways.

fumoboy007 01-04-2011 12:51 AM

Quote:

Originally Posted by danfloun (Post 52041)
And when you say the _patcher_ext is for some extensions, by that do you mean kexts?

No, Andy is saying that amd_insn_patcher_ext contains some extra functionality
Quote:

Originally Posted by andyvand (Post 52038)
for patching up some SSE3 instructions to their SSE2 variants.


fumoboy007 01-04-2011 12:57 AM

Also, since you have an AMD Athlon 64 X2 processor, you will probably need this too: AMD Dual-Core Optimizer for Snow Leopard.

danfloun 01-04-2011 01:12 AM

Quote:

Originally Posted by fumoboy007 (Post 52044)
Also, since you have an AMD Athlon 64 X2 processor, you will probably need this too: AMD Dual-Core Optimizer for Snow Leopard.

Hey,

Thanks for that.
I'm far more clued up now.

Regarding the optimizer, I already installed that earlier today. I saw some cpu time sync issues in the error logs just after looking through these forums and installed it to find it fixed the problem. I should maybe post there to let the dev know it's working for me.

Thanks again for taking the time to help.
It's been a long time since I was digging into stuff this deep, last time it was the early versions of gentoo Linux on a thinkpad t21..... I was well fed up, all those hours of compiling crap to no avail.

Cheers
Danny

AVO-Electronics 01-04-2011 10:03 PM

Quote:

Originally Posted by fumoboy007 (Post 52042)

If you are running in 64-bit mode, also patch:
Code:

/usr/lib/libSystem.B.dylib
/usr/lib/dyld


Do not patch those two if you are presently running in x86 mode, it kills you're mac! :'(


ASUS Crosshair MCP590 SLI | AMD Athlon™ 64 X2 Dual-Core 6400+ 3.2GHz | CORSAIR XMS2 6400C4 4GB | GeForce 7300LE 256MB Poo Edition | WD Velociraptor SATAII 10,000rpm 150GB | WD Raptor SATAI 10,000rpm 74GB | SONY DVD±RW SATAI | Snow Leopard 10.6.x - Testing Legacy Kernel 10.6.5 V2

bcoco85 09-12-2012 01:54 AM

im not really sure what this tool is for. what i can see in forums is that lets you have more than 4gb ram, and lets you fix some 32 bits apps when running in 64 bits (arch=i386 -force64)

there is a c file that contains this in the header
*
* instruction length decoder (written by kaitek, modified by mercurysquad)
* voodoo xnu kernel
*
* based on code from AntiHookExec 1.00, Copyright (c) 2004 Chew Keong TAN
* opcode tables based on documentation from http://www.sandpile.org/
*
* todo: * support for instruction set extensions newer than SSSE3
* * verify that VT instructions are correctly decoded
* AnV - Added better opcode + SSE4.1 + SSE4.2 support
*/
also, i found 2 versions of the same tool. both with the same header but different size

one doubt: if you path those files () with this tool, does it lets you start with arch=x86_64 with a 10.6.8 legacy kernel?

best regards

daksi99 02-09-2013 10:20 AM

syntax error near unexpected taken '<' HELP!