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
What you're looking for is the Linux Kernel Module Programming Guide, specifically the section on the /proc filesystem, which has well documented examples of how to add new entries.