Welcome to AMD OS X

Why not register now to gain full access.

Development and testing of modified XNU Kernels for AMD CPUs on OS X
User avatar
by: Shaneee
#41293
Here you can learn how to compile the High Sierra XNU. This is aimed at the 10.13.3 source.

To begin with you'll need Xcode 9.2 as anything higher compiles it in such a way that it'll break Clover Kext Injection. You'll also need the Command Line Tools to match. Both are linked below.
Code: Select all
https://download.developer.apple.com/Developer_Tools/Xcode_9.2/Xcode_9.2.xip

https://download.developer.apple.com/Developer_Tools/Command_Line_Tools_macOS_10.13_for_Xcode_9.2/Command_Line_Tools_macOS_10.13_for_Xcode_9.2.dmg

Once you've got those both downloaded and installed you'll need to build the dependancies to be able to compile the XNU.
Download the script below from afrighetto.
Code: Select all
https://gist.github.com/afrighetto/e47b990f52586b4797297e7548e6352c/archive/d333e579050c52903b6063560aef536cadc72963.zip

Once downloaded I recommend placing it in a folder in the Documents folder so for example Documents/BuildXNU.

Now open up Terminal and follow these commands.
Code: Select all
cd Documents/BuildXNU

MACOS_VERSION=10.13.3 ./build-xnu.sh

Now the last part may fail which is fine, no need to worry. It just compiles the vanilla XNU.

Now download the 10.13.3 XNU (xnu-4570.41.2) from the link below.
Code: Select all
https://opensource.apple.com/tarballs/xnu/xnu-4570.41.2.tar.gz
With that downloaded unpack it so you've got the folder. Now using Terminal CD into the XNU folder. From here we can apply the AMD diff file, make any changes and compile the kernel ready for use.

Download my AMD diff from here,
Code: Select all
https://amd-osx.com/files/Shaneee_HS_Minimal_V3.diff.zip

Now back at Terminal you should be in the XNU folder. To apply the diff to the source run this command replacing the diff path with where you've save it.
Code: Select all
patch -p1 < /Path/To/Diff

Now the source is AMD ready. Make any changes you wish but pay attention to osfmk/i386/cpuid.c and osfmk/i386/tsc.c as this is where most of the AMD magic happens.

Once you've done making any changes with Terminal once again in the XNU folder run this to compile the kernel,
Code: Select all
sudo make SDKROOT=macosx ARCH_CONFIGS=X86_64 KERNEL_CONFIGS=RELEASE

If successful the built kernel will be in BUILD/obj/RELEASE_X86_64/

If you wan't to build the matching System.kext and Frameworks use the build command,
Code: Select all
sudo make SDKROOT=macosx ARCH_CONFIGS=X86_64 KERNEL_CONFIGS=RELEASE install

 Advertising

User avatar
by: rohan
#41476
@Shaneee, whats the use of this? will the performance increase?? i have ryzen 7 1800x
How did you find us?

Hi Shane, I found you via videos on YouTube. I h[…]

OsxAptioFixDrv Error

I had the same issue, and solved it with the same […]

So it is workd ?

INTEL or AMD?

intel is more stable .. amd is also cool but its l[…]

AMD OS X Advertisements