Jump to content

AnV XNU 14.3.0 legacy kernel (V5)


21 posts in this topic

Recommended Posts

I have built a legacy kernel for Intel/AMD.

I have used the Linux opemu edited.

Patch is included.

Needs testing...

EDIT: Corrected build, I had the Darwin kernel version wrong...

EDIT2: Added AMD Ryzen family 23

 

EDIT3: Info for rebuilding the kernel cache is here:

https://kernelshaman.blogspot.com/2021/01/building-xnu-for-macos-big-sur-1101.html

 

EDIT4: Fixed trust caches.

This now supports the installer decently.

EDIT5: Added Intel Merom family.

EDIT6: Fix opemu.

EDIT7: Fixed kernel.

I have reverse engineered some of the missing routines (using KDK and Hopper).

The result is a working XNU kernel.

The routines are in Reversed.s

Also now included in the zip is BootKernelExtensions.kc (kernel cache).

EDIT8: New version based on Shanee's patch.

There where errors in my patch.

I have added the reverse engineered functions and new opemu.

Included is BootKernelExtensions.kc

 

XNU-14.3.0-AnV_R5.zip

Edited by Andy Vandijck
  • Like 4
  • Thanks 1
Link to comment
Share on other sites

@Shanee @Andy Vandijck

The reason why I haven't returned here is because my Nvidia graphics card has finally gone to the "eternal hunting grounds", 🥵 and I have hesitated until today to invest money in old technology. I am looking for a used Hackintosh-compatible graphics card. Once I have obtained a used one, I will test your kernel.

Link to comment
Share on other sites

No reports yet?

Could somebody give more info on the success of the kernel?

Thanks in advance...

Link to comment
Share on other sites

I have updated the kernel.

Now it prelinks correctly.

Included in the zip is BootKernelExtensions.kc (the boot kernel cache)

  • Like 1
Link to comment
Share on other sites

14 hours ago, Andy Vandijck said:

I have updated the kernel.

Now it prelinks correctly.

Included in the zip is BootKernelExtensions.kc (the boot kernel cache)

Should I rename it to prelinkedkernel ?

Or how to apply it correctly because I always got reboot due to lack of prelinkedkernel ?

Link to comment
Share on other sites

14 hours ago, Andy Vandijck said:

I have updated the kernel.

Now it prelinks correctly.

Included in the zip is BootKernelExtensions.kc (the boot kernel cache)

Is it for installer of High Sierra 10.13.6 only ?

Link to comment
Share on other sites

6 hours ago, jsl2000 said:

Is it for installer of High Sierra 10.13.6 only ?

Main binary is Sonoma.

  • Like 1
Link to comment
Share on other sites

1 hour ago, Andy Vandijck said:

Main binary is Sonoma.

So it's for Sonoma 14.4 or 14.x instead of for HS 10.13.6 ?

How to apply BootKernelExtensions.kc (the boot kernel cache) ?

Thanks.

Link to comment
Share on other sites

2 hours ago, jsl2000 said:

So it's for Sonoma 14.4 or 14.x instead of for HS 10.13.6 ?

How to apply BootKernelExtensions.kc (the boot kernel cache) ?

Thanks.

You need to copy BootKernelExtensions.kc to /System/Library/KernelCollections/BootKernelExtensions.kc

  • Like 1
Link to comment
Share on other sites

On 4/1/2024 at 8:33 AM, Andy Vandijck said:

No reports yet?

Could somebody give more info on the success of the kernel?

Thanks in advance...

Excuse my ignorance but what is the purpose of this kernel ?

Which macOS's does it support ?

How is one suppose to use it ?

Link to comment
Share on other sites

9 hours ago, Andy Vandijck said:

You need to copy BootKernelExtensions.kc to /System/Library/KernelCollections/BootKernelExtensions.kc

Hi Andy,

I'm encountering a problem while trying to build the High Sierra Kernel. It hangs right before completion, just before the kernel is built. Do you have a solution before I resort to the tedious process of searching for each individual undefined entry in the source code to declare it?

Here's the compiler output:

undef: _krealloc_data
undef: __NSConcreteStackBlock
undef: _exclaves_register_upcall_handler
undef: _kalloc_type_impl
undef: ___firehose_buffer_kernel_chunk_count
undef: _kfree_type_impl
undef: _is_xeon_sp
undef: _exclaves_endpoint_call
undef: _exclaves_free_ipc_buffer
undef: _kfree_type_var_impl
undef: _exclaves_get_ipc_buffer
undef: _exclaves_allocate_ipc_buffer
undef: _kalloc_type_var_impl
undef: __Block_object_dispose
undef: __Block_copy
undef: _bitfield32
Undefined symbols for architecture x86_64:
  "_krealloc_data", referenced from:
      loc_ffffff80002f918a in Reversed.o
  "__NSConcreteStackBlock", referenced from:
      _tb_afk_transport_create in Reversed.o
      _tb_forwarding_connection_create in Reversed.o
      loc_ffffff80002fc854 in Reversed.o
      _tb_list_find in Reversed.o
      _tb_list_remove in Reversed.o
      _tb_service_connection_create in Reversed.o
  "_exclaves_register_upcall_handler", referenced from:
      sub_ffffff80002fbd96 in Reversed.o
  "_kalloc_type_impl", referenced from:
      sub_ffffff80002fbdd4 in Reversed.o
      sub_ffffff80002fbb64 in Reversed.o
      sub_ffffff80002fc391 in Reversed.o
      sub_ffffff80002fc518 in Reversed.o
      _tb_afk_transport_create in Reversed.o
      sub_ffffff80002f9412 in Reversed.o
      sub_ffffff80002f9eb5 in Reversed.o
      ...
  "___firehose_buffer_kernel_chunk_count", referenced from:
      _oslogioctl in lto.o
      _oslog_init in lto.o
      ___firehose_allocate in lto.o
  "_kfree_type_impl", referenced from:
      loc_ffffff80002fa661 in Reversed.o
      sub_ffffff80002fbdd4 in Reversed.o
      loc_ffffff80002fbeaf in Reversed.o
      loc_ffffff80002fbedd in Reversed.o
      loc_ffffff80002fc4ae in Reversed.o
      sub_ffffff80002fc518 in Reversed.o
      loc_ffffff80002f9feb in Reversed.o
      ...
  "_is_xeon_sp", referenced from:
      _tsc_init in lto.o
  "_exclaves_endpoint_call", referenced from:
      sub_ffffff80002fbcc0 in Reversed.o
  "_exclaves_free_ipc_buffer", referenced from:
      sub_ffffff80002fbc89 in Reversed.o
  "_kfree_type_var_impl", referenced from:
      loc_ffffff80002f9d1b in Reversed.o
      sub_ffffff80002fc0b2 in Reversed.o
      sub_ffffff80002fc058 in Reversed.o
      sub_ffffff80002fc23d in Reversed.o
      loc_ffffff80002fc33e in Reversed.o
      sub_ffffff80002f9c2f in Reversed.o
  "_exclaves_get_ipc_buffer", referenced from:
      sub_ffffff80002fbc37 in Reversed.o
      sub_ffffff80002fbdd4 in Reversed.o
  "_exclaves_allocate_ipc_buffer", referenced from:
      sub_ffffff80002fbc37 in Reversed.o
  "_kalloc_type_var_impl", referenced from:
      sub_ffffff80002f9dcf in Reversed.o
      sub_ffffff80002fbfff in Reversed.o
      loc_ffffff80002f9119 in Reversed.o
      loc_ffffff80002f920d in Reversed.o
      loc_ffffff80002f8c3d in Reversed.o
  "__Block_object_dispose", referenced from:
      loc_ffffff80002fc8ee in Reversed.o
      loc_ffffff80002fc91a in Reversed.o
      loc_ffffff80002fca62 in Reversed.o
  "__Block_copy", referenced from:
      _tb_transport_set_message_handler in Reversed.o
      _tb_forwarding_connection_create in Reversed.o
      sub_ffffff80002fc70c in Reversed.o
      _tb_service_connection_create in Reversed.o
  "_bitfield32", referenced from:
      _cpuid_set_info in lto.o
      _cpuid_set_cache_info in lto.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [/Users/mein/AnV-XNU-10.13.6__14.3.0-legacy-kernel-2024/xnu-4570.71.2-AMD-ALL-AnV-R4/BUILD/obj/RELEASE_X86_64//kernel.unstripped] Error 1
make[2]: *** [build_all] Error 2
make[1]: *** [build_all_bootstrap_RELEASE^X86_64^NONE] Error 2
make: *** [install] Error 2

The previous kernel required some effort in patching and compiling from XNU-14.3.0 to XNU-10.13.6, but this one, with the Reversed.s, requires a bit more background knowledge. I have a rough idea of what this assembly source file is for, but the machine language is a bit too advanced for me. Hence the cautious inquiry.

 

Edit:

The compiler messages referred to the previous version V4. In the meantime, you have uploaded a new kernel V5.

I would need to patch the new kernel to check if these compiler messages repeat. Then I'll see how to handle them better.

  • Like 1
Link to comment
Share on other sites

7 hours ago, spakk said:

Hi Andy,

I'm encountering a problem while trying to build the High Sierra Kernel. It hangs right before completion, just before the kernel is built. Do you have a solution before I resort to the tedious process of searching for each individual undefined entry in the source code to declare it?

Here's the compiler output:

undef: _krealloc_data
undef: __NSConcreteStackBlock
undef: _exclaves_register_upcall_handler
undef: _kalloc_type_impl
undef: ___firehose_buffer_kernel_chunk_count
undef: _kfree_type_impl
undef: _is_xeon_sp
undef: _exclaves_endpoint_call
undef: _exclaves_free_ipc_buffer
undef: _kfree_type_var_impl
undef: _exclaves_get_ipc_buffer
undef: _exclaves_allocate_ipc_buffer
undef: _kalloc_type_var_impl
undef: __Block_object_dispose
undef: __Block_copy
undef: _bitfield32
Undefined symbols for architecture x86_64:
  "_krealloc_data", referenced from:
      loc_ffffff80002f918a in Reversed.o
  "__NSConcreteStackBlock", referenced from:
      _tb_afk_transport_create in Reversed.o
      _tb_forwarding_connection_create in Reversed.o
      loc_ffffff80002fc854 in Reversed.o
      _tb_list_find in Reversed.o
      _tb_list_remove in Reversed.o
      _tb_service_connection_create in Reversed.o
  "_exclaves_register_upcall_handler", referenced from:
      sub_ffffff80002fbd96 in Reversed.o
  "_kalloc_type_impl", referenced from:
      sub_ffffff80002fbdd4 in Reversed.o
      sub_ffffff80002fbb64 in Reversed.o
      sub_ffffff80002fc391 in Reversed.o
      sub_ffffff80002fc518 in Reversed.o
      _tb_afk_transport_create in Reversed.o
      sub_ffffff80002f9412 in Reversed.o
      sub_ffffff80002f9eb5 in Reversed.o
      ...
  "___firehose_buffer_kernel_chunk_count", referenced from:
      _oslogioctl in lto.o
      _oslog_init in lto.o
      ___firehose_allocate in lto.o
  "_kfree_type_impl", referenced from:
      loc_ffffff80002fa661 in Reversed.o
      sub_ffffff80002fbdd4 in Reversed.o
      loc_ffffff80002fbeaf in Reversed.o
      loc_ffffff80002fbedd in Reversed.o
      loc_ffffff80002fc4ae in Reversed.o
      sub_ffffff80002fc518 in Reversed.o
      loc_ffffff80002f9feb in Reversed.o
      ...
  "_is_xeon_sp", referenced from:
      _tsc_init in lto.o
  "_exclaves_endpoint_call", referenced from:
      sub_ffffff80002fbcc0 in Reversed.o
  "_exclaves_free_ipc_buffer", referenced from:
      sub_ffffff80002fbc89 in Reversed.o
  "_kfree_type_var_impl", referenced from:
      loc_ffffff80002f9d1b in Reversed.o
      sub_ffffff80002fc0b2 in Reversed.o
      sub_ffffff80002fc058 in Reversed.o
      sub_ffffff80002fc23d in Reversed.o
      loc_ffffff80002fc33e in Reversed.o
      sub_ffffff80002f9c2f in Reversed.o
  "_exclaves_get_ipc_buffer", referenced from:
      sub_ffffff80002fbc37 in Reversed.o
      sub_ffffff80002fbdd4 in Reversed.o
  "_exclaves_allocate_ipc_buffer", referenced from:
      sub_ffffff80002fbc37 in Reversed.o
  "_kalloc_type_var_impl", referenced from:
      sub_ffffff80002f9dcf in Reversed.o
      sub_ffffff80002fbfff in Reversed.o
      loc_ffffff80002f9119 in Reversed.o
      loc_ffffff80002f920d in Reversed.o
      loc_ffffff80002f8c3d in Reversed.o
  "__Block_object_dispose", referenced from:
      loc_ffffff80002fc8ee in Reversed.o
      loc_ffffff80002fc91a in Reversed.o
      loc_ffffff80002fca62 in Reversed.o
  "__Block_copy", referenced from:
      _tb_transport_set_message_handler in Reversed.o
      _tb_forwarding_connection_create in Reversed.o
      sub_ffffff80002fc70c in Reversed.o
      _tb_service_connection_create in Reversed.o
  "_bitfield32", referenced from:
      _cpuid_set_info in lto.o
      _cpuid_set_cache_info in lto.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [/Users/mein/AnV-XNU-10.13.6__14.3.0-legacy-kernel-2024/xnu-4570.71.2-AMD-ALL-AnV-R4/BUILD/obj/RELEASE_X86_64//kernel.unstripped] Error 1
make[2]: *** [build_all] Error 2
make[1]: *** [build_all_bootstrap_RELEASE^X86_64^NONE] Error 2
make: *** [install] Error 2

The previous kernel required some effort in patching and compiling from XNU-14.3.0 to XNU-10.13.6, but this one, with the Reversed.s, requires a bit more background knowledge. I have a rough idea of what this assembly source file is for, but the machine language is a bit too advanced for me. Hence the cautious inquiry.

 

Edit:

The compiler messages referred to the previous version V4. In the meantime, you have uploaded a new kernel V5.

I would need to patch the new kernel to check if these compiler messages repeat. Then I'll see how to handle them better.

Yes those symbols aren't defined in 13.X and below.

The patch got the instructions from the KDK.

I used the release kernel and reverse engineered those instructions.

Without those the prelink will fail.

  • Like 2
Link to comment
Share on other sites

40 minutes ago, Andy Vandijck said:

Yes those symbols aren't defined in 13.X and below.

The patch got the instructions from the KDK.

I used the release kernel and reverse engineered those instructions.

Without those the prelink will fail.

Thank you very much Andy for your feedback and explanation. I had begun to doubt myself. Even though I had those thoughts and suspected as much, I unfortunately didn't compile the patched kernel (XNU 14.3.0-AnV_R4) for testing. If I had, my questions would have been answered by then. :-).

Link to comment
Share on other sites

4 hours ago, spakk said:

Thank you very much Andy for your feedback and explanation. I had begun to doubt myself. Even though I had those thoughts and suspected as much, I unfortunately didn't compile the patched kernel (XNU 14.3.0-AnV_R4) for testing. If I had, my questions would have been answered by then. :-).

I have built a High Sierra kernel.

 

  • Like 1
Link to comment
Share on other sites

1 hour ago, Andy Vandijck said:

I have built a High Sierra kernel.

Hi @Andy Vandijck

I also built the kernel earlier and had to go shopping briefly. This kernel includes XCPM

xnu-4570.71.2-AMD-ALL-AnV-R4.zip

 

Edit:

So, the long-awaited graphics card just arrived, and now I'll compile a kernel for Mojave since I still have a partition with Mojave installed. I'm looking forward to the tests and hope that the system now boots into the desktop 😜

  • Like 4
Link to comment
Share on other sites

12 hours ago, spakk said:

I also built the kernel earlier and had to go shopping briefly. This kernel includes XCPM

xnu-4570.71.2-AMD-ALL-AnV-R4.zip 4.51 MB · 3 downloads

 

Edit:

So, the long-awaited graphics card just arrived, and now I'll compile a kernel for Mojave since I still have a partition with Mojave installed. I'm looking forward to the tests and hope that the system now boots into the desktop 😜

Thanks, but this V4 still got automatically reboot by Enoch 2912 in my AMD hackintosh of X6 1100T.

Link to comment
Share on other sites

18 hours ago, spakk said:

I also built the kernel earlier and had to go shopping briefly. This kernel includes XCPM

xnu-4570.71.2-AMD-ALL-AnV-R4.zip 4.51 MB · 4 downloads

 

Edit:

So, the long-awaited graphics card just arrived, and now I'll compile a kernel for Mojave since I still have a partition with Mojave installed. I'm looking forward to the tests and hope that the system now boots into the desktop 😜

I have a new patch.

It works now (I think).

Could you test this one please (It has extra symbols for 10.13.6)

  • Like 1
Link to comment
Share on other sites

2 hours ago, Slice said:

Sorry, where did you get sources for XCPM?

Hi @Slice, this XCPM code is not of my own creation. I can't even tell you where I got it from or where I adopted it.xnu-4570.71.2-xcpm-vanillia.diff

  • Like 1
Link to comment
Share on other sites

 Share

×
×
  • Create New...