Jump to content

Seeking Guidance on Writing Kernel Extensions and macOS Apps


5 posts in this topic

Recommended Posts

To preface, I owe a lot to this online community for teaching me many things about computer hardware, macOS, and operating systems in general. I'm unsure about the future of updates for Intel platforms and what will happen once macOS is no longer supported on Intel Macs. However, the tinkering that I've done has equipped me with fundamental knowledge that I know will remain relevant and useful in the future. I still have a few hardware issues to sort out with my system, but I've now reached a point where I need to write my own code to address them.

 

I'm proficient in several programming languages, including C++, but I lack experience in writing kernel extensions and macOS apps. When researching low-level functions used in third-party kexts, Apple's documentation often seems inadequate for beginners. It typically provides only a function's declaration or, at best, a brief description without proper examples. I'd appreciate some guidance on getting started with the necessary frameworks and determining the appropriate APIs to accomplish specific objectives. Could anyone experienced in this area please share the documentation or resources that helped them get started? I'm hoping I'll then have a better understanding of how to comprehend and contribute to the source code of popular kexts.

Link to comment
Share on other sites

Hi @joevt,

 

Thank you for sharing that archive link! I had no idea there was a "secret" developer webpage with all that classic documentation. I've been struggling with the modern documentation and felt like I was going crazy. It seems like most kernel programming focuses on the IOKit framework. Are there any other frameworks I should look into?

Link to comment
Share on other sites

I'm not really sure. There aren't a lot of frameworks that you can use in the kernel. I suppose it depends on what you want to do in the kernel? There's not much reason to work in the macOS kernel.

 

We have Lilu.kext and WhateverGreen.kext for making kernel patches. I think those are meant to work as far back as Mac OS X 10.4 Intel.

 

DirectHW.kext lets you do kernel related stuff in a user app. It's used with flashrom, pciutils, and LSIUtil. All four of those work in Mac OS X 10.4 and later, PowerPC and Intel.

 

I'ld like to make or port a XHCI and NVMe driver one day for PowerPC Macs. Both of those have been done before for Intel Macs (but the source code for the NVMe kext was not made public so that all has to be recreated using info from documentation and source code from available sample code included with the NVMe documentation or from Linux or UEFI sources).

 

If you have specific objectives, it might help to state some of them here.

 

Link to comment
Share on other sites

  • 3 months later...
 Share

×
×
  • Create New...