About the kernel extension load order

This question is about the kernel extension load sequence during the system bootup, I am wondering if there's a method can force a kext e.g A loaded by system before kext B, suppose there's no any dependency between kext A and B.


Any ideas?

Replies

No. Well, you can force the order by using a daemon to manually load the KEXTs in a specific order, but if you’re talking about automatic loading, as done by I/O Kit KEXTs, the canonical way to define an order is via dependencies.

What is the higher-level problem you’re trying to solve here?

ps macOS’s startup sequence is highly asynchronous. You’ll regularly see situations where A has started long before B has finished, where A and B are two things that you might suppose are ordered. For example, A might be

launchd
and B might be various KEXTs. Or A might be
loginwindow
and B might be various daemons. It’s even possible for
loginwindow
to be up and running before all your KEXTs are loaded.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"