InfiniteMac OSx86

InfiniteMac OSx86 (http://infinitemac.com/forum.php)
-   10.X (http://infinitemac.com/forumdisplay.php?f=36)
-   -   10.3.0 Legacy Kernel for INTEL/AMD by qoopz/nawcom (http://infinitemac.com/showthread.php?t=5857)

Imkantus 04-03-2010 10:18 AM

10.3.0 Legacy Kernel for INTEL/AMD by qoopz/nawcom
 
10.3.0 Legacy Kernel for INTEL/AMD by qoopz/nawcom

Alright, xnu src was released so that means patching up that source code so everyone else can use the latest and greatest kernel.

Standard fixes are included, plus a few extra stuff:

* Built-in kernel blacklister automatically blacklists bad kexts from loading. Therefore you don't need to use a disabler to disable it manually
* bigger dmesg Which translates to a larger log file so that you can troubleshoot easily
* uuid patching/fix Eliminates the need of UUID kext or specifying manually
* fsb detection
* cpu cache detection
* reboot fix- Eliminates the need of OpenHaltRestart and fixes shutdown/reboot issue
* sse3emu -SSE3 emulator for SSE2 processors . Bear in mind that most of the applications in Snow Leopard run fine with this emulator.

Some things added:


* some support for the new 6 core i7
* For people wanting to use XCode apps, I decided to add all the CHUD kexts to the kext blacklist. This means no more kp hell when installing and dealing with the development tools. If anyone thinks this is something that shouldn't be added, let me know.

Features in this specific package:

* If you have SleepEnabler installed, your SleepEnabler kext will get updated. If you don't use it, don't worry about it - it won't get installed.
* All of the CPUIDs in the new versions of programs from the 10.6.3 update will get patched. this means you don't need to deal with the hell regarding iTunes, etc.

(The actual patcher program also gets installed (/usr/local/bin/patcher, you can run from anyware via Terminal) as well as the CPUID text file (/Library/CPUIDs/*) Though this is only important to people who love control and want to be able to run it themselves :-P - this is all automated in the installer regardless. Unfortunately we still havent gotten on the fly patching working, so this is a reasonable fix for it for now.)

I do make cpuid files for updates and keep them online http://nawcom.com/osx86/cpuids/ for AMD people to use regarding updates as well as a nice frontend to Maxxuss' patcher app, drag and drop a cpuid.txt file onto the app to launch it - just like Taruga's HDA Patcher.

Anyways, good luck to all. Source diffs are always available.
http://redirectingat.com/?id=292X457...topic%3D214528

If anyone wants to contribute I'm always on irc - irc.osx86.hu #snowleopard #hackint0sh; irc.voodooprojects.org #chameleon #xnu-chat; irc.moofspeak.net #osx86.

Download
rapidshare.com

RayFlower 04-03-2010 10:25 AM

Works on my AMD phenom II system, however the FSB detection is off, i suppose this shouldn't be too difficult to fix since the bk kernel had this fixed in 10.6.2.

Also, -force64 works, i got to run galaxies but most apps crashes etc and no 64bit extensions etc.

Apps i tried in forced 64bit mode that crashed:
Chess
iTunes
Quicktime player 7
DVDplayer
EnergyXT
Coda
Garageband
Macirssi
Logic express 32 and 64 bit mode
...

Also it seems like iTunes wont work in 32bit mode either, anyhow thanks for the quick kernel:)

Imkantus 04-03-2010 10:47 AM

Quote:

Originally Posted by RayFlower (Post 46995)
Also, -force64 works, i got to run galaxies but most apps crashes etc and no 64bit extensions etc.

AMD CPUs lack the necessary instructions set, so this sadly ain't that easy to fix - propably won't ever be...
Quote:

Originally Posted by RayFlower (Post 46995)
Also it seems like iTunes wont work in 32bit mode either, anyhow thanks for the quick kernel:)

You have patched CPUIDs?
You might try this, where I descryped how-to create cpuid file yourself and patch using Marvin's Utility:
http://www.infinitemac.com/f36/10-6-...post46818.html

/btw: Kernel is very nice - integrated Disabler, Restart & Shutdown Fix are working great here - big thanks Mr nawcom. :)

fxwizrd 04-03-2010 03:52 PM

Thank you for the new kernel. Everything seems to work fine.
Only I noticed that CPU frequency shows incorrectly in dmesg:

TSC: Frequency = 0.0000MHz, FSB frequency = 201.30763MHz, bus ratio = 10

Also I still get the following messages in the logfile:
CODE SIGNING: cs_invalid_page(0x1000): p=42[ptmd] clearing CS_VALID
CODE SIGNING: cs_invalid_page(0x1000): p=45[loginwindow] clearing CS_VALID
CODE SIGNING: cs_invalid_page(0x1000): p=43[mds] clearing CS_VALID
CODE SIGNING: cs_invalid_page(0x1000): p=72[fontd] clearing CS_VALID
CODE SIGNING: cs_invalid_page(0x1000): p=103[Dock] clearing CS_VALID
CODE SIGNING: cs_invalid_page(0x1000): p=105[Finder] clearing CS_VALID
CODE SIGNING: cs_invalid_page(0x1000): p=104[SystemUIServer] clearing CS_VALID
CODE SIGNING: cs_invalid_page(0x1000): p=108[fontd] clearing CS_VALID

Is it something bad and if yes what can be done about it?

Thanks,
FX

Edit: It also seems the reboot fix does not work well. I had to restore old OpenHaltRestart.kext in order to get machine restart automatically.

pαuℓzurrr. 04-04-2010 10:50 PM

Thanks for the kernel!
Only thing that doesn't work for me is the restart fix. It hangs on a black screen and i have to manually press the power button...

kocoman 04-05-2010 05:16 AM

does this kernel fix the 100% and safari crashing problem?

Quote:

sse3emu -SSE3 emulator for SSE2 processors . Bear in mind that most of the applications in Snow Leopard run fine with this emulator. However there are some reports of Safari and certain applications that may crash or behave weirdly. It will not be enabled if you have SSE3

blackknight 04-08-2010 04:44 AM

Quote:

Originally Posted by RayFlower (Post 46995)
Works on my AMD phenom II system, however the FSB detection is off, i suppose this shouldn't be too difficult to fix since the bk kernel had this fixed in 10.6.2.

Also, -force64 works, i got to run galaxies but most apps crashes etc and no 64bit extensions etc.

Apps i tried in forced 64bit mode that crashed:
Chess
iTunes
Quicktime player 7
DVDplayer
EnergyXT
Coda
Garageband
Macirssi
Logic express 32 and 64 bit mode
...

Also it seems like iTunes wont work in 32bit mode either, anyhow thanks for the quick kernel:)

Hey rayflower, I modified this kernel to include the Phenom FSB detection, but I'm still waiting to see if Andy has some more fixes to add before I put it online. Also, I don't know what changed, but I have the same problem that fxwizrd has where the CPU speed is not detected, even though the FSB is correct. Andy might have something to help here. Also, @fxwizrd, the code signing stuff is just the built-in decrypter at work and you shouldn't worry about them. As for OpenHaltRestart.kext, I still use the one that was posted a while back on my EFI partition and it works great.

gipo 04-08-2010 02:54 PM

This kernel give me the mouse's lag problem...
The mouse run slower and with steps... not fluid. Can be the FSB detection?
So i returned to 10.2 BlackKnight's one, working flawlessly for me.
Quote:

but I'm still waiting to see if Andy has some more fixes to add before I put it online
Waiting for your 10.3 release...

andyvand 04-17-2010 01:19 PM

Quote:

Originally Posted by fxwizrd (Post 46999)
Thank you for the new kernel. Everything seems to work fine.
Only I noticed that CPU frequency shows incorrectly in dmesg:

TSC: Frequency = 0.0000MHz, FSB frequency = 201.30763MHz, bus ratio = 10

Also I still get the following messages in the logfile:
CODE SIGNING: cs_invalid_page(0x1000): p=42[ptmd] clearing CS_VALID
CODE SIGNING: cs_invalid_page(0x1000): p=45[loginwindow] clearing CS_VALID
CODE SIGNING: cs_invalid_page(0x1000): p=43[mds] clearing CS_VALID
CODE SIGNING: cs_invalid_page(0x1000): p=72[fontd] clearing CS_VALID
CODE SIGNING: cs_invalid_page(0x1000): p=103[Dock] clearing CS_VALID
CODE SIGNING: cs_invalid_page(0x1000): p=105[Finder] clearing CS_VALID
CODE SIGNING: cs_invalid_page(0x1000): p=104[SystemUIServer] clearing CS_VALID
CODE SIGNING: cs_invalid_page(0x1000): p=108[fontd] clearing CS_VALID

Is it something bad and if yes what can be done about it?

Thanks,
FX

Edit: It also seems the reboot fix does not work well. I had to restore old OpenHaltRestart.kext in order to get machine restart automatically.

That is because the patched binaries still have code signatures inside.
I once released on InsanelyMac a tutorial on how to remove them from the binaries (No more clearing CS_VALID messages...)
I suppose those messages aren't the worst but if I had an AMD system I would patch up....

As for the rebooting problem: why not fix it with a customized FADT.aml ACPI table override?

fxwizrd 04-17-2010 07:11 PM

Andy,
Thank you for the explanation. I will look for the tutorial.

As for the FADT.aml, I was not aware of it. Thank you for suggestion! I will look into it.
I now only use DSDT.aml with RTC fixes. Nevertheless I still get KPs with backtrace to AppleRTC.kext. Do you have an idea what might be wrong in my setup?

Thank you,
FX

Quote:

Originally Posted by andyvand (Post 47423)
That is because the patched binaries still have code signatures inside.
I once released on InsanelyMac a tutorial on how to remove them from the binaries (No more clearing CS_VALID messages...)
I suppose those messages aren't the worst but if I had an AMD system I would patch up....

As for the rebooting problem: why not fix it with a customized FADT.aml ACPI table override?


blackknight 04-18-2010 06:30 AM

Ok, I've updated my kernel to 10.3.0 using Andy's Release 2 diff and my mod, but rather than hijack this thread, look for it in my thread here:http://osx86.net/f36/blackknight-anv...-phenom-t5112/. One other thing that Andy's patch does is fix the CPU speed detection (@fxwizard).

kocoman 05-12-2011 05:05 AM

Quote:

Originally Posted by andyvand (Post 47423)
That is because the patched binaries still have code signatures inside.
I once released on InsanelyMac a tutorial on how to remove them from the binaries (No more clearing CS_VALID messages...)
I suppose those messages aren't the worst but if I had an AMD system I would patch up....

As for the rebooting problem: why not fix it with a customized FADT.aml ACPI table override?

I am patching launchctl (terminal app), but afterward it complain of code signing

Andy Vandijck did post some post about "removing code signatures", and did an amd_insn_patcher (with source code), but I don't understand whats the code is doing, I could run it through debugger, but if anyone knows this faster than me and would like to answer.

I searched insanelymac for Andy Vandijck's post about this, but can't find it, maybe its deleted for DCMA?

Code:

kern_return_t remove_code_signature_64(uint8_t *data)
{
        struct mach_header_64 *mh_64 = (struct mach_header_64 *)data;
        struct load_command *tmplc = (struct load_command *)(data + sizeof(struct mach_header_64));
        uint32_t curlc = 0;
        uint32_t totlc = mh_64->ncmds;
        uint32_t curoff = sizeof(struct mach_header_64);
        struct linkedit_data_command *cryptsiglc = (struct linkedit_data_command *)0;
        uint8_t *cryptsigdata = (uint8_t *)0;
        uint32_t cryptsigdatasize = 0;
        uint32_t zeroeddata = 0;
       
      /* Get code signature load command + divide */
        while (curlc < totlc)
        {
                if (tmplc->cmd == LC_CODE_SIGNATURE)
                {
                        cryptsiglc = (struct linkedit_data_command *)(data + curoff);
                        break;
                }

                curoff += tmplc->cmdsize;
                tmplc = (struct load_command *)(data + curoff);
                ++curlc;
        }

        /* Safety check */
        if (cryptsiglc == 0)
        {
                printf("No code signature found, skipping patch\n");
                return KERN_FAILURE;
        }
       
        cryptsigdata = (uint8_t *)(data + cryptsiglc->dataoff);
       
        /* Zero code signature... */
        while (zeroeddata < cryptsiglc->datasize)
        {
                *cryptsigdata = 0;
                ++zeroeddata;
                ++cryptsigdata;
        }
       
        /* Reduce the number of load commands + load command size */
        mh_64->ncmds -= 1;
        mh_64->sizeofcmds -= cryptsiglc->cmdsize;
       
        /* Zero out load command of LC_CODE_SIGNATURE */
        cryptsiglc->cmd = 0;
        cryptsiglc->cmdsize = 0;
        cryptsiglc->dataoff = 0;
        cryptsiglc->datasize = 0;
       
        printf("Code signature removed succesfully (64bit)");
        return KERN_SUCCESS;
}