0

I've made a question on StackOverflow thinking it was the right place for asking, but they directed me here because they think its a SuperUser-releated topic. So here I am :)

I'd like to ask you how can I autoload my driver for a particular device on a Mac.

I have made a driver written in C, and now I was wondering how can I run this program in my macos(/linux/windows) environment whenever my device is plugged in. In short: how can I recognize, by system default, if this device is plugged to mac by vendor+product id( or to a linux or windows) and start my driver? Or how can I transform my C-driver in kext and autoload it? In lkm? (dll(?) for windows?)

Thanks you!

P.S. I know there are some specific OS-dependent APIs for kernel interaction, but for the moment I'd be grateful if I could load my C-driver from a "close-to-codeless" kernel extension, what I want to achieve is:

1 - When I plug my usb device, my system is able to recognize it
2 - my system load my custom kernel extension that ..
3 - ... will run my external C program to handle device.
(4- Of course when finishing, clean all)

Is it possibile or I have no choice than that to use Kernel APIs?

Thanks you so much!

3
  • Do you want the answer for Windows, for Mac or for Linux? All answers will be different ... e.g. for Linux, look at udev.
    – dirkt
    Oct 28, 2017 at 13:18
  • Mainly for Mac, but if you can provide me some useful tips about other OS I'll be grateful :) I'll look at udev as you said, thanks!
    – pippo
    Oct 28, 2017 at 13:45
  • @pippo Good questions are not broad. Wanting a solution for everything makes it broad
    – Ramhound
    Oct 28, 2017 at 15:22

0

You must log in to answer this question.

Browse other questions tagged .