bimmo
bimmo

Reputation: 395

How are device drivers called upon?

From Wikipedia, I see the following written:

"When a calling program invokes a routine in the driver, the driver issues commands to the device." (https://en.wikipedia.org/wiki/Device_driver)

What happens when a program "invokes a routine" in the driver? Is the driver contacted by way of inter-process communication? Device drivers execute continuously once loaded, but I don't understand how my program can 'tap it on the shoulder' and ask for something. Are drivers fundamentally different on different platforms?

Upvotes: 0

Views: 28

Answers (1)

Chandra
Chandra

Reputation: 471

You can open specific device with whose driver you want to communicate. You can use CreateFile command to open device handle and then use IOCTL or WriteFile for communicating with driver. You can use DeviceIoControl for calling any IOCTL of driver. You should previously know the IOCTL codes for calling. I would suggest to read provided link once http://www.codeproject.com/Articles/9504/Driver-Development-Part-Introduction-to-Drivers

There is a section "Communicating to the Device Driver" which tells how to communicate with device driver. I hope this will clear much of your doubt regarding communication with drivers.

Upvotes: 1

Related Questions