Jump to content

fresh for Lion from source : single 32 and 64bit kernels


  • Please log in to reply
43 replies to this topic

#1
smartie77

smartie77

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 370 posts
  • Gender:Male
  • Location:Dortmund, Germany
  • Interests:Apple Software, iOS , OSX86, Creativity and a lot of non-tech stuff.
Apples mach_kernel is 15MB and is a hybrid, contains as well 32 and 64bit code. It all depends on if you boot with i386 or x86_x64 as arch argument.

Today I downloaded the official xnu source code for Lions kernel and set up my build environment. I just did a compile without any changes ( will play later with what is possible ). So this is still a Apple "vanilla" kernel, meaning it will run on the CPUs that Lion "needs" ( by Apples specifications ) .

But I made two kernels : one for i386, 32bit and the other for 64bit, x86_x64. Each one is now only 7,5MB in size and I feel they perform both better then the stock one. My machine loads quicker , if for anything this alone is nice.

"my" 32bit kernel can still execute 64bit apps, see proof - Photoshop CS5 x64 mode on 32bit kernel :


Attached File  Bildschirmfoto_2011_07_22_um_13.16.40.png   535.63KB   584 downloads
So here they are, fresh compiled for you - put in / and rename to mach_kernel ( or leave the names and specify one to load in your com.apple.boot.plist :

32 Bit Attached File  32_kernel.zip   2.83MB   416 downloads

64 bit Attached File  64_kernel.zip   2.91MB   427 downloads

#2
AkimoA

AkimoA

    AMD

  • Local Moderators
  • 221 posts
  • Gender:Male
  • Location:Black Forest (GER)

( will play later with what is possible ).


Sounds very promising let me know if u need a Dummy to test with since we both german !

#3
smartie77

smartie77

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 370 posts
  • Gender:Male
  • Location:Dortmund, Germany
  • Interests:Apple Software, iOS , OSX86, Creativity and a lot of non-tech stuff.

Sounds very promising let me know if u need a Dummy to test with since we both german !


this will take a bit I fear - I know my way around for Linux but never played with OSX kernel configs. I did just compile the stock kernels to see if they build and if they boot and if OSX still functions like it should - so that's what they do - and I just share them now.

I specifically am onto one single disabled feature in Lion : Rosetta. .. :wacko:

#4
AkimoA

AkimoA

    AMD

  • Local Moderators
  • 221 posts
  • Gender:Male
  • Location:Black Forest (GER)
i get what u did we sort of succeeded on this earlier too... also started to use the legacy diffs provided all over the place with not much luck tough ..thats what happens when knowledge is very limited !!

#5
smartie77

smartie77

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 370 posts
  • Gender:Male
  • Location:Dortmund, Germany
  • Interests:Apple Software, iOS , OSX86, Creativity and a lot of non-tech stuff.

i get what u did we sort of succeeded on this earlier too... also started to use the legacy diffs provided all over the place with not much luck tough ..thats what happens when knowledge is very limited !!



yeah :-P

Now I learned so much in the last months alone.. set up Snow, learned about Lion, made that work, made my hack book work and now providing people with infos for the damn ati mobility card every second Laptop seems to have these days.. Hexediting, kexts modify, smbios tweaks ..

Kernel is new, but nothing is impossible.. but now I need a break, happy Weekend all.

#6
darylz

darylz

    InsanelyMac Protégé

  • Members
  • Pip
  • 12 posts
Can i use this now on a ATOM N270 32 bit processer
Thnx

#7
nyolc8

nyolc8

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 802 posts
  • Gender:Male
  • Location:Budapest, Hungary
Tried it, renamed it to "light_kernel", copied to root, then set boot.plist <key>Kernel</key><string>light_kernel</string>.
It starts, but now every time it loads all kexts on boot. Tried to rebuild kernelcache via terminal, but same issue. (already using "UseKernelCache" option in boot.plist)

Edit.: I set back to mach_kernel and now don't load kexts every time.

@smartie77: how did you "installed" it? Did you renamed it to mach_kernel?

#8
HFW

HFW

    InsanelyMac Protégé

  • Members
  • PipPip
  • 84 posts
  • Gender:Male
  • Location:England
Tried it... Did seem to boot up a lil faster.

Problem is, now it takes about 2 minutes to login o.o
not sure what that's about?

#9
smartie77

smartie77

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 370 posts
  • Gender:Male
  • Location:Dortmund, Germany
  • Interests:Apple Software, iOS , OSX86, Creativity and a lot of non-tech stuff.

Can i use this now on a ATOM N270 32 bit processer
Thnx


no - it still vanilla apple cpu support ( already said it -- pls read the next time before asking )

Tried it... Did seem to boot up a lil faster.

Problem is, now it takes about 2 minutes to login o.o
not sure what that's about?


This is not in my case. It is faster from cold boot to the login screen. Otherwise I would not thought about sharing it if it would be slower..

Maybe depends on the boot loader ? I use chimera from latest #####.

Tried it, renamed it to "light_kernel", copied to root, then set boot.plist <key>Kernel</key><string>light_kernel</string>.
It starts, but now every time it loads all kexts on boot. Tried to rebuild kernelcache via terminal, but same issue. (already using "UseKernelCache" option in boot.plist)

Edit.: I set back to mach_kernel and now don't load kexts every time.

@smartie77: how did you "installed" it? Did you renamed it to mach_kernel?


I call it 64_kernel // 32_kernel and have set it ( the 64 one for me ) to boot via com.apple.boot.plist from /Extra:

Bootloader latest chimera as found in "#####" ( based onchameleon 2rc5 it seems to be ), its a reliable booter for me.

Before I had a "full options" build of chameleon ( obtained via kexts.com ) and this was the slowest boot loader ever, also full of errors and "waiting for root device".. Horrible , therefore I tried chimera and everything was quick as now.

"
<dict>
<key>Kernel Flags</key>
<string>arch=x86_x64</string>

<key>UseAtiROM</key>
<string>Yes</string>
<key>RestartFix</key>
<string>Yes</string>

<key>GeneratePStates</key>
<string>Yes</string>
<key>pmVersion</key>
<string>102</string>
<key>GenerateCStates</key>
<string>Yes</string>
<key>EthernetBuiltIn</key>
<string>Yes</string>

<key>GraphicsEnabler</key>
<string>No</string>
<key>Default Partition</key>
<string>hd(0,2)</string>
<key>DSDT</key>
<string>/Extra/dsdt.aml</string>
<key>Kernel</key>
<string>64_kernel</string>

<key>PciRoot</key>
<string>1</string>
<key>USBBusFix</key>
<string>Yes</string>
<key>SMBIOS</key>
<string>/Extra/smbios.plist</string>
</dict>"

I have a smbios.plist + applegraphicspowermanagement.kext that matches 100% the real hardware , and ethernet is turned OFF because I use WiFi and thus booting is quicker when Ethernet is not trying to load a self-assigned address.

but this is only a 2 second delay if I would turn it on.

The old mach_kernel ( the invisible one from OSX default ) sits still in / - but it is not used anymore. Keep it only if something horrible goes wrong - but it seems to work exactly like the fat one before.

ps: the new kernel caches in Lion are not yet clear to me - I never booted with -f or such in Lion. If I need to exchange kexts then I simply do it in single user mode , set chmods and chowns and make a reboot by shutdown -r now - sometimes it takes two reboots until a kernel is loaded by this brutal mode, but it always works this way sooner or later.

So OSX builds its caches on its own without manual interfering needed .

#10
teateam

teateam

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 153 posts
Everything is much simpler:
lipo /mach_kernel -extract i386 -output /mach_kernel_32
lipo /mach_kernel -extract x86_64 -output mach_kernel_64
:rolleyes:

#11
smartie77

smartie77

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 370 posts
  • Gender:Male
  • Location:Dortmund, Germany
  • Interests:Apple Software, iOS , OSX86, Creativity and a lot of non-tech stuff.

Everything is much simpler:

lipo /mach_kernel -extract i386 -output /mach_kernel_32
lipo /mach_kernel -extract x86_64 -output mach_kernel_64
:)



Yes someone told me already so .. What shall I say ? I did not knew it . This output was the product of my first Kernel build which I did for learning purpose only to make sure I understand it..

I am new into Kernel config/build.. So I started with a clean copy of Apples release and out came that what I have.. And I just thought I am a genius ;.)

No seriously, before I go and edit config options and maybe producing some garbage kernel I needed to do it once with a 100% working copy. You know.. learning by doing.. At least now I know for sure that all tools and the build environment are working on my machine.

And it was damn quick to produce these kernels.. Core2Duo with 4Gigs of Ram, it ran in the background and lasted not long .. doing a rebuild of Linux 3.0 :rolleyes: takes longer..

#12
n3cr0d3rm!S

n3cr0d3rm!S

    InsanelyMac Protégé

  • Members
  • Pip
  • 1 posts
Great work :D

But Lion's frameworks and system files are Intel, and universal frameworks (PPC/Intel) are required to enable rosetta.
So you have to get all sources of all system files (Frameworks, extensions, etc) and compile to an universal binary
to get rosetta working :D

I will try to get something for AMD

#13
smartie77

smartie77

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 370 posts
  • Gender:Male
  • Location:Dortmund, Germany
  • Interests:Apple Software, iOS , OSX86, Creativity and a lot of non-tech stuff.

Great work :(

But Lion's frameworks and system files are Intel, and universal frameworks (PPC/Intel) are required to enable rosetta.
So you have to get all sources of all system files (Frameworks, extensions, etc) and compile to an universal binary
to get rosetta working ;)

I will try to get something for AMD


rosetta is very small and much independent from the rest of OSX. 99% of all stuff needed sits in /usr/libexec/oah . In Lion the folder is empty with only the blocking exe inside. ut that can be replaced with the content from SL dvd or extracted installer packs.

The problem is that ( as I understand it ) inside the Lion kernel all calls to the rosetta exe ( which is called "translate" ) are returned to another exe ( "RosettaNonGrata" which simply blocks it.

Hardcoded "No-go" if you want so ..

-

#14
BugsB

BugsB

    InsanelyMac Deity

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 1,513 posts
  • Gender:Male
  • Location:Kauai, Hawai'i
Not bad. Anybody running Lion in 32 bit mode on a a Core Duo (NOT Core 2 Duo)?

@ smartie77: which screen size is your Toshi? Googled but found contradicting sizes. I guess u bought it in Deutschland?

#15
brandonb21

brandonb21

    InsanelyMac Protégé

  • Members
  • Pip
  • 39 posts

Not bad. Anybody running Lion in 32 bit mode on a a Core Duo (NOT Core 2 Duo)?

@ smartie77: which screen size is your Toshi? Googled but found contradicting sizes. I guess u bought it in Deutschland?

i could test later today if needed

#16
jaco3700

jaco3700

    InsanelyMac Protégé

  • Members
  • Pip
  • 5 posts
  • Location:Tongeren, Belgium

i could test later today if needed


Yes, could you? I would love to have Lion on my old MacBook 1.1 ;)

#17
brandonb21

brandonb21

    InsanelyMac Protégé

  • Members
  • Pip
  • 39 posts

Yes, could you? I would love to have Lion on my old MacBook 1.1 :)

im installing snow leo as i speak. starting fresh

#18
jaco3700

jaco3700

    InsanelyMac Protégé

  • Members
  • Pip
  • 5 posts
  • Location:Tongeren, Belgium

im installing snow leo as i speak. starting fresh


I was to excited.... It will not work. The Finder is 64 bits and my MacBook is 32 bits. Maybe a hacker will come with something i hope ;)

#19
BugsB

BugsB

    InsanelyMac Deity

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 1,513 posts
  • Gender:Male
  • Location:Kauai, Hawai'i
The Finder.app of Lion DP 1 (Developer Preview) build 11a390 was still 32/64. You might be able to use that one (+ maybe some Framework(s), Application Support etc.). The closest (but not complete) 32 bit hack I was able to find is for DP4: http://osxdaily.com/...4-core-duo-mac/

it also mentions three kexts that need to be replaced for 32 bit support of DP4.

I bet there is solutions for GM/RTM 32 bit on CPUs <Core 2 Duo out there already somewhere .. :(

#20
startas

startas

    InsanelyMac Protégé

  • Members
  • Pip
  • 19 posts

Everything is much simpler:

lipo /mach_kernel -extract i386 -output /mach_kernel_32
lipo /mach_kernel -extract x86_64 -output mach_kernel_64
:(

Great :) Does it work with Snow Leopard kernel ?





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy