Reputation: 151
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?
Upvotes: 0
Views: 1826
Reputation: 11649
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.
Upvotes: 3