c++device-driverlinux-device-driver

c++ device driver development in linux


I wanted to get more details for writing Graphics device drivers and audio device drivers using c++ for Linux box. I am newbie at developing device drivers , Please provide me development/documentation details for the same.

Thanks

-Pravin


Solution

  • Linux kernel device drivers are written in C rather than C++.

    Most device drivers are accessed via a special device file (/dev/yourdevice0) on which control as well as read and write operations can be performed.

    User mode client programs and user mode drivers open the device file and use it as a pathway to talk to the kernel mode driver. These user mode drivers could conceivably be written in C++ or any other language.

    Generally the best way to get started is to have a device which needs a driver, and learn what you need to in order to write it. And often the best way to do that is to find an existing driver for either a related device, or one with similar interface paradigms, and start by modifying that until it works for your new device instead or as well.