1

I have a chunk of code using POSIX APIs to talk to a device which is essentially a cp210x USB-to-serial device.

The code does work, but I had to install a kernel extension to make it happen. Now, I don't want to install a kext. This device's engineers have used a non-standard vendor ID and product ID for their device, so the proper driver for it doesn't notice that it will work. Therefore, I have to edit the Info.plist for the kext, or make my own "codeless" kext, but either way I will have to get a kernel extension signed, which seems like a pain in the butt (I remember it was a huge ordeal just to get the right certificate to sign an app!)

So basically, I was able to get it to work, but only after turning off kext signature checks globally, which is not something I want to do.

Now, I have another chunk of code which uses IOKit to query the USB devices for a device which matches a given vendor ID and product ID and can show a bunch of properties about it.

Is there some way I can use IOKit, then, to open a serial connection to a USB-to-serial device, without having to install a kext? (Maybe this chip is sufficiently generic that there is a proper way to do it already in OSX? USB-to-serial isn't exactly new technology.)

Hakanai
  • 12,010
  • 10
  • 62
  • 132

1 Answers1

2

So if I understand correctly, you'd like to add an IOKit kext personality to the Serial-over-USB kernel driver from userspace? I'm not aware of a way of doing that.

Your options, as far as I'm aware, are:

  • The codeless kext you've been using. For Mavericks and Yosemite you will indeed need to sign the kext. The actual signing is straightforward (trivial using Xcode), but you'll need to get the correct signing certificate from Apple. This is the form for it - you'll need to be a paid-up Mac Developer Program, and be prepared to wait up to 6 weeks.

  • Accessing the device entirely from userspace. You can do this via IOKit directly, or you can use an open source wrapper library such as libusb. Then you need to actually drive the serial-to-USB device via its USB protocol. Maybe you can find an existing userspace driver for it; I haven't looked for one. But in any case, you won't be able to access the device via the POSIX interfaces, as everything will live inside your userspace process.

pmdj
  • 22,018
  • 3
  • 52
  • 103