I'm pleased to announce that the initial beta of macOS 27.3 (26C5035r) includes our support for software I/O in SCSIControllerDriverKit. The class reference has not yet been updated to include this, but it is described in the release notes:
"SCSIControllerDriverKit now supports software controllers. A software controller declares itself by setting kIOPropertySoftwareIOKey (an OSBoolean, from <IOKit/storage/IOStorageControllerCharacteristics.h>) through UserSetHBAProperties(). The system honors this setting only before controller initialization completes, so it stays fixed for the life of the controller. Such a controller doesn’t create any DMA mappings, and your dext can access the data buffer associated with a particular I/O through the UserCopyDataBuffer API. (182426393) (FB23797269)"
Clearing up a few details on that process:
The property kIOPropertySoftwareIOKey ("Software I/O") is created and set to "false" when IOSCSIParallelInterfaceController is initially created. That means a DEXT can check for software I/O support by using CopyProperties() to look for that key, instead of relying on a system version check or similar side channel check.
The kIOPropertySoftwareIOKey must be set before the controller initialization sequence begins. Changes to the value after that point will fail.
If kIOPropertySoftwareIOKey has been properly set to "true", then fBufferIOVMAddr will be set to NULL. This behavior can be used as additional confirmation that the kernel driver is properly configured.
The deprecation and replacement of UserGetDataBuffer by UserCopyDataBuffer was primarily done to faciliate software I/O controllers. Functionally, the two APIs actually behave identically, however, the name change resolves the analyzer warnings that releasing the returned IOMemoryDescriptor previously caused.
__Kevin ElliottDTS Engineer, CoreOS/Hardware
Topic:
App & System Services
SubTopic:
Drivers
Tags:
SCSIControllerDriverKit
BlockStorageDeviceDriverKit
0
0
53