The module is amazing and actually kinda terrifying: it grafts in a decent bit of xnu, rather than re-implementing all xnu's features from scratch. This is made a bit more sane because Mach was designed to be extremely portable and has a good abstraction layer for manipulating very low-level stuff like page tables and contexts. But it's still kinda incredible. Part of me wonders if it wouldn't have been easier to graft Linux into xnu instead.
https://github.com/darlinghq/darling-newlkm