Question

The kernel communicates with drivers that means my application could do it as well maybe doing system calls? For example I would like to simulate a click in my application is there a way I can send some input to the mouse driver and achieve this or make a system call to achieve the simulation? Bottom line, I would like to know if it's possible to talk to drivers using C and how would I go about doing this?

Était-ce utile?

La solution

Yes, check the /dev/<device> entry in your file system that the driver has created and access the /dev/<device> as a file from your user application and perform open/read/write/close operations on it. The corresponding read/write in the driver will be called. If you need to define specific functions then you need to define ioctls in your driver code.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top