So I\'m trying to write a kernel module that uses the linux/timer.h file. I got it to work inside just the module, and now I am trying to get it to work from a user program.
You are missing a .open
function pointer in your file_operations
structure to specify the function to be called when a process attempts to open the device file. You will need to specify a .ioctl
function pointer for your ioctl function as well.
Try reading through The Linux Kernel Module Programming Guide, specifically chapters 4 (Character Device Files) and 7 (Talking to Device Files).
Chapter 4 introduces the file_operations
structure, which holds pointers to functions defined by the module/driver that perform various operations such as open
or ioctl
.
Chapter 7 provides information on communicating with a module/drive via ioctls.
Linux Device Drivers, Third Edition is another good resource.