iokit

Gamepad code on OS X: Buh?

I thought I was a decent programmer until I tried writing gamepad code for OS X. Now I feel deeply useless. Does anyone know of any code that I can legally use in my (non-free) game? Is it really this hard to talk to a gamepad on OS X? What am I missing? ...

Detecting appearance/disappearance of volumes on osx

I want to update a list of storage devices as the user inserts USB keys, adds external disks and mounts disk images. IOKit's IOServiceAddInterestNotification looks like the way to go, but the obvious use of registering general interest in kIOMediaClass only gives you notifications for unmounting of volumes and then only sometimes. What'...

Distinguishing between HFS+ and HFS Standard Volumes

IOKit and the DiskArbitration framework can tell me a lot of things about mounted volumes on a mac, but they don't seem to be able to differentiate between HFS+ and HFS Standard volumes. The IOKit/DA keys Content, DAVolumeKind and DAMediaContent are always Apple_HFS and hfs for both HFS Standard and HFS+ volumes. diskutil and DiskUtil...

Accessing I/O Catalog Class Objects

Hi there, I'm developing an OS X kernel extension (kext) that will be used as an I/O Kit driver. This driver, however, will be strictly "virtual"; it will not interface with any hardware. OS X keeps a catalog (I/O Catalog) of all the drivers that are loaded into the kernel. It also keeps a registry (I/O Registry) containing the I/O Cat...

How can I get the icon for a storage device in Mac OS X?

I've found my devices using IOServiceGetMatchingServices and got the property dictionary like this: kernResult = IORegistryEntryCreateCFProperties(nextMedia, (CFMutableDictionaryRef *)&props, kCFAllocatorDefault, 0); From that dictionary I can extract the informations f...

how to dump (print) an OSDictionary to the console / log?

I would like to inspect the contents of an OSDictionary from my kext. is there a convenient way to print the contents to system.log or similar? (ala CFShow()) ? thx->adv, |K< ...

com.apple.Dont_Steal_Mac_OS_X

com.apple.Dont_Steal_Mac_OS_X is a IOResources provider... Class Inheritance: Dont_Steal_Mac_OS_X : IOService : IORegistryEntry : OSObject how does it work? what does it do? thx->adv() |K< ...

FireLog: proper installation...

I have installed the firewiresdk26 on my dev mac... and in the Tools/ directory is FireLog. I have run the FireLog 2.0.0.pkg installer on my dev mac, but the payload it deploys is installed in my /System/Library tree, as opposed to my /Developer/SDKs tree. so when I try to include the header iokit/firewire/FireLog.h it does not get found...

Simulate USB insertion on OSX via software

How can I inject USB device nodes into OSX (>= 10.5) such as you might be able for debugging USB handlers / writing new USB drivers? I'm interested in this in order to handle non-USB devices using TokenD. From what it looks like, I would have to tackle faking USB-device insertion and then create a PC/SC ifdHandler that would handle thi...

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? ...

Where can I systematically study how to write Mac OS X device drivers?

I'm looking for an exhaustive, university-level book or guide to study in order to gain the ability of writing Mac OS X device drivers. I'm totally ignorant on this OS, but I'm already skilled on Linux. Is there any Mac OS X counterpart for book "Linux Device Drivers"? The best guide should introduce OS internals too, makes clear kern...

osx: how do I find the size of the disk i/o cache (write cache, for example)

I am looking to optimize my disk IO, and am looking around to try to find out what the disk cache size is. system_profiler is not telling me, where else can I look? edit: my program is processing entire volumes: I'm doing a secure-wipe, so I loop through all of the blocks on the volume, reading, randomizing the data, writing... if I re...

Programmatically get amount of RAM installed on OS X

I'm working on a machine that has 8 gigs of memory installed and I'm trying to programmatically determine how much memory is installed in the machine. I've already attempted using sysctlbyname() to get the amount of memory installed, however it seems to be limited to returning a signed 32 bit integer. uint64_t total = 0; size_t size = ...

Using an IOService port reference to turn off a device...

Hello, This question relates to IO Kit programming on Mac OS X. I have an IO Service Port reference (io_service_t). Is there an API I can use to make whatever is on the end of that IOService port reference power off? I have tried with all my googling might, but have not found a solution. Any help would be appreciated. Cheers Jan ...

IOUSBDeviceInterface CreateInterfaceIterator does not return all interfaces

Hello, I've ran into a problem when CreateInterfaceIterator does not return all interfaces for the device. When I open "USB Prober" it says there are 9 interfaces, but displays 14 of then counting Interface #1 - Vendor-specific Interface #1 - Vendor-specific (#1) as one interface. The problem is that CreateInterfaceIte...

How to know a device's name from its device ID in OS X?

Hi all, I'm writing a program in OS X that receives click events from a mouse and a touchpad. When the user clicks at somewhere, the OS sends the device ID, which is just an int, and the position of the cursor to my callback function. I want to know if the click event comes from mouse or touchpad. So, how can I know the device's name fr...

How to tell if a given path is mounted removable media in Mac OS X?

Given a path, in Mac OS X, is there a way to tell that it is a mounted CD or DVD, as opposed to a regular directory, a regular file, or mounted DMG or other mountable file type? Specifically I would like to know if it is a CD or DVD when a user supplies a path directly, or via the NSOpenPanel, or drags the CD onto the app. I need to ta...

I am looking for sample code using bluetooth.

I am looking for sample code using bluetooth. Please teach when knowing. ...

Does this function IOHIDManagerRegisterDeviceMatchingCallback operate under the cocoa environment?

Hi, I am struggling to implement an HID control with a Mac : I cannot send the expected function as depicted here below: IOHIDManagerRegisterDeviceMatchingCallback( gIOHIDManagerRef, Handle_DeviceMatchingCallback, NULL ); with : gIOHIDManagerRef -> the valid HID manager dedicated to this routine Handle_DeviceMatchingCallback --...

IORegistryEntry::fromPath() fail.

my IOKit kext is failing on older iMacs to locate the /options path in the DeviceTree plane of the IORegistry. has anybody else encountered this or know why it would fail? thx->adv IORegistryEntry* regEntry = IORegistryEntry::fromPath("/options", gIODTPlane); if(NULL == regEntry) { regEntry = IORegistryEntry::fromPath("IODevi...