Where is kernel_task?

I see kernel_task in Activity monitor. But I cannot find where the binary file is using Spotlight. Does anybody know where the binary is found on the disk? I am using Big Sur 11.4. But my question may not be related to the particular version of the OS.


Solution 1:

The process name kernel_task is artificially set by the xnu kernel itself during initialization (see bsd_init()) as a way to represent the kernel's threads to users and other processes within the BSD layer as part of its process accounting system. The kernel binary lives in /System/Library/Kernels/kernel. However, recent releases of macOS do not load this image directly. For both speed and security reasons, that binary gets prelinked along with all of its active kernel extensions (KEXTs) and the prelinked image is stored in /System/Library/PrelinkedKernels on Intel Macs or the Preboot volume on Apple Silicon Macs. That is the actual image that is loaded upon boot firmware control handoff.