If you wonder about how to work interrupt,tasklet and schedule in linux kernel 3.x, you could see this code series. When I start to search in internet for examining example source code, I found useful articles such as http://www.ibm.com/developerworks/linux/library/l-tasklets/index.html, but I couldn't find any example source code satisfying my desire. Therefore, I decided to write a simple driver. Furthermore, This driver will be a start point for a project which I thought. After this intro ceremony, We answer to that question. "What does this simple driver do?". Before I explain what it does. I need to mention about its architecture.
Driver includes a few features inside it. What are they?
cdev structure(char device) implementation
udev implementation
workqueue
I put especially udev implementation in order not to struggle with creating device node such as "mknod /dev/char_timer c major_num minor_num" after every working insmod.
Alright, We come to what it does. Driver sets a static int variable at every one second. You will see printk inside interrupt routine output to dmesg. Furthermore, if you want to run test program, you will see value of that timer variable.
That's all. If you encounter any trouble, I could try to help as best I can.
Source code is here.
https://github.com/sharku/char_timer
If you find this article useful, you could make a small contribution in order to be produced such kind of articles.
Hiç yorum yok:
Yorum Gönder