Hello Kevin,
"uname -v" on my local system shows:
Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:30 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6020
so I've been using T6020 as the "platform" when building the kernel.
The corresponding xnu source is this tag https://github.com/apple-oss-distributions/xnu/tree/xnu-11417.140.69 and the KDK is KDK_15.6_24G84.kdk. sw_vers shows me:
sw_vers
ProductName: macOS
ProductVersion: 15.6
BuildVersion: 24G84
So I think that's the right KDK version for this system.
I'm guessing the XCode version doesn't matter for these experiments (as long as the build succeeds), but for the record, I'm on XCode 16.4:
xcodebuild -version
Xcode 16.4
Build version 16F6
Apart from the other build instructions, the primary one I use to generate a "DEVELOPMENT" variant of the kernel is:
export KDK=/Library/Developer/KDKs/KDK_15.6_24G84.kdk
make SDKROOT=macosx KDKROOT=$KDK BUILD_WERROR=0 BUILD_JSON_COMPILATION_DATABASE=1 TARGET_CONFIGS="DEVELOPMENT ARM64 T6020"
and then to generate a (bootable) kext collection for this kernel, I use (this command is similar to what's noted in the linked article):
kmutil create \
--arch arm64e \
--no-authorization \
--variant-suffix development \
--new boot \
--boot-path /Users/me/xnu-11417.140.69/dist/macos-15.6-development.kc \
--kernel /Users/me/xnu-11417.140.69/dist/kernel.development.T6020 \
--repository $KDK/System/Library/Extensions \
--repository /System/Library/Extensions \
--repository /System/Library/DriverExtensions \
--explicit-only $(kmutil inspect -V release --no-header | grep -v "SEPHiber" | awk '{print " -b "$1; }')
This generates the kext collection at /Users/me/xnu-11417.140.69/dist/macos-15.6-development.kc.development and the following command against that kext collection file seems to suggest all looks OK:
file /Users/me/xnu-11417.140.69/dist/macos-15.6-development.kc.development
/Users/me/xnu-11417.140.69/dist/macos-15.6-development.kc.development: Mach-O 64-bit arm64e
All this goes fine, so does running the following command in recovery mode:
kmutil configure-boot --volume "/Volumes/Macintosh HD" --custom-boot-object "/Volumes/Macintosh HD/Users/me/xnu-11417.140.69/dist/macos-15.6-development.kc.development"
(along with "nvram boot-args='-v wlan.skywalk.enable=0 dk=0'")
Yet, when I restart with that configured custom boot object, the Apple icon keep repeating and the system keeps restarting. I haven't done any changes to the kernel code itself, so I can rule out any custom code contributing to this.
My next plan is to build the RELEASE variant of this kernel and see if that boots fine instead of the DEVELOPMENT variant. If not, I'll read up a bit to understand how to track down the boot issue. Thank you very much for the helpful hints so far.