Miscellaneous device driver example

The interested reader can refer <miscellaneous device drivers in linux kernel> for an introduction. The below code provides a sample code example for a miscellaneous device driver

Miscellaneous device driver example

The below output of /dev folder shows the creation of a miscellaneous device. the minor number allocated is 120

example_misc_device created after driver insmod

The earlier sample code is modified to open the miscellaneous device file and is shown below

Sample User space code for miscellaneous device

The output of the sample code access to the miscellaneous device driver is shown below

sample code and dmesg output

In the next article, we will discuss a platform device driver

Platform Device driver in the Linux kernel

Comments

  1. Pingback: Miscellaneous Device drivers in Linux | Hitch Hiker's Guide to Learning

Leave a Reply

Your email address will not be published. Required fields are marked *