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

IOKit Documentation

Posts under IOKit tag

52 Posts
Sort 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 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
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 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 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
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
Post not yet marked as solved
2 Replies
275 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
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 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
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
1 Replies
245 Views
I have a digital multimeter that logs data to computer through USB serial. After upgrade to Big Sur it suddenly stopped working. IOKit properly detects device connect/disconnect and HID reports are coming in, but with no data. HID report contains nothing but zeroes... I'm stuck and in need of help. Have anything changed in IOKit.hid interface between 10.15 and 11?
Posted
by
Post not yet marked as solved
1 Replies
363 Views
iOS version is14.2.1(18B121) dyld: Library not loaded: /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit  Referenced from: /private/var/containers/Bundle/Application/27933966-3944-4FF9-907F-2C69CE0EDA4E/.app/  Reason: image not found dyld: launch, loading dependent libraries DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib:/Developer/Library/PrivateFrameworks/GPUTools.framework/libglInterpose.dylib:/usr/lib/libMTLCapture.dylib
Posted
by
Post not yet marked as solved
0 Replies
501 Views
I've done extensive reading on this, but I'm still stumped. I'm trying to call USBInterfaceOpen for a USB Device that I need direct read/write access to, but I get an exclusive access error. There seem to be 2 possibilities here: 1) use the HID interface or 2) do a codeless kext to get to the device before OS X's HID Manager does. So possibility 1 is not going to work, it's not recognized as a storage or network device and nothing is created in the /dev tree that would allow standard POSIX calls. And possibility 2 is not going well. Apple seems to have really locked things down, and I get "Bad code signature" errors when loading trying to load my codeless kext (with just a .plist): Authenticating extension failed: Bad code signature" UserInfo={NSLocalizedDescription=Authenticating extension failed: Kext com.blackrock.cerestim v1.0.0 in codeless kext bundle com.blackrock.cerestim at /private/var/db/KernelExtensionManagement/Staging/com.blackrock.cerestim.ohqHdy/Cerestim.kext: I am really stuck. Is there any simple way of preventing an HID takeover of this device?
Posted
by
Post not yet marked as solved
2 Replies
411 Views
is there any cocoa API available using which we can get below details of physical memory? Able to get this data using system_profiler SPMemoryDataType but looking for API instead of command since this command do not return all above data for Apple M1 machine.
Posted
by
Post not yet marked as solved
2 Replies
522 Views
I have a driver that was written with IOKit. It works fine on BigSur with an Intel Processor. It is compiled as a universal binary. Each time I try to use kextload to load the kext, the machine crashes with the following.... panic(cpu 5 caller 0xfffffe001e0b9320): Break 0xC470 instruction exception from kernel. Ptrauth failure with IA key resulted in 0xbffffe001cbc0630 at pc 0xfffffe001df2a5d4, lr 0x0addfe001df2a548 (saved state: 0xfffffe306b8c34e0)  x0: 0xfffffe306b8c3860 x1: 0x0000000000000000 x2: 0x0000000000000000 x3: 0xfffffe306b8c3890  x4: 0x0000000000000000 x5: 0x0000000000000000 x6: 0x00626778632e7265 x7: 0x0000000000000d80  x8: 0x000000000000000c x9: 0xfffffe0020892df8 x10: 0x00000000016a016a x11: 0x0000000000000001  x12: 0x00000000016a016a x13: 0x000000000000016a x14: 0xfffffe16669f5448 x15: 0x00000000016a016b  x16: 0xbffffe001cbc0630 x17: 0xfffffe001cbc0630 x18: 0x0000000000000000 x19: 0xfffffe233197ee60  x20: 0x0000000000000001 x21: 0x0000000000000001 x22: 0x8a8afe001cbc0630 x23: 0xfffffe001cb90000  x24: 0xfffffe001d88d971 x25: 0xfffffe001cb88000 x26: 0x0000000000000006 x27: 0x0000000000000006  x28: 0xcda1fe233197ee60 fp: 0xfffffe306b8c38f0 lr: 0x0addfe001df2a548 sp: 0xfffffe306b8c3830  pc: 0xfffffe001df2a5d4 cpsr: 0x80401208    esr: 0xf200c470     far: 0xfffffe30193c4000 Debugger message: panic Memory ID: 0x6 OS release type: User OS version: 20G80 Kernel version: Darwin Kernel Version 20.6.0: Wed Jun 23 00:26:27 PDT 2021; root:xnu-7195.141.2~5/RELEASE_ARM64_T8101 Fileset Kernelcache UUID: E46841F89DC3FD7ACEC6F404AC995579 Kernel UUID: AC4A14A7-8A8E-3AE6-85A6-55E6B2502BF9 iBoot version: iBoot-6723.140.2 secure boot?: YES Paniclog version: 13 KernelCache slide: 0x0000000015c9c000 KernelCache base: 0xfffffe001cca0000 Kernel slide:   0x00000000167e4000 Kernel text base: 0xfffffe001d7e8000 Kernel text exec base: 0xfffffe001d8b4000 mach_absolute_time: 0xc434196c Epoch Time:    sec   usec  Boot  : 0x610c5768 0x00000e2f  Sleep : 0x00000000 0x00000000  Wake  : 0x00000000 0x00000000  Calendar: 0x610c57eb 0x000ebce6 CORE 0 recently retired instr at 0xfffffe001da26d6c CORE 1 recently retired instr at 0xfffffe001da26d6c CORE 2 recently retired instr at 0xfffffe001da26d6c CORE 3 recently retired instr at 0xfffffe001da26d6c CORE 4 recently retired instr at 0xfffffe001da26d70 CORE 5 recently retired instr at 0xfffffe001da256a4 CORE 6 recently retired instr at 0xfffffe001da26d70 CORE 7 recently retired instr at 0xfffffe001da26d70 CORE 0 PVH locks held: None CORE 1 PVH locks held: None CORE 2 PVH locks held: None CORE 3 PVH locks held: None CORE 4 PVH locks held: None CORE 5 PVH locks held: None CORE 6 PVH locks held: None CORE 7 PVH locks held: None CORE 0: PC=0xfffffe00205f0ff0, LR=0xfffffe00205c3c10, FP=0xfffffe3097d5b440 CORE 1: PC=0xfffffe001da1cadc, LR=0xfffffe001db463c4, FP=0xfffffe3097e3b690 CORE 2: PC=0xfffffe001d92da64, LR=0xfffffe001d92da5c, FP=0xfffffe309978bee0 CORE 3: PC=0xfffffe001d92da64, LR=0xfffffe001d92da5c, FP=0xfffffe3097d3bee0 CORE 4: PC=0xfffffe001d92da64, LR=0xfffffe001d92da5c, FP=0xfffffe3097e2bee0 CORE 5 is the one that panicked. Check the full backtrace for details. CORE 6: PC=0xfffffe001d92da64, LR=0xfffffe001d92da5c, FP=0xfffffe3097e1bee0 CORE 7: PC=0xfffffe001d92da64, LR=0xfffffe001d92da5c, FP=0xfffffe3097a2bee0 Panicked task 0xfffffe1667fe1b70: 1825 pages, 3 threads: pid 101: kernelmanagerd Panicked thread: 0xfffffe166a254000, backtrace: 0xfffffe306b8c2bf0, tid: 11112  lr: 0xfffffe001d902b68 fp: 0xfffffe306b8c2c60  lr: 0xfffffe001d90294c fp: 0xfffffe306b8c2cd0  lr: 0xfffffe001da2c1c8 fp: 0xfffffe306b8c2cf0  lr: 0xfffffe001da1d674 fp: 0xfffffe306b8c2da0  lr: 0xfffffe001d8bb7e8 fp: 0xfffffe306b8c2db0  lr: 0xfffffe001d9025dc fp: 0xfffffe306b8c3140  lr: 0xfffffe001d9025dc fp: 0xfffffe306b8c31b0  lr: 0xfffffe001e0b4e80 fp: 0xfffffe306b8c31d0  lr: 0xfffffe001e0b9320 fp: 0xfffffe306b8c3340  lr: 0xfffffe001da1fa50 fp: 0xfffffe306b8c3410  lr: 0xfffffe001da1d9b8 fp: 0xfffffe306b8c34c0  lr: 0xfffffe001d8bb7e8 fp: 0xfffffe306b8c34d0  lr: 0xfffffe001df2a548 fp: 0xfffffe306b8c38f0  lr: 0xfffffe001df2b898 fp: 0xfffffe306b8c3970  lr: 0xfffffe001df30d14 fp: 0xfffffe306b8c39f0  lr: 0xfffffe001df3eaf4 fp: 0xfffffe306b8c3a50  lr: 0xfffffe001df41650 fp: 0xfffffe306b8c3af0  lr: 0xfffffe001df5ce24 fp: 0xfffffe306b8c3b80  lr: 0xfffffe001d967e0c fp: 0xfffffe306b8c3bd0  lr: 0xfffffe001d9082b0 fp: 0xfffffe306b8c3c40  lr: 0xfffffe001d8df960 fp: 0xfffffe306b8c3cc0  lr: 0xfffffe001d8f86f8 fp: 0xfffffe306b8c3d70  lr: 0xfffffe001da11ffc fp: 0xfffffe306b8c3e40  lr: 0xfffffe001da1d6f0 fp: 0xfffffe306b8c3ef0  lr: 0xfffffe001d8bb7e8 fp: 0xfffffe306b8c3f00 last started kext is my kext, which makes sense. Anyone seen this before and been successful in debugging it? Thanks
Posted
by
Post not yet marked as solved
1 Replies
575 Views
Hi, i am working on a swift package library that gets information about all the disks connected to the mac and displays it organised into a tree structure, including the non-mounted storage devices attached to the machine. My question is how can i get informations about unmounted devices like: The amount of free space (when possible) of a partition or an APFS container The space occupied by a single APFS volume I am already using a combination of IOKit and Disk Arbitration for my library and i don't see this information anywhere in those frameworks, including the description dictionaries provided by Disk Arbitration. Instead the terminal command diskutil info -plist [volume/partition BSD name here] gives me this info, but i can't just use it's output in my swift program (and obtaining it via a process object for example) since it doesn't work with the app sandbox, so i am looking for a sandbox-friendly way using just the API. I hope you can help me figure this out, really any help is appreciated, thank you for your attention.
Posted
by
Post not yet marked as solved
1 Replies
503 Views
Hi, i have made some code in Swift that allows me to get a list of the storage disks and the relative partitions present in a mac (everything made using the IOKit api), this of course includes the APFS containers that are managed by the OS as separate storage devices. To have a proper representation of the partitions tree in my code i need to know which are the actual partitions housing a given APFS container. I have tried to look for this information on documentation and on the internet, then into the IORegistry (using the registry explorer app) and searching for this info into the description dictionaries provided by Disk arbitration but so far no luck, even by comparing the UUIDs. In IORegistry explorer in the IOService plane I can also see that the APFS Container in my mac's ssd is listed as a sub-node of it's physical storage a partition, but since i am using an IOIterator object to scan the IORegistry i have no idea of how i should look into sub-nodes for a given node. Also i think that some particular storage configurations might have an APFS container split across multiple physical storage devices, in fact the diskutil list -plist command shows the physical store for each APFS containers as an array in the plist output, so the child approach might not be effective there. So how can i do this? I am doing all of this stuff because i am working to a sandbox-friendly open source swift package for macOS apps to easily get a complete tree structure of disks and partitions, in a similar fashion to the above mentioned diskutil list -plist command, my goal is actually to have the exact same structure provided by that command, with the same info.
Posted
by
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 < 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?