This is a /proc module that reports the system time.
I found Ori Pomerantz book Linux Kernel Module Programming
very useful.
It is available on the web
http://metalab.unc.edu/mdw/LDP/lkmpg/mpg.html
Time is tricky. In case of error see /var/log/messages
Makefile
my_time.c the module
test.c a user test program
Kernel module programming brief guide.