diff -Naur --exclude-from /home/mulix/dontdiff linux-2.4/Documentation/Configure.help 2.4.22-pre5-kfib/Documentation/Configure.help
--- linux-2.4/Documentation/Configure.help	2003-07-12 12:55:25.000000000 +0300
+++ 2.4.22-pre5-kfib/Documentation/Configure.help	2003-07-12 13:28:24.000000000 +0300
@@ -19225,6 +19225,16 @@
   If you want to compile it as a module, say M here and read
   <file:Documentation/modules.txt>. The module will be called
   wafer5823wdt.o
+
+Kernel Fibonacci Series Generator
+CONFIG_KERNEL_FIBONACCI
+  This is a driver for a kernel fibonacci series generator. 
+
+  This driver is also available as a module ( = code which can be
+  inserted in and removed from the running kernel whenever you want).
+  If you want to compile it as a module, say M here and read
+  <file:Documentation/modules.txt>. The module will be called
+  kfib.o
 	      
 Machine Check Exception
 CONFIG_X86_MCE
diff -Naur --exclude-from /home/mulix/dontdiff linux-2.4/drivers/char/Config.in 2.4.22-pre5-kfib/drivers/char/Config.in
--- linux-2.4/drivers/char/Config.in	2003-07-08 14:40:59.000000000 +0300
+++ 2.4.22-pre5-kfib/drivers/char/Config.in	2003-07-12 13:29:25.000000000 +0300
@@ -345,4 +345,6 @@
    tristate 'ACP Modem (Mwave) support' CONFIG_MWAVE
 fi
 
+tristate 'Kernel Fibonacci Series Generator' CONFIG_KERNEL_FIBONACCI
+
 endmenu
diff -Naur --exclude-from /home/mulix/dontdiff linux-2.4/drivers/char/Makefile 2.4.22-pre5-kfib/drivers/char/Makefile
--- linux-2.4/drivers/char/Makefile	2003-07-06 12:09:57.000000000 +0300
+++ 2.4.22-pre5-kfib/drivers/char/Makefile	2003-07-12 13:26:36.000000000 +0300
@@ -313,6 +313,8 @@
   obj-y += ipmi/ipmi.o
 endif
 
+obj-$(CONFIG_KERNEL_FIBONACCI) += kfib.o
+
 include $(TOPDIR)/Rules.make
 
 fastdep:
diff -Naur --exclude-from /home/mulix/dontdiff linux-2.4/drivers/char/kfib.c 2.4.22-pre5-kfib/drivers/char/kfib.c
--- linux-2.4/drivers/char/kfib.c	1970-01-01 02:00:00.000000000 +0200
+++ 2.4.22-pre5-kfib/drivers/char/kfib.c	2003-07-13 01:17:25.000000000 +0300
@@ -0,0 +1,123 @@
+/* $Id: kfib-2.4.22-pre5.diff,v 1.2 2003/07/13 00:06:24 mulix Exp $ */ 
+
+/* a small kernel module to demonstrate writing kernel modules */ 
+/* written by Muli Ben-Yehuda, mulix@mulix.org */ 
+/* GPL'd */ 
+
+#include <linux/kernel.h> 
+#include <linux/module.h> 
+#include <linux/fs.h> 
+#include <linux/spinlock.h> 
+#include <linux/slab.h> 
+#include <asm/uaccess.h> 
+
+MODULE_AUTHOR("Muli Ben-Yehuda <mulix@mulix.org>"); 
+MODULE_DESCRIPTION("In kernel fibonacci series implementation"); 
+MODULE_LICENSE("GPL");
+
+#define KFIB_MAJOR_NUM 250 /* arbitrary */ 
+
+struct kfib 
+{
+	spinlock_t lock; 
+	unsigned int nmin1; 
+	unsigned int nmin2; 
+}; 
+
+/* the file global fibonacci object */ 
+struct kfib fibonacci; 
+
+static void init_kfib(struct kfib* f)
+{
+	memset(f, 0, sizeof(*f)); 
+
+	spin_lock_init(&f->lock); 
+
+	f->nmin1 = 1; 
+	f->nmin2 = 0; 
+}
+
+static unsigned int __kfib_calc_next_term(struct kfib* fib)
+{
+	unsigned int term; 
+
+	if (!fib)
+		BUG(); 
+
+	term = fib->nmin1 + fib->nmin2; 
+	fib->nmin2 = fib->nmin1; 
+	fib->nmin1 = term; 
+
+	return term; 
+}
+
+static int kfib_open(struct inode *inode, struct file *filp)
+{
+	filp->private_data = &fibonacci; 
+
+	return 0; 
+}
+
+static int kfib_release(struct inode *inode, struct file *filp)
+{
+	return 0;
+}
+
+static int kfib_read(struct file *filp, char *ubuf, size_t count,
+		     loff_t *f_pos)
+{
+	struct kfib* fib; 
+	unsigned int term; 
+	char kbuf[16] = {0,}; 
+	size_t len; 
+
+	if (*f_pos != 0) /* second time we're called? we're through */ 
+		return 0; 
+
+	fib = filp->private_data; 
+
+	if (!fib)
+		BUG(); 
+
+	spin_lock(&fib->lock); 
+
+	term = __kfib_calc_next_term(fib); 
+
+	spin_unlock(&fib->lock); 
+
+	snprintf(kbuf, sizeof(kbuf) - 1, "%d\n", term); 
+	kbuf[sizeof(kbuf) - 1] = '\0'; 
+
+	len = min(count, strlen(kbuf) + 1); 
+	
+	if (copy_to_user(ubuf, kbuf, len))
+		return -EFAULT; 
+
+	*f_pos += len; 
+
+	return len;
+}
+
+struct file_operations kfib_fops = {
+	.owner = THIS_MODULE, 
+	.open = kfib_open, 
+	.release = kfib_release, 
+	.read = kfib_read
+};
+
+int init_module(void)
+{
+	int ret; 
+
+	init_kfib(&fibonacci); 
+
+	if ((ret = register_chrdev(KFIB_MAJOR_NUM, "kfib", &kfib_fops)) < 0)
+		printk(KERN_ERR "register_chrdev: %d\n", ret); 
+	
+	return ret; 
+}
+
+void cleanup_module(void)
+{
+	unregister_chrdev(KFIB_MAJOR_NUM, "kfib");
+}
