/workqueue-driver-example

A simple driver using Linux's Workqueue

Primary LanguageC

Simple project using Linux's Workqueue

Idea: Create a device Writable | Readable that calls a Workqueue whenever anyone tries to write to read it.

The Workqueue job is to write to a file whose value is written to the char device. Like a ping pong:

user@kernel:~$ echo "~/mypong.txt ping" >> /sys/dev/pong
user@kernel:~$ cat ~/mypong.txt
ping:pong

Build and installation

sudo make;
sudo inmod driver.ko; # This installs driver

Usage

sudo cat /dev/etx_device;
sudo dmesg;

Remove from Kernel modules

sudo rmmod driver.ko

Resources

  1. File Managment
  2. Full Driver Creation
  3. Char Device Creation
  4. Workqueue