/*
* bottomhalf.c - Top and bottom half interrupt handling
*
- * Copyright (C) 2017 by Bob Mottram
- * Based upon the Rpi example by Stefan Wendler (devnull@kaltpost.de)
+ * Based upon the RPi example by Stefan Wendler (devnull@kaltpost.de)
* from:
* https://github.com/wendlers/rpi-kmod-samples
*
}
MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Bob Mottram");
MODULE_DESCRIPTION("Interrupt with top and bottom half");
module_init(completions_init);
module_exit(completions_exit);
-MODULE_AUTHOR("Bob Mottram");
MODULE_DESCRIPTION("Completions example");
MODULE_LICENSE("GPL");
module_init(cryptosha256_init);
module_exit(cryptosha256_exit);
-MODULE_AUTHOR("Bob Mottram");
MODULE_DESCRIPTION("sha256 hash test");
MODULE_LICENSE("GPL");
module_init(cryptoapi_init);
module_exit(cryptoapi_exit);
-MODULE_AUTHOR("Bob Mottram");
MODULE_DESCRIPTION("Symmetric key encryption example");
MODULE_LICENSE("GPL");
}
MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Bob Mottram");
MODULE_DESCRIPTION("Linux Device Model example");
module_init(devicemodel_init);
module_init(example_atomic_init);
module_exit(example_atomic_exit);
-MODULE_AUTHOR("Bob Mottram");
MODULE_DESCRIPTION("Atomic operations example");
MODULE_LICENSE("GPL");
module_init(example_mutex_init);
module_exit(example_mutex_exit);
-MODULE_AUTHOR("Bob Mottram");
MODULE_DESCRIPTION("Mutex example");
MODULE_LICENSE("GPL");
module_init(example_rwlock_init);
module_exit(example_rwlock_exit);
-MODULE_AUTHOR("Bob Mottram");
MODULE_DESCRIPTION("Read/Write locks example");
MODULE_LICENSE("GPL");
module_init(example_spinlock_init);
module_exit(example_spinlock_exit);
-MODULE_AUTHOR("Bob Mottram");
MODULE_DESCRIPTION("Spinlock example");
MODULE_LICENSE("GPL");
module_init(example_tasklet_init);
module_exit(example_tasklet_exit);
-MODULE_AUTHOR("Bob Mottram");
MODULE_DESCRIPTION("Tasklet example");
MODULE_LICENSE("GPL");
#include <linux/module.h> /* Needed by all modules */
MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Bob Mottram");
+MODULE_AUTHOR("LKMPG");
MODULE_DESCRIPTION("A sample driver");
MODULE_SUPPORTED_DEVICE("testdevice");
#include <linux/stat.h>
MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Peter Jay Salzman");
static short int myshort = 1;
static int myint = 420;
#include <linux/sysfs.h>
MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Bob Mottram");
static struct kobject *mymodule;
}
MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Bob Mottram");
MODULE_DESCRIPTION("Handle some GPIO interrupts");
module_exit(ioctl_exit);
MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Wang Chen Shu");
MODULE_DESCRIPTION("This is test_ioctl module");
#include <linux/console_struct.h> /* For vc_cons */
MODULE_DESCRIPTION("Example module illustrating the use of Keyboard LEDs.");
-MODULE_AUTHOR("Daniele Paolo Scarpazza");
MODULE_LICENSE("GPL");
struct timer_list my_timer;
/* cat_noblock.c - open a file and display its contents, but exit rather than
* wait for input */
-/* Copyright (C) 1998 by Ori Pomerantz */
#include <errno.h> /* for errno */
#include <fcntl.h> /* for open */
#include <linux/version.h> /* For LINUX_VERSION_CODE */
MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Peter Jay Salzman");
static void print_string(char *str)
{
#define PROC_NAME "iter"
-MODULE_AUTHOR("Philippe Reynes");
MODULE_LICENSE("GPL");
/**
}
MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Bob Mottram");
MODULE_DESCRIPTION("Workqueue example");
In other words, your kernel refuses to accept your module because version strings (more precisely, version magics) do not match. Incidentally, version magics are stored in the module object in the form of a static string, starting with vermagic:. Version data are inserted in your module when it is linked against the \textbf{init/vermagic.o} file. To inspect version magics and other strings stored in a given module, issue the modinfo module.ko command:
\begin{verbatim}
-# sudo modinfo hello-4.ko
-license: GPL
-author: Bob Mottram <bob@freedombone.net>
+# modinfo hello-4.ko
description: A sample driver
-vermagic: 5.6.7-1.358 amd64 REGPARM 4KSTACKS gcc-4.9.2
+author: LKMPG
+license: GPL
+srcversion: B2AA7FBFCC2C39AED665382
depends:
+retpoline: Y
+name: hello_4
+vermagic: 5.4.0-70-generic SMP mod_unload modversions
\end{verbatim}
To overcome this problem we could resort to the \textbf{--force-vermagic} option, but this solution is potentially unsafe, and unquestionably inacceptable in production modules. Consequently, we want to compile our module in an environment which was identical to the one in which our precompiled kernel was built. How to do this, is the subject of the remainder of this chapter.