Questions tagged [iokit]

The I/O Kit is a framework for driver development in the xnu Kernel which drives Apple's Mac OSX and iOS operating systems.

The I/O Kit is a framework in the xnu Kernel which drives Apple's Mac OSX and iOS operating systems. It can be used to implement device drivers in kernel space, or in some cases, user space. It can also be used for communicating with drivers from application code.

An introduction to the I/O Kit may be found at http://developer.apple.com/library/mac/#documentation/DeviceDrivers/Conceptual/IOKitFundamentals/Introduction/Introduction.html

502 questions
6
votes
1 answer

Can't get started with kext development in OS X

I'm trying to do Apple's "Kernel Extension" Tutorial. I've created a project file, created the Info.plist, built it, used kextlibs to learn the dependencies, added them to the Info.plist, rebuilt, copied to /tmp, used kextutil to test it. Everything…
digory doo
  • 1,978
  • 2
  • 23
  • 37
6
votes
2 answers

Is libusb the preferred method on Mac OS X to access USB device?

Is libusb the preferred method to talk to a device over USB (using AT commands) on OS X these days? Is there any high level equivalent in cocoa?
stefanB
  • 77,323
  • 27
  • 116
  • 141
6
votes
1 answer

Mac - Virtual Serial Port

I need to create a Cocoa app that will create a virtual serial port available to other apps, meaning registered in the IO Kit Registry. Gist of the app: Create a virtual serial port (listed in /dev and registered with the IOKit…
Stateful
  • 737
  • 2
  • 9
  • 25
5
votes
2 answers

Opening disk device file for write access on Mac OS X

I'm trying to make a subtle modification to the partition table of a disk on the Mac; in particular, I need to change the type of a partition. diskutil doesn't support this, so I can't use it. It works fine (e.g. via a modified gpt command-line…
pmdj
  • 22,018
  • 3
  • 52
  • 103
5
votes
1 answer

Apple DriverKit SDK Camera driver registration

I am new to the Apple DriverKit SDK an i am not clear about how register my device driver so it would be available as a Camera in the OS. Do i have to register a streaming function in the Start function of the IOService? I searched all over the…
Michael
  • 198
  • 7
5
votes
1 answer

How DriverKit driver notify application?

I know how to send data to DriverKit and get back some values, that is application calling IOConnectCallStructMethod() and driver fill the OSData in structureOutput from application. In my Application it is using IOConnectCallAsyncScalarMethod() and…
Vannes Yang
  • 141
  • 6
5
votes
1 answer

Migrating a codeless KEXT to a codeless DEXT

I am migrating a codeless KEXT to a codeless DEXT. I have watched the WWDC video and read much of the information on the Apple Developer site. The difficulty I am having is finding not what to do but how to get started. A nice tutorial with an…
GTAE86
  • 1,780
  • 3
  • 29
  • 39
5
votes
0 answers

IOServiceGetMatchingServices() returns nil hid iterator after hot plugging

I'm maintaining a library for accessing a USB device, which registers itself as an HID device, and enables Mac apps to perform all kinds of nifty stuff (GPIO, I2C, etc). This library can be found…
iljawascoding
  • 1,090
  • 9
  • 20
5
votes
0 answers

How to detect microphone is in use macOS

I would like to know if there any way to detect if microphone is in use on macos system. I would like to achieve that programatically. Code snippet or some references to start on would be appreciated I have read about CoreAudio, would that API be…
RuLoViC
  • 825
  • 7
  • 23
5
votes
2 answers

Is there a battery level did change notification equivalent for kIOPSCurrentCapacityKey on macOS?

I am building a Swift app that monitors the battery percentage, as well as the charging state, of a Mac laptop's battery. On iOS, there is a batteryLevelDidChange notification that is sent when the device's battery percentage changes, as well as a…
TonyStark4ever
  • 848
  • 1
  • 9
  • 24
5
votes
2 answers

How to get list of HID devices in a Swift/Cocoa application?

The following code works perfectly to get a list of connected HID devices: import Foundation import IOKit import IOKit.usb import IOKit.hid private func createDeviceMatchingDictionary( usagePage: Int, usage: Int) -> CFMutableDictionary { let…
chaimp
  • 16,897
  • 16
  • 53
  • 86
5
votes
1 answer

How do I allocate memory buffers which may be reclaimed by the OS for caching in a Mac OS X kernel extension?

Based on documentation and xnu source I've read, I understand that Mac OS X caches file I/O using the Unified Buffer Cache (UBC). The UBC grows as big as it can based on available RAM, but UBC pages are some of the first to be sacrificed when memory…
pmdj
  • 22,018
  • 3
  • 52
  • 103
5
votes
2 answers

sending IOKit command with dynamic length

I'm using IOKit framework to communicate with my driver using IOConnectCallMethod from the user-space client and IOExternalMethodDispatch on the driver side. So far I was able to send fixed length commands, and now I wish to send a varied size…
Zohar81
  • 4,554
  • 5
  • 29
  • 82
5
votes
0 answers

Authenticate macOS App to wake Mac from sleep

I'm looking for a way to authenticate a macOS app that would allow the app to wake the user's Mac from sleep. I'm aware that I can schedule a power event to wake the computer using similar code to what is provided here. When I run the…
mgwiggles
  • 141
  • 5
5
votes
2 answers

USBInterfaceOpen always report kIOReturnExclusiveAccess error

Recently I encountered this problem headachely, I've already spend one week on this issue, but still failed. Hopefully, you can help me to kick this stone away, many thanks. My Problem: Our compony produce USB storage device for iPhone, actually…
FlyingMan
  • 53
  • 3