views:

59

answers:

1

Hello,

I need to pass a link to file from a user process to the OSX kernel driver. By link i mean anything that uniquely identifies a file on the local filesystem. I need that link to do I/O on that file in kernel. The most obvious solution seems to pass a file name and use a VFS vnode lookup. However i noticed, that Apple Disk Images helper process passes a raw data array for image-path property to driver when attaching a disk image file:

<2f 56 6f 6c 75 6d 65 73 2f 73 74 6f 72 61 67 65 2f 74 65 73 74 32 2e 64 6d 67>

What is that diskimages-helper passes to the kernel driver? Some serialized type perhaps? If yes, what type is it and how can i use it?

+1  A: 

I don't know anything about Mac OS X kernel programming, but that "raw data array" you posted is instantly recognisable as ASCII text. It is the string /Volumes/storage/test2.dmg.

(The usual "UNIX way" to pass a file from userspace to the kernel is for the userspace application to open the file and pass the file descriptor in).

caf