How to write a kernel module that creates a directory in /proc named mymod and a file in it name is mymodfile. This file should accept a number ranged from 1 to 3 when written i
This might be easier to do using sysfs. Sysfs was designed with these sorts of operations in mind, and has simple functions for creating directories and virtual files and callbacks for read and write operations to those files.