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
4 Replies
749 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
Post marked as solved
3 Replies
457 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
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
Post not yet marked as solved
2 Replies
276 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
by
Post not yet marked as solved
1 Replies
261 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
Post marked as solved
3 Replies
1.7k Views
Using a few webcams that worked previously on both M1 and Intel Macbooks, testing out on the new MacBook Pro 2021 and the UVC streams are not showing across apps. Here's my setup Tested the Anker, OBSBot, and an Opal, and not seeing any of them show up on UVC streams E.g. The Anker shows up in System Information > USB but in UVC apps like Zoom, etc it does not show up. Running system_profiler SPCameraDataType -json Returns just { "SPCameraDataType" : [ { "_name" : "FaceTime HD Camera", "spcamera_model-id" : "FaceTime HD Camera", "spcamera_unique-id" : "47B4B64B70674B9CAD2BAE273A71F4B5" } ] }%
Posted
by
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
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
by
Post marked as solved
2 Replies
314 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
Post marked as solved
2 Replies
766 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<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
by
Post not yet marked as solved
0 Replies
275 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
by
Post not yet marked as solved
1 Replies
278 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
Post not yet marked as solved
3 Replies
324 Views
Hi, I am finding that network access is lost from my application when the computer goes to sleep. When I receive kIOMessageSystemWillSleep, I want to send a message to another computer. But I am finding it does not always make it to the other end. Sometimes it only get sent when the computer wakes back up.
Posted
by
Post not yet marked as solved
0 Replies
279 Views
Hi, I'm developing firmware for a USB audio device for which audio playback currently cuts off after about a second. The normal system logs via Console do not seem to throw any error related to USB audio (and nor do kernel-only logs via log stream --process 0). Is there a good way to dive deeper into what might be happening? Looking into the AppleUSBAudio driver, it contains a bunch of verbose "USB Sound assertion (%s) in %s at line %d\n" logs via IOLog(). Are they supposed to end up in the system logs under normal conditions, or does this require setting IOKit debug verbosity in boot-args? New to debugging Mac OS kernel things.. thanks for helping!
Posted
by
Post not yet marked as solved
0 Replies
346 Views
Hello We have a USB camera. My Mac can recognize it and we can get frames with any software. There is a physical button on it and the vendor says the camera is UVC-compliant. But button doesn't work anyway. I captured some USB traffic data and saw that it has two interfaces. One for streaming and other one for interrupting (like button click). I read UVC 1.5 standards to understand it and it is working like written in UVC 1.5. So, I can get a data with an interrupt transfer when clicking the button. I checked these two interfaces, they use UVCAssistant for driver(System Extension). I tried to use libusb, I can get data from button click. But for frames I had to use libuvc, but it wasn't work for my camera (I think it is related with USB descriptor parsing in libuvc). I thought that I should write a driver for single interface and so second interface will use same UVC assistant driver and first interface will use my driver. I wrote a driver and it matches with first interface. But second interface is empty (unhandled by any driver). I want to load UVCAssistant for second interface of USB port. How can I do this? Output before loading my driver After loading: IOKitPersonalities that I used:
Posted
by
Post not yet marked as solved
0 Replies
218 Views
I am playing with IOI2CSendRequest and found a couple things I cannot do with it: E-DDC read of EDIDs that are longer than 256 bytes. This requires a transaction with two sends (one for the segment pointer and one for the offset) with a start bit before each and then the reply preceded by a start bit and ended by a stop bit. IOI2CSendRequest can only do one send and one reply in a single transaction. The E-DDC transaction cannot be split because a second transaction would add an extra stop bit which would reset the segment pointer. A transaction without the offset part works with the GTX 680 or Intel UHD 630 but not with the AMD W5700. DisplayPort DPCD read from DisplayPort device connected to a DisplayPort branch device. This requires a send to the sideband message down request buffer and a reply from the sideband message down reply buffer. This cannot be done with a single IOI2CSendRequest send and reply because the reply is not immediate. I don't think the reply can be polled because I think that is handled by a DisplayPort interrupt and the reply is probably read by the GPU driver and not passed to the user client. Is there a special way to setup the IOI2CRequest to do the above? In the E-DDC case, the i2c handler could maybe suppress the stop bit of the first send after it recognizes that the send is for the segment pointer. In the DisplayPort sideband case, the i2c handler could recognize that the user client wants to get a reply from a sideband message by examining the request sent in the contents of the DisplayPort send buffer, and should therefore queue up the request and wait for the reply. What about M1 Macs? I understand there are some undocumented APIs that people are using to do DDC/CI (MCCS) or to read the EDID but I don't know if they can get more than 256 bytes of the EDID.
Posted
by
Post not yet marked as solved
0 Replies
235 Views
IOHIDDeviceSetReport blocks until the report is sent, and when you call it from the main thread in a situation where more than a couple bluetooth devices are connected (which is often, considering Apple's mice, keyboards and trackpads are all bluetooth) and the system can't keep up with the traffic the report rather frequently never makes it through, resulting in a hanged application and an unresponsive bluetooth HID device that will only respond after being disconnected and reconnected. Is there any way around this situation? Ideally IOHIDDeviceSetReport would timeout An output report failing to get through would not make the HID device unresponsive IOHIDDeviceSetReportWithCallback would work, but it seems under the hood it has simply never been implemented There would be a way to set reports asynchronously but it seems none of those are the case. Does anyone have any light to shed on this matter? macOS12 here.
Posted
by
Post not yet marked as solved
1 Replies
354 Views
I read the doc of installing system extensions https://developer.apple.com/documentation/systemextensions/installing_system_extensions_and_drivers?language=objc , but actually our product is a framework and installed by .pkg. I/O Kit kext is installed by script in .pkg. So I meet a problem :how to install DriverKit dext by script?
Posted
by