Gain user-space access to hardware devices and drivers using IOKit.

IOKit Documentation

Posts under IOKit tag

52 Posts
Sort by:
Post not yet marked as solved
1 Replies
277 Views
We are implementing a Sample Partition Scheme driver. this is the info.plist <key>IOKitPersonalities</key> <dict> <key>SamplePartitionScheme</key> <dict> <key>IOKitDebug</key> <integer>0</integer> <key>IOProbeScore</key> <integer>80000</integer> .... <key>IOProviderClass</key> <string>IOMedia</string> <key>IOPropertyMatch</key> <dict> <key>Whole</key> <true/> </dict> </dict> </dict> our driver match a whole disk IOMedia, If it's our disk, perform read/write on this disk. When we test our driver in macOS12. if the IOMedia is a blank RAW disk, our driver will be loaded at boot time. if the IOMedia has partitions, system partition scheme driver will be loaded at boot time. Pluging in a GUID partition disk on a booted Mac always load our kext. how can our driver match GUID partition disks and load at boot time?
Posted
by hsong.
Last updated
.
Post not yet marked as solved
8 Replies
2.2k Views
Hi, allAccessing USB device on MAC OSX platform, the “App Sandbox”=YES and”com.apple.security.device.usb”=YES Must be increased to entitlents file.How to Implement USB Access in iOS Platform?
Posted Last updated
.
Post not yet marked as solved
9 Replies
2.0k Views
The following code sequence works on Catalina and on Intel Big Sur devices, it does not work on the new Apple M1 devices running Big Sur. CFMutableDictionaryRef matching = IOServiceMatching("IODisplayConnect"); io_iterator_t iter = 99; kern_return_t err = IOServiceGetMatchingServices( kIOMasterPortDefault, matching, &iter ); The "matching" variable seems valid: matching CFMutableDictionaryRef 1 key/value pair [0] "IOProviderClass" : "IODisplayConnect" &#9;&#9;key __NSCFConstantString * "IOProviderClass" &#9;&#9;value __NSCFString * "IODisplayConnect" The call to "IOServiceGetMatchingServices" sets the "iter" value to 0. If I use another class name in the "IOServiceMatching" call, say "IOMediaBSDClient", "IOServiceGetMatchingServices" returns a valid iterator. Would Big Sur on Apple M1 devices need additional calls, or has this service class been deprecated? Using "IODisplayConnect" allows me to get display information via "IODisplayCreateInfoDictionary". Suggestions...
Posted Last updated
.
Post not yet marked as solved
1 Replies
406 Views
I have implmented the IOMedia Filter driver without content hint for MAC OS Mojave. The driver gets loaded successfully for the IOMedia objects with IOPropertyMatch as "Whole". I could filter the IO requests at the disk layer successfully. This works very well for RAW and formatted disk. The disk I am using here is external SSD device attached to MAC laptop using Thunderbolt-3 interface. I see the driver is getting loaded when I plug-in the TB3 cable. In this case the driver is able to filter the IO requests. If the disk is formatted with the HFS+ Filesystem then I see the filesystem content too. I am facing an issue when I keep plug-in the TB3 cable and reboot the laptop. I have kept the kext files in "/System/Library/Extensions" directory. There are two scenarios to consider, either disk is RAW or Formatted with the HFS+ Filesystem. The scenario 1 is working as expected, but in second scenario the driver is not able to detect the disk. Scenario 1: RAW Disk (Working well) Attached RAW disk through TB3 cable to laptop Reboot the laptop I see the driver is loaded and filter the IO requests successfully. Scenario 2: Disk formatted with HFS+ Filesystem (Failed to load driver) Attached HFS+ Filesystem disk through TB3 cable to laptop Reboot the laptop I see the driver failed to detect the disk &lt;&lt;&lt;=== FAILED But MAC OS detected the HFS+ filesystem on the disk In Scenario 2, after reboot the filter driver seems to be getting loaded, but not able to detect the disk. It seems the MAC OS FS driver is detecting formatted disk before the filter driver. But if I plug-out the disk and plug-in again, I see the filter driver detects disk and start filtering IO requests. I think this could be because of driver loading order during boot time, but I am not sure. The filter driver should detect the disk before MAC OS FS driver detect the formatted disk. Thats the reason may be the filter driver failed to detect the disk after reboot. I am out of ideas what can be done to resolve this issue. Do you think it is driver load order issue? How can we manage the driver load order in MAC OS? Can anybody please help me to resolve this issue? Thanks in advance.
Posted Last updated
.
Post not yet marked as solved
0 Replies
274 Views
We developed a bluetooth keyboard with classical bluetooth, and used usage page 0x01 and usage 0x03 for OTA firmware update, and I wrote an appliction on Windows 10 and everything works as expect. I am trying to wrote same application on macOS Big Sur 11.6.1 with XCode 13.2.1, but I found that DeviceMatchingCallback was triggered only once with usage page 0x01 and usage 0x06, which is keyboard usage page/usage pairs, any other usage page/usage pairs such as 0x01/0x03, 0x0C/0x01 didn't trigger DeviceMatchingCallback. So my question is: can customize usage page/usage of bluetooth hid be accessed by application?
Posted Last updated
.
Post not yet marked as solved
1 Replies
1.2k Views
I need to try to make an embedded scanner AirScan/eSCL compatible. This is a tiny sheetfeed scanner. I have most of the work done, but I am havng issues with the final message exchanges just before the client GETs the scanned image.I can easily enough initiate the scan up to the point of sending 201 Created location URI from there it gets foggy as I have seen AirScan/eSCL Clients that all seem to behave differently. I can make it work in Vuescan but Vuescan does not come back to check ScannerStatus again , it just initiates the download based on header information froj 201 Created and Location: URI.It is specifically this point after sending 201 Created and location URI headers where things are falling apart for me on OSX Mojave.I have seen that OSX mojave requests ScannerStatus again before download but have no idea whet it is looking forI have identified several status messages but not sure even which one applies when the scan is actually ready for download or already downloaded.No matter what I can not seem to make OSX Mojave happy. I figure if I can make it work on Mojave it will probably work on iOS .If anyone has any wireshark traces from a successful scan that may be helpful too. I have a scanner in another city that I was remotely working with but problems with WiFi card not allowing me to see all the traffic on the network so I can see messages to/from real AirScan compatible HP multi function device.Also looking for info on how to identify correctly a SINGLE sheet feeder scanner to OSX, not a flatbed with ADF option .ThanksMark
Posted
by markosjal.
Last updated
.
Post marked as solved
2 Replies
763 Views
Good day! I'm interested in if there is any way to query CPU/GPU/Battery temperature values on recent iOS systems? I've tried to search forums for "cpu temp", "ios temperature", "battery temperature" etc., but didn't find anything. There was only mentioned some old private API which was supposed to work somehow for iOS&lt;10. All the examples I've found didn't even compile. All the requests and suggestions are pretty old and seems irrelevant. So I decided to bump this topic. Are there any updates? Any hints and suggestions are highly appreciated! Best regards!
Posted Last updated
.
Post marked as solved
2 Replies
313 Views
It’s quite easy to detect if Mac has an illuminated keyboard with ioreg at the command line… ioreg -c IOResources -d 3 | grep '"KeyboardBacklight" =' | sed 's/^.*= //g' …But how can I programmatically get this IOKit boolean property using the latest Swift? I’m looking for some sample code.
Posted
by rakic.
Last updated
.
Post not yet marked as solved
4 Replies
3.5k Views
The DDC/CI application can work well on MacbookPro/Mac Pro (Big Sur), but it doesn't work on M1 Mac (both macOS 11.0.1 and 11.1). M1’s graphics card is Apple, not Intel or AMD. Does this incompatible issue relate with new graphics card or kernel change? Any alternative solution for M1?
Posted Last updated
.
Post not yet marked as solved
0 Replies
340 Views
I'm developing an application in Objective C that works on vendor specific commands of SD cards using IOUSBHostPipe. These vendor SCSI passthrough commands are working fine. But when I try to issue a SCSI write(10) command, it seems to hang. The same implementation when done on Windows seems to be working fine. Is there a limitation to issuing a SCSI write(10) command in macOS? I'm a bit new to the macOS environment and would really appreciate some pointers to references that I can look into or any alternatives to this problem. Thanks in advance. Much appreciated :)
Posted Last updated
.
Post not yet marked as solved
1 Replies
352 Views
We are a company that produces SmartCard readers and cryptographic tokens. When we started testing our devices on macOS, we realized that it is necessary to add our products to the macOS ICCD driver, so that the operating system will recognize our devices natively. We believe there is a list with information about manufacturers (name, VendorID, ProductID) and we would like to add data from our company so that our devices are recognized as trusted by the macOS operating system. If anyone knows the correct process for this, please let us know.
Posted
by Rafael123.
Last updated
.
Post not yet marked as solved
2 Replies
1.6k Views
Hi,I'm working with USB Midi devices on iOS apps, and I'm currently looking for a way to identifiy them.I know for a fact that getting the different MIDI properties with CoreMIDI API is not sufficiently reliable, as some devices return only generic information like "USB MIDI DEVICE" but are nonetheless recognized by other apps.After some research, it appears that the the best solution is to get the USB-ID of the device (VID-PID : vendor ID and product ID). My question is the following : How can I get the USBID of a USB MIDI device on iOS? The IOKit API is not available on iOS, so what is the solution to access USB devices on iOS?Thank you all for the attention,Best,Thomas
Posted Last updated
.
Post not yet marked as solved
5 Replies
997 Views
I can’t get USB bsdname from macOS Monterey 12 Bate4 of Intel processor: I have use the "IORegistryEntrySearchCFProperty" function to get the bsdName of the io_service_t, It worked fine on macOS Big Sur's M1 and Intel MBP. Also it worked fine on macOS Monterey App M1. But it always returned nil on macOS Monterey Intel MBP. It involves the following code: void getBsdName(io_service_t usbDevice) { CFStringRef bsdName = NULL;         for(int i = 0; i &lt; 500; i++)         {             bsdName = (CFStringRef)IORegistryEntrySearchCFProperty(usbDevice,                                                                    kIOServicePlane,                                                                    CFSTR( kIOBSDNameKey ),                                                                    kCFAllocatorDefault,                                                                    kIORegistryIterateRecursively );             if(!bsdName) {                 // If don't get a bsd name, keep waiting in 5s.                 usleep(10000);                 continue;             }                          printf("[%s]: Found bsd name for device %d.\n”, __func__, usbDevice);             break;         } } Why it happened? Or is there another way to get it?
Posted Last updated
.
Post not yet marked as solved
1 Replies
260 Views
I need your help. Now I need to send SCSI commands to the Usb mass storage device, I referred to https://developer.apple.com/library/archive/documentation/DeviceDrivers/Conceptual/WorkingWithSAM/WWS_SAMDevInt/WWS_SAM_DevInt.html url, but it didn't work. I can't get scsitaskdeviceinterface       I think my device type is $00, do we need to develop and provide a custom kernel driver? If needn't, why can't I access the device through the scsitaskdevice interface?          I am using macOS Big Sur 11.2.3 and Xcode 12.5.
Posted
by Ada1.
Last updated
.
Post not yet marked as solved
2 Replies
274 Views
I'm working on ios app with iot, i have following questions regarding: I want to fetch "Battery Temp, Voltage, Current, Percentage, Charging State, Battery Capacity, Charging count, Incoming Calls, UUID, Phone Model, Phone Manufacture in Swift? We have class in objective c - UIDeviceListener, But its comes under IOKit framwork - if you want to submit an app using IOKit framework is risky because I red Apple may not allow that, Then Swift has UIDevice, but its providing limited information, what is alternate solution or workaround for this?
Posted Last updated
.
Post not yet marked as solved
0 Replies
251 Views
I would love the ability to enable Tiled display topology as shown in the latest Oct 20th event. 46min and 19sec in.
Posted
by hphase.
Last updated
.
Post not yet marked as solved
4 Replies
1.3k Views
Is there any way to read EDID data in new Apple M1 devices since the below code snippet does not work in M1 machines however it works in Intel based Mac. io_object_t object = -1;       io_iterator_t iterator;     CFMutableDictionaryRef matching = IOServiceMatching("IODisplayConnect");     kern_return_t kernResult = IOServiceGetMatchingServices(kIOMasterPortDefault, matching, &amp;amp;iterator);       if (KERN_SUCCESS == kernResult &amp;amp;&amp;amp; iterator != 0) {           object = IOIteratorNext(iterator);           while (object != 0) {               CFDictionaryRef dict = IODisplayCreateInfoDictionary(object, kIODisplayOnlyPreferredName);       /*        process data here        */               object = IOIteratorNext(iterator);     }     IOObjectRelease(iterator);   } Also tried replacing "IODisplayConnect" by "IODPDevice" but still get an empty iterator.
Posted Last updated
.
Post not yet marked as solved
4 Replies
748 Views
Firstly let me start by saying I'm totally new to using IOKit and fairly new to Swift. That said, I've successfully managed to detect the insertion and removal of my USB serial device in my Swift, MacOS app. Therefore calling ls /dev/tty.* lists the same devices as via the IOServiceAddMatchingNotification(notifyPort, kIOFirstMatchNotification, IOServiceMatching("IOSerialBSDClient"), matchingCallback, selfPtr, &matchedIterator) call inside the resulting callback. This is a great start. As you can imagine telling the user you've found "/dev/tty.usbmodem[some number]" isn't particularly user friendly. So once I retrieve the IODialinDevice property from the aforementioned callback is there a way for me to lookup the USB device's Vendor ID and Product ID and ideally retrieve the human readable name for said USB device, so I can then expose that to the User? Thanks.
Posted
by domaal.
Last updated
.
Post marked as solved
3 Replies
456 Views
I'm currently working with IOKit on Mac (I'm new to it, but managed to get a Serial USB demo working) and noticed that it says that IOKit is Mac Catalyst 13.0+ compatible. But when I import IOKit into my iOS Swift project. I'm getting a No such module 'IOKit' error. Do I have to manually add this framework? I read somewhere that IOKit access may not be possible on iOS/iPad devices, if I released my app on the App Store, but what about internal home or company iOS devices, that won't ever be released on the App Store?? Thanks.
Posted
by domaal.
Last updated
.