KEXT not loading in BigSur Public Beta 5

I have a Kernel Extension based on SCSI Architecture Model Family for USB Mass Storage devices which deals with IOSCSIBlockCommandsDevice, IOSCSIPeripheralDeviceType00 and IOBlockStorageService. This driver extends class IOSCSIPeripheralDeviceType00 and its provider class is: IOSCSIPeripheralDeviceNub.


This driver is use to interact with External Storage Device over USB.
This driver works fine and loads in Catalina and earlier versions of macOS without any issue.
But this does not load in Big Sur Public Beta 5 version.


I load the driver post installation using kextload, and driver installation location is: /library/Extension/MyDriver.kext
When driver is loaded with below command and then machine is rebooted, no error is observed but still driver doesn't load:
sudo kextload -v /Library/Extension/MyDriver.kext
sudo kextcache -i /
Note:
Driver and installer pkg is signed with kext developer id and Notarized. SIP is enabled. Xcode v11.5 and 12 Beta 5 also checked. SDK; 14/15 both checked.


I tried loading with kextutil command also and kextutil throws below error:
myimac@myimac-imac Extensions% sudo kextutil -vvvv -bundle-id com.company.xxxxxx.driver
Password:
Defaulting to kernel file'/System/Library/Kernels/kernel'
Executing: /usr/bin/kmutil load --bundle -identifier com.company.xxxxxx.driver
Error: Error Domain=KMErrorDomain Code=1 "Error occurred while building cache:
1: One or more binaries has an error which prevented linking. See other errors.
2: Could not use'com.company.xxxxxx.driver' because: Cannot find symbol for metaclass pointed to by'ZN30comcompanymydriver10superClassE'.Expected symbol'ZN28 IOSCSIPeripheralDeviceType00 10gMetaClassE' to be defined in another kext
com.company.xxxxxx.driver specific:
1: Cannot find symbol for metaclassSS pointed to by'EZNportable Expected to by'EZN10superClassE'. _ZN28IOSCSIPeripheralDeviceType0010gMetaClassE' to be defined in another kext
"UserInfo={NSLocalizedDescription=Error occurred while building cache:
1:One or more binaries has an error which prevented linking . See other errors.
2: Could not use'com.company.xxxxxx.driver' because: Cannot find symbol for metaclass pointed to by'ZN30com
company_mydriver10superClassE'. Expected symbol'ZN28IOSCSIPeripheralDeviceType0010gMetaClassE' to be defined in another kext
com.company.xxxxxx.driver specific:
1: Cannot find symbol for metaclass pointed to by'ZN30com.company.xxxxxx.drive10superClassE'. Expected symbol'ZN28IOSCSIPeripheralDeviceType0010gMetaClassE' to be defined in another kext
}


Could not understand what's the error.
When driver is copied/installed to location: /Library/Extension/
user approval pop up does not come, which asks user to approve the kext in the System Preferences Security pane.
This is weird because this is required to work third party kext in BigSur.


So my question is:
What classes of kexts are deprecated??
Does System Extension and DriverKit support to send SCSI command to USB External storage??

Thread
(https://developer.apple.com/forums/thread/650611) discussion concludes that:
There is no support for IOSCSIArchitectureModelFamily classes like IOSCSIProtocolInterface in DriverKit yet. Support will be added in a future release.


Does it mean that KEXT of these types will be allowed in Big Sur till Driverkit support is added??
If yes then why my driver is not loading and if No then how to port KEXT using IOSCSIProtocolInterface to user space IOUSBInterfaceInterface??
If someone have pointers on how to resolve this issue, It would be helpful.
(I'll test this driver with SIP disabled too and will update)
Thanks You!!!
Answered by Akira.H in 634196022
Our kext now works on Big Sur Beta 7.

I also have same problem.
Our kext had been worked fine until beta 2, but beta 3 couldn't load.

The Big Sur release note says that the exported symbols were changed and you need build your kext with each beta of Big Sur.
I rebuild it on beta 5 but the problem was not resolved.

Xcode 12 Beta 5 Release Notes

Symbols exported by both xnu and Apple kernel extensions will change. Recompile your kernel extension with each update to macOS Big Sur 11 beta to ensure compatibility. (64262563)





We see the same issue on Big Sur beta 5 with a kext that extends class IOSCSIPeripheralDeviceType00:

Expected symbol 'ZN28IOSCSIPeripheralDeviceType0010gMetaClassE' to be defined in another kext
Did someone test in Big Sur Beta 6 release??
I tested my kext but no luck :(

I tested in Big Sur beta 6, and it didn't work fine.
Accepted Answer
Our kext now works on Big Sur Beta 7.

Our KEXT also now working in Big Sur Beta 7.
Also I tested in Beta 8 today and it's loading. :)

BTW any idea what's alternative for IOSCSI Architecture Model Family in DriverKit??
Can we use USBDriverKit, IOUSBHostInterface and BOT??

Our KEXT also now working in Big Sur Beta 7.

Yay!

any idea what's alternative for IOSCSI Architecture Model Family in
DriverKit?

It’d be best to put that question in a new thread.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
I am having a similar problem to this in macOS 11 beta 9, but with "Failed to bind '__ZN9IOBDMedia9metaClassE'". That symbol does seem to be in the system kext though

Code Block
# nm -gU /System/Library/Extensions/IOBDStorageFamily.kext/Contents/MacOS/IOBDStorageFamily | grep "ZN9IOBDMedia9metaClassE"
0000000000003d50 S ZN9IOBDMedia9metaClassE


p.s. the forum seems to convert underscores to underlines inside code blocks.

p.s. the forum seems to convert underscores to underlines inside code
blocks.

Indeed. This is a known bug, alas (r. 66512566).

Share and Enjoy

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

Our kext now works on Big Sur Beta 7.

Great!

I'm asking in another thread (https://developer.apple.com/forums/thread/662896) and I've built a KEXT that uses IOSCSI and confirmed it works on macOS 11 Beta 9. KEXT is loaded, but macOS crashes when I call the KEXT API from application.

I build KEXT using Xcode 12.2 beta2 on macOS 11 beta 9, but please let me know if there is anything else I need to be aware of.

Note:KEXT and installer pkg is signed with kext developer id and Notarized.
KEXT not loading in BigSur Public Beta 5
 
 
Q