This sample code allows one to change the "uptime" as kept by the Linux kernel. The time can go forward and back. One needs to insert/remove the module in order to make multiple changes.
I wrote this code to fool around with a user-mode application that was time-dependent.
Here's how to compile it against a Linux 2.4 kernel:
gcc -c -D__KERNEL__ -DMODULE -I/usr/src/linux-2.4/include kmode-chuptime.cTrivial changes will make it work with a 2.6 kernel.
The source code (kmode-chuptime.c) is released under the GPLv2.