InfiniteMac OSx86

InfiniteMac OSx86 (http://infinitemac.com/forum.php)
-   10.X (http://infinitemac.com/forumdisplay.php?f=36)
-   -   Legacy kernel 10.6.8 with custom dyld and new SSE3 emulator and VIA Nano cpu support (http://infinitemac.com/showthread.php?t=7318)

andyvand 08-10-2011 11:45 AM

Legacy kernel 10.6.8 with custom dyld and new SSE3 emulator and VIA Nano cpu support
 
The full package included, as usual.
I've also added support for VIA (Nano) cpu's (the cpuid of those can be modified by a few rdmsr/wrmsr instructions).
Furthermore I included the new SSE3 emulator as default (thanks for the person who supplied it, I forgot his name, credits go to him).
It also includes the custom dyld.
BTW: Sorry for the late entry but at work my workstation wouldn't allow rapidshare so I had to bring along my netbook (to link it to the corporate WLAN network, then it worked).

Download including sources:
https://rapidshare.com/files/2811076...-AnV-0.4.1.zip

wastez 08-10-2011 12:27 PM

Hello,

Did you fix the problem with the fsb detection for amd if the bootloader detect itīs fsb correct?
Because the old fsb "fix" take the default fsb and multiply it x2.

Thank you.

jackokk 08-10-2011 04:10 PM

Thank you very much. You are my hero!!!

andyvand 08-11-2011 07:41 AM

Quote:

Originally Posted by wastez (Post 54861)
Hello,

Did you fix the problem with the fsb detection for amd if the bootloader detect itīs fsb correct?
Because the old fsb "fix" take the default fsb and multiply it x2.

Thank you.

No, I haven't done that yet.
Haven't updated the FSB algo's (just added there support for Via Nano, which is mostly Intel compatible).
BTW: If you could point me to the patch I may be able to add it.

Unrealized 08-11-2011 09:12 AM

What about Lion? Could your diff work for Lion's kernel?

andyvand 08-11-2011 11:17 AM

Quote:

Originally Posted by Unrealized (Post 54870)
What about Lion? Could your diff work for Lion's kernel?

Not without modifications.
Somebody (some geekXXXX) made a patch for Lion to run on 32bit kernel.
With my diff it wouldn't work for 32bit so I need his patch too before I can make a new diff for Lion.
If somebody could contact him (I believe you can find him on InsanelyMac forum somewhere) and ask him the diff + get it to me I could get to work...
I allready compiled up a test kernel from within Snow Leopard in case of Lion and I can make one from within my environment (untill I can get the final version of Lion + suitable kernel).
I just need his diff...
EDIT: Oh yeah, if anybody could upload me the final version of the Mac OS X 10.7.sdk (from under /Developer/SDKs) I would be very grateful. it will be used for the new custom dyld.

Unrealized 08-11-2011 11:31 AM

Nice, gonna look on InsanelyMac if I can find him and ask for the diff. Lion on AMD/Via Nano would be so awesome. ;)
From what I've understood, Lion requires a "full 64-bit mode" ?

It's like finding a needle in a haystack, but I think it's worth it. Not sure if I can find him though..

andyvand 08-11-2011 02:51 PM

Quote:

Originally Posted by Unrealized (Post 54872)
Nice, gonna look on InsanelyMac if I can find him and ask for the diff. Lion on AMD/Via Nano would be so awesome. ;)
From what I've understood, Lion requires a "full 64-bit mode" ?

It's like finding a needle in a haystack, but I think it's worth it. Not sure if I can find him though..

Yes but that guy, geek (with a number behind it) would have a kernel that works in 32bit mode too.
If we can get our hands on that patch, we can make the legacy kernel also available for 32bit booting.
If we can't, it's gonna require 64bit cpu's (64bit Intel/AMD/Via).

m28ew 08-11-2011 03:12 PM

Quote:

Originally Posted by andyvand (Post 54873)
Yes but that guy, geek (with a number behind it) would have a kernel that works in 32bit mode too.


is that him ?


http://img696.imageshack.us/img696/3284/lionkernel.png


Code:

http://www.insanelymac.com/forum/index.php?showtopic=263074

akimoa 08-11-2011 03:14 PM

the only guy with a lion 32bit kernel is smartie77 all he did is he compiled one from the sources but he didn't involve any patching talked to him about that and exualy the rest without one boots it with arch=i386 so why would it need a patch if it boots already in 32bit mode ? vanilla offcourse only

fumoboy007 08-11-2011 04:39 PM

Quote:

Originally Posted by andyvand (Post 54873)
Yes but that guy, geek (with a number behind it) would have a kernel that works in 32bit mode too.
If we can get our hands on that patch, we can make the legacy kernel also available for 32bit booting.
If we can't, it's gonna require 64bit cpu's (64bit Intel/AMD/Via).

Aren't all of Lion's apps 64-bit only? So what's the point of making the Lion kernel available for 32-bit?

Unrealized 08-11-2011 07:03 PM

Wow, I guess this will be a lot of work for kernel developers. ;)

Quote:

Originally Posted by fumoboy007 (Post 54876)
Aren't all of Lion's apps 64-bit only? So what's the point of making the Lion kernel available for 32-bit?

I think it's like Snow Leopard, when using a 32-bit kernel you can still run 64-bit apps (hybrid mode).

fumoboy007 08-11-2011 07:46 PM

Quote:

Originally Posted by Unrealized (Post 54879)
I think it's like Snow Leopard, when using a 32-bit kernel you can still run 64-bit apps (hybrid mode).

I know about 32-bit kernel + 64-bit userland mode. What I'm wondering is...if Finder is a 64-bit only app, 32-bit processors won't be able to run it. So what's the point of making a 32-bit kernel?

wastez 08-12-2011 07:01 AM

I would say it isnīt sure that the 64 Bit Kernel will run on AMD without problems.
Because on snow there are also problems with the 32 bit apps if 64 bit kernel is running.

andyvand 08-12-2011 11:46 AM

Quote:

Originally Posted by fumoboy007 (Post 54882)
I know about 32-bit kernel + 64-bit userland mode. What I'm wondering is...if Finder is a 64-bit only app, 32-bit processors won't be able to run it. So what's the point of making a 32-bit kernel?

Ok, if all Lion apps are 64bit only I'll construct the current kernel as I will make it.
It'll only work on 64bit computers then too... ;)

andyvand 08-12-2011 11:48 AM

Quote:

Originally Posted by akimoa (Post 54875)
the only guy with a lion 32bit kernel is smartie77 all he did is he compiled one from the sources but he didn't involve any patching talked to him about that and exualy the rest without one boots it with arch=i386 so why would it need a patch if it boots already in 32bit mode ? vanilla offcourse only

Then you have a point.
I've tried it with Atom (32bit only) but it didn't work...
If he only compiled the sources there won't be any additional additions.
Legacy kernel as current work thus... ;)

akimoa 08-12-2011 11:51 AM

he made me a list how he succeeded makin one thats what he included

Quote:

Xcode 4.1 GM ,10.7 GM


bootstrap_cmds-79

dtrace-90

kext_tools-180.2.1

cxxfilt-9

+xnu source offcourse

cause it gave me many errors when trying with 10.6.8 using Xcode 3.26 and the SL build tools then i came along his thread and he pointed that out and it ran thru

These are the small tools i zipped them up since wastez was trying to get them these morning and he wasn't able to
these includes

bootstrap_cmds-79

dtrace-90

kext_tools-180.2.1

http://cl.ly/0A050O2V2D3K0U223o2J

the bigger cxxfilt-9 is still the old version and is still there

just incase u need them

Unrealized 08-12-2011 12:52 PM

Quote:

Originally Posted by andyvand (Post 54887)
Ok, if all Lion apps are 64bit only I'll construct the current kernel as I will make it.
It'll only work on 64bit computers then too... ;)

Well, 32-bit machines are kinda slow to even run Lion, so It's a good point anyway. ;)

fumoboy007 08-12-2011 05:04 PM

Quote:

Originally Posted by andyvand (Post 54887)
Ok, if all Lion apps are 64bit only I'll construct the current kernel as I will make it.
It'll only work on 64bit computers then too... ;)

Well actually, I'm just speculating...I don't know for sure that all of Lion's apps are 64-bit only. I'll check tonight on my new MacBook Air. :)

Imkantus 08-13-2011 03:09 AM

Quote:

Originally Posted by andyvand (Post 54887)
Ok, if all Lion apps are 64bit only I'll construct the current kernel as I will make it.
It'll only work on 64bit computers then too... ;)

As you should know, Finder (and some other stuff) is 64-Bit only since Lion DP2 (and any later release).
I have tried Lion GM using your DP1 Kernel on Atom N230, apart from not having Finder, there were problems caused by launchd not working properly... it was kinda eating up my 1GB RAM :p - so I gave up on that... ;)

So a 64-Bit capable CPU is definitely required for running Lion & a Kernel running 32-Bit legacy mode only would be practical useless.

Anyway a 32-Bit Kernel capable of booting Lion on AMD / VIA / old Intel forced into 64-Bit mode would be a great success at this point - as even if you cannot make a custom dyld at the moment, we could bin-patch the Apple one manually like been done on Snow Leopard earlier... :)

How did you manage to compile Lion Kernel in Snow Leopard? ;)

fumoboy007 08-16-2011 06:02 AM

Quote:

Originally Posted by Imkantus (Post 54897)
As you should know, Finder (and some other stuff) is 64-Bit only since Lion DP2 (and any later release).

Confirmed. Time to make legacy kernel 11.0 64-bit exclusive. :)

wastez 08-16-2011 12:32 PM

@anv

I saw on appleīs open source that there is the source for the libunwind for lion.
Should be perfect for a custom dyld i think!!!

nightf4ll 08-16-2011 12:41 PM

H.264 and Quicktime
 
Is there any way i can fix H.264 and Quicktime in 64 bit mode on an AMD procesor?? Anything i can do with amd_insn_patcher or should i just give up and go back to 32 bit mode??

fumoboy007 08-16-2011 03:46 PM

Quote:

Originally Posted by nightf4ll (Post 54940)
Is there any way i can fix H.264 and Quicktime in 64 bit mode on an AMD procesor?? Anything i can do with amd_insn_patcher or should i just give up and go back to 32 bit mode??

You will need to run QuickTime in 32-bit mode if your processor does not have SSSE3 support.

nightf4ll 08-16-2011 05:45 PM

Quote:

Originally Posted by fumoboy007 (Post 54941)
You will need to run QuickTime in 32-bit mode if your processor does not have SSSE3 support.

I have an AMD Athlon 64 X2 just like you, and they support sse3.. I have no idea why quictime crashes when playing .mov and .mp4 files, but only in 64 bit mode..

I ve read somewhere that i need to manually patch quicktimecomponents and h264scalar, thats why i m asking if some1 else managed to get it to work?

I wish i bought that intel processor instead AMD :-|

Imkantus 08-16-2011 06:13 PM

Quote:

Originally Posted by nightf4ll (Post 54940)
Is there any way i can fix H.264 and Quicktime in 64 bit mode on an AMD procesor?? Anything i can do with amd_insn_patcher or should i just give up and go back to 32 bit mode??

SSE3 != SSSE3
The amd_insn_patcher just removes those nasty SYSENTER traps, code signatutres... that prevent 32-Bit only Apps to work on 64-Bit mode AMD systems.
It is not going to emulate any Intel exclusive instructions.
You do not have to lunch the -legacy mode again, just run Quiktime 32-Bit only.

btw: VLC rules. :)

nightf4ll 08-16-2011 08:45 PM

Quote:

Originally Posted by Imkantus (Post 54943)
SSE3 != SSSE3
The amd_insn_patcher just removes those nasty SYSENTER traps, code signatutres... that prevent 32-Bit only Apps to work on 64-Bit mode AMD systems.
It is not going to emulate any Intel exclusive instructions.
You do not have to lunch the -legacy mode again, just run Quiktime 32-Bit only.

btw: VLC rules. :)

Thx for clearing that up and i have VLC already, thats first thing i dowloaded :P One more question.. I ve removed 64 bit part from quicklookd and now it loads only in 32 bit and doesnt crash, but how can i fix preview crash??

P.S. the instructions for that are here if some1 needs them

davisin666 08-17-2011 09:53 PM

Quote:

Originally Posted by nightf4ll (Post 54944)
Thx for clearing that up and i have VLC already, thats first thing i dowloaded :P One more question.. I ve removed 64 bit part from quicklookd and now it loads only in 32 bit and doesnt crash, but how can i fix preview crash??

P.S. the instructions for that are here if some1 needs them

To fix preview crash, you need to remove the x86_64 part of Finder, so, open terminal and type:

Code:

sudo cp /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder_bak
sudo ditto -arch i386 /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder_i386
sudo mv -f /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder_i386 /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder

Works f****ing good :cool:

nightf4ll 08-18-2011 12:29 AM

Quote:

Originally Posted by davisin666 (Post 54958)
To fix preview crash, you need to remove the x86_64 part of Finder, so, open terminal and type:

Code:

sudo cp /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder_bak
sudo ditto -arch i386 /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder_i386
sudo mv -f /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder_i386 /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder

Works f****ing good :cool:

Ok I did all of that, rebootet and everything works fine.. :D Now which kernel should i use on my Athlon 64 X2?? Whats the difference between Nawcom's Legacy kernel and Andy's? Should I use mach_kernel or mach_kernel atom? They both work for me..

wastez 08-18-2011 07:52 AM

Quote:

Originally Posted by nightf4ll (Post 54961)
Ok I did all of that, rebootet and everything works fine.. :D Now which kernel should i use on my Athlon 64 X2?? Whats the difference between Nawcom's Legacy kernel and Andy's? Should I use mach_kernel or mach_kernel atom? They both work for me..


The difference between nawcom and andys kernel is the custom dyld for on the fly cpuid patching.
But you can also disable the the custom dyld with flag std_dyld=Yes.

If you have a atom cpu you have to choose the mach_kernel atom and if not you have to take the other one.

RayFlower 08-19-2011 01:02 PM

Uhm am i the only one that desires a ssse3 emulator for snow leopard? :)

fumoboy007 08-19-2011 02:45 PM

Quote:

Originally Posted by RayFlower (Post 54969)
Uhm am i the only one that desires a ssse3 emulator for snow leopard? :)

No, you are not. :)

Imkantus 08-22-2011 01:34 PM

Quote:

Originally Posted by RayFlower (Post 54969)
Uhm am i the only one that desires a ssse3 emulator for snow leopard? :)

Latest AMD Fusion Mobile & Embedded cores have SSSE3 implementation & I think we will see Desktop CPUs with SSSE3 support end of this year.

There are some Mini-ITX boards using AMD Zacate (Brazos) cores - some less then 100€ (like the E350IS-E45 just 88€, 1.6 GHz Dualcore, up to 8GB DDR3).
If those would work with patched XNU, they'd be a real budget friendly alternative to the feeble & expensive Intel Atom platforms... :)

Anyway working Lion Kernel would be most wanted currently... :cool:

RayFlower 08-23-2011 09:53 AM

Quote:

Originally Posted by Imkantus (Post 55021)
Latest AMD Fusion Mobile & Embedded cores have SSSE3 implementation & I think we will see Desktop CPUs with SSSE3 support end of this year.

There are some Mini-ITX boards using AMD Zacate (Brazos) cores - some less then 100€ (like the E350IS-E45 just 88€, 1.6 GHz Dualcore, up to 8GB DDR3).
If those would work with patched XNU, they'd be a real budget friendly alternative to the feeble & expensive Intel Atom platforms... :)

Anyway working Lion Kernel would be most wanted currently... :cool:

Hum, time to upgrade then.
A lion kernel would be nice indeed but it would also be nice to have a fully working snow leopard kernel too.
I would like to avoid buying intel the next time i build a new computer but there isn't even power management for AMD yet so I'll stick with my pehom II x4 a bit longer:)

andyvand 08-23-2011 11:29 AM

Quote:

Originally Posted by Imkantus (Post 54897)
As you should know, Finder (and some other stuff) is 64-Bit only since Lion DP2 (and any later release).
I have tried Lion GM using your DP1 Kernel on Atom N230, apart from not having Finder, there were problems caused by launchd not working properly... it was kinda eating up my 1GB RAM :p - so I gave up on that... ;)

So a 64-Bit capable CPU is definitely required for running Lion & a Kernel running 32-Bit legacy mode only would be practical useless.

Anyway a 32-Bit Kernel capable of booting Lion on AMD / VIA / old Intel forced into 64-Bit mode would be a great success at this point - as even if you cannot make a custom dyld at the moment, we could bin-patch the Apple one manually like been done on Snow Leopard earlier... :)

How did you manage to compile Lion Kernel in Snow Leopard? ;)

With some minor code modifications.
Mods for custom dyld (for Lion) are complete, custom dyld for Lion builds now.
Mods for xnu are coming along (I just worked the entire night yesterday, I think it compiles allready for 32bit but requires some minor fixes for 64bit (warning fixes)... work continues).
I'll release all my work once it's done, somebody with Xcode 4.1 could recompile the kernel in order to make it fully Lion compiled.
Compiling the kernel under Snow Leopard (with Xcode 3.2.6/4.0) is possible with some minor code fixes (variables used uninitialized, just set them to 0 on the beginning of the defines).
Also Apple didn't change much on their decryption algo's, current implementation should work, however I had to rewrite amd_insn_patcher (and also add the changes to the kernel) because of a new 6 byte (instead of 8) _sysenter_trap routine.
Code mods on that part are complete and it puts it into it as it was doing with 10.6 (but uses a uint32_t as first and uint16_t as second code wrapper).
I've left the patcher for Snow Leopard's _sysenter trap into it, it just checks which precise _sysenter_trap is used and patches accordingly.
The change was just a nopl (%eax) to nop... (3B -> 1B).
I guess it will take at most a week to get the code wrapped up completely (and fixed for Lion), it'll work on all 64bit machines, even though having SSSE3 is really recommended since Lion.
I've checked for any SSSE3 checks in the kernel, there where none, it just catalogs the available instruction sets so if there would be any messages, they aren't coming from the kernel.
I should really check how these SSSE3 instructions (it aren't that many) work so I can devise a solution for them.
But first... the kernel ofcourse...
BTW: On InsanelyMac I uploaded Rev2 of the V8 (10.8.0) kernel with some minor fixes for AMD K10 FSB (as latest chameleon fixes that) with the option to double the FSB on those AMD models with -doublefsb boot arg.
I also did some minor changes for Via Nano, it now gets the CPU frequency through EFI booter.
Besides that it includes the custom dyld built with Apple's libunwind-30 code (which compiles fine on Snow Leopard too) but it didn't fully fix some apps crashing.
pbs still gave me some issues (unless I upxed it with my custom upx, then it worked fine).
I'll look into a solution for this as most crashes come from libauto.dylib (Auto::Zone::Zone).
QuickDraw (QD) also gave for some apps a crash.
Too bad we haven't got Apple's libCoreSymbolication library (with matching header) or we would be able to fix the last issues with the custom dyld.
Work continues thus and new solutions are sure to surface (I'm thinking hard for improvements/expansions).
I'll keep you posted... ;)

akimoa 08-23-2011 11:57 AM

Quote:

BTW: On InsanelyMac I uploaded Rev2 of the V8 (10.8.0) kernel with some minor fixes for AMD K10 FSB (as latest chameleon fixes that) with the option to double the FSB on those AMD models with -doublefsb boot arg.
Works like a charm Thanx for that !

andyvand 08-23-2011 01:05 PM

I have one more request.
Could somebody please zip and upload the dyld from Lion GM?
I need it because it checks for code signatures and I need to devise a patch against it.
It is required because if you patch the stock dyld (and/or libSystem.dylib) the code signatures won't be valid anymore.
If I have the stock dyld I can disassemble my custom one (which has this code excluded) and the stock one and check the differences.
If I find this difference I can make a patch (using amd_insn_patcher) which also nops out the code that does the actual code signature check in dyld.
It'll then work with the stock Apple Lion dyld too.
It's important because we need to get these things working 100% for AMD under Lion.
Thanks in advance ;-)
BTW: Don't use rapidshare/mediafire/upload.to/etc as my works internet blocks these in the proxy, upload directly here or on InsanelyMac please.
EDIT: Anyone? Please do it ASAP as I would like to devise a patch against it today... Just zip /usr/lib/dyld please + upload...

m28ew 08-23-2011 01:33 PM

1 Attachment(s)
Quote:

Originally Posted by andyvand (Post 55036)
I have one more request.
Could somebody please zip and upload the dyld from Lion GM?


Here's the file mate :)

MD5: 14acaee6a4e4f19b2cb1392bcebfaebb

akimoa 08-23-2011 01:33 PM

1 Attachment(s)
Here ya go :)

andyvand 08-23-2011 01:45 PM

Quote:

Originally Posted by akimoa (Post 55039)
Here ya go :)

Thanks a lot guys...
It'll help in making good patches... ;)

wastez 08-23-2011 01:47 PM

@ anv

I could compile the kernel on Lion if you want to?!
Just need the source to do that.

andyvand 08-23-2011 02:06 PM

Quote:

Originally Posted by wastez (Post 55041)
@ anv

I could compile the kernel on Lion if you want to?!
Just need the source to do that.

Ok, when I finish with the final revisions I'll send you the version to compile under Lion.
You could allready compile the LLVM library for i386 + x86_64... you need it to build the tools... :D

wastez 08-23-2011 02:12 PM

I already did that.
Compiled the source a few days ago.

andyvand 08-23-2011 02:38 PM

Quote:

Originally Posted by wastez (Post 55043)
I already did that.
Compiled the source a few days ago.

Ok no worries then ;)
I'll put in an extra script in case the voodoobuild.sh does everything but the kernel (extra script to build kernel after build halt, do after building dyld + patching dyld + rebasing dyld + injections in xnu when it's patched).
We'll get there soon... and it'll work great... :cool:

$The-King$ 08-23-2011 03:01 PM

Quote:

Originally Posted by andyvand (Post 55046)
Ok no worries then ;)
I'll put in an extra script in case the voodoobuild.sh does everything but the kernel (extra script to build kernel after build halt, do after building dyld + patching dyld + rebasing dyld + injections in xnu when it's patched).
We'll get there soon... and it'll work great... :cool:

promising work :D
thanks for your efforts

davisin666 08-23-2011 06:05 PM

Quote:

Originally Posted by andyvand (Post 55046)
Ok no worries then ;)
I'll put in an extra script in case the voodoobuild.sh does everything but the kernel (extra script to build kernel after build halt, do after building dyld + patching dyld + rebasing dyld + injections in xnu when it's patched).
We'll get there soon... and it'll work great... :cool:

What about libunwind and the custom dyld, will be fixed the issues with that???

Thanks for the kernel :D

andyvand 08-24-2011 06:47 AM

Quote:

Originally Posted by davisin666 (Post 55052)
What about libunwind and the custom dyld, will be fixed the issues with that???

Thanks for the kernel :D

No, unfortunetely probably not.
There are still some libraries which we don't have (libCoreSymbolication for example).
It works better but there are still some apps which don't work with the custom dyld.

andyvand 08-24-2011 10:56 AM

I finished making the kernel patches yesterday.
The code compiles well, now just some minor changes to the build script and we'll be on our way.
I'll build the sources under Snow, upload sources and built product, then wastez can build it with Xcode 4.1 GM and then I'll patch those built products also up for Atom... ;)
I'll probably finish the building (and adapting) this evening, uploading the sources and built products tomorrow. :D

wastez 08-24-2011 01:21 PM

Ok thatīs really fine.

Just tell me if you have finished it.

andyvand 08-25-2011 11:09 AM

Quote:

Originally Posted by wastez (Post 55078)
Ok thatīs really fine.

Just tell me if you have finished it.

I modified the script for building the Lion dyld + kernel.
It's currently building on my netbook (@ work).
I'll upload it when the build finishes.
It'll be uploaded @ insanelymac in my current legacy kernel thread (I'll post the link here).
I've also made a compile_kernel.sh script to start the build in an allready patched + injected xnu-xxx directory.
Both will need to be runned from within the voodoobuild-AnV-0.5.1 folder.