I copied and pasted the code from this url: http://linux.die.net/lkmpg/x769.html
I replaced the outdated &proc_root foolery and commented out the "Our_Proc_File->owner = THIS_MODULE;" line on account that it gave me trouble while building.
I then made an appropriate makefile, compiled the .ko and did the deed with insmod.
Two questions:
How do I read from the procfile?
Also, I see an entry for the file is made at module load, but when is this file written?
BONUS These questions may root from a misunderstanding of proc. It is my impression that proc "files" are written to upon file read to deliver up-to-date info.
read(2)
. cat
can do this for you from the shell.