The developers of macOS and iOS have made available the source code for the kernel of iOS 12 and macOS 12.14. FreeBSD code can be found within the operating system, in combination with the Mach kernel. You can download it here.
XNU kernel is part of the Darwin operating system for use in OS X and iOS operating systems. XNU is an acronym for XNU is Not Unix. XNU is a hybrid kernel combining the Mach kernel developed at Carnegie Mellon University with components from FreeBSD and C++ API for writing drivers called IOKit. XNU runs on I386, X86_64 for both single processor and multi-processor configurations.
Apple Open Source: https://opensource.apple.com/