1

Given driver name and path, how can I load and start the driver from a C++ program in Ubuntu.

Does there exists functions similar to CreateService,OpenSCManager,OpenService,etc..

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
Jackzz
  • 1,417
  • 4
  • 24
  • 53
  • [THIS](http://stackoverflow.com/questions/5947286/how-can-linux-kernel-modules-be-loaded-from-c-code) could help. – LPs Jan 29 '15 at 09:59
  • @LPs : It seems that my system doesnt contain `linux/modules.h`. What to do? – Jackzz Jan 29 '15 at 10:40
  • If you have installed kernel headers you must find it in a subdirectory of /usr/src – LPs Jan 29 '15 at 10:54
  • @LPs: Is there some way other than using the system command?? I mean as there is functions like `dlopen` to open libraries dynamically.. – Jackzz Jan 29 '15 at 10:55
  • Yes.. the header file exists.. – Jackzz Jan 29 '15 at 11:02
  • I don't understand what are you asking for.. With that header you can use kernel to load the driver you want. What is your question then? – LPs Jan 29 '15 at 11:06
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/69807/discussion-between-anzz-and-lps). – Jackzz Jan 29 '15 at 11:33
  • 1
    Possible duplicate of [How can Linux kernel modules be loaded from C code?](https://stackoverflow.com/questions/5947286/how-can-linux-kernel-modules-be-loaded-from-c-code) Answers will be the same, since kernel APIs are language agnostic, and C heavily dominates low level Linux programming. – Ciro Santilli OurBigBook.com Jul 25 '17 at 07:55

0 Answers0