kext load timing issue

I have a kernel extension for SCSIPeripheral devices using IOKitPersonalities.

Pluging in a matching device on a booted Mac always load the kext. However, on some configurations (especially with macOS 10.15.4) if the device is already plugged in when booting up the Mac, the kext will not be loaded. The phenomenon always happen on a Mac presenting the issue. However on other Mac even with OS version 10.15.4 the phenomenon never appears.

I am not sure where the issue reside, I am presuming that it is a timing issue with the device being matched before my kext is loaded (maybe on Mac with a lot of kext being loaded?).

If someone have pointers on how to resolve this issue, I would be glad to hear about it.

Thank you !

In the I/O Registry, do you see some other driver matched to the SCSI nub?

Share and Enjoy

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

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

Yes, the standard macOS driver is matching the nub.

What value do you have for

OSBundleRequired
?

Share and Enjoy

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

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

WWDC runs Mon, 22 Jun through to Fri, 26 Jun. During that time all of DTS will be busy with conference duties.

Sorry for the delay, I was confused by the change of the forum. I have "Local-Root" as the value (string) of OSBundleRequired
Hmmm, that should be sufficient for you to get into the pre-boot image and thus be involved in initial matching. Honestly, I’m not sure what’s going on. My best suggestion at this point is that you open a DTS tech support incident and discuss this with our I/O Storage Family expert.

Share and Enjoy

Quinn “The Eskimo!” @ DTS @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"

WWDC runs Mon, 22 Jun through to Fri, 26 Jun. During that time all of DTS will be busy with conference duties.
Thank you for your time and suggestions.
This is new behavior with macOS 10.14 and only occurs when SIP is enabled. At boot time, 3rd party drivers are prevented from loading. This restriction stops 30 - 45 seconds after startup. I assume this is done, by design, to keep malicious drivers from snooping on access to the boot device.
It sounds like the behavioral difference you are seeing is related to macs that have a T2 security chip. These macs support Secure Boot, which helps Apple ensure that only a legitimate, trusted operating system loads at startup.

On macs with Secure Boot enabled, the system boots from a file that has been built and signed by Apple. Your driver will not be able to match on a device that is serviced by a driver in this boot artifact. It looks like the OSBundleRequired key in you personality indicates that you want to be able to use your driver to support the local root volume. This isn't a supported operation on T2 macs with Secure Boot enabled.

On macOS Catalina and earlier, you can disable Secure Boot and rebuild the prelinkedkernel using kextcache to allow your kext to match on a device in early boot. Starting in Big Sur, it is no longer possible to do this.

If you are looking to simply have your device matched at boot (and don't need to boot the OS from a device supported by your driver), then there may still be a driver matching issue. We have made significant changes to the way booting and kext loading works in Big Sur. I would highly recommend downloading the beta and seeing if your kext behaves the way you expect on macs with a T2 security chip.

Please file a bug report and post the Feedback ID here!
I am having this same problem when trying to get a third party kext to load during the boot process. I also am using "Local-Root" for the value of OSBundleRequired. Instead of loading my kext, macOS loads a builtin (native) kext that also matches my device. I am running macOS 10.15.7 (19H114) on a MacBook Pro (16-inch, 2019).

In the reply from Systems Engineer they say

If you are looking to simply have your device matched at boot (and don't need to boot the OS from a device supported by your driver), then there may still be a driver matching issue.

What settings in the Info.plist of my kext will make it possible for my kext to match with my device at boot?



kext load timing issue
 
 
Q