#include <linux/module.h>
static int __init hello_init(void) {
printk("<1>" "Hello Example Init
");
return 0;
}
static void __exit hello_exit(void) {
printk("<1>" "Hello Example Exit
");
}
module_init(hello_init);
module_exit(hello_exit);
MODULE_AUTHOR("Hubert Huang");
MODULE_DESCRIPTION("Hello World Example");
MODULE_LICENSE("GPL v2");
I cannot see “Hello Example Init” in my konsole or dmesg(insmod hello: module_layout: kernel tainted. rmmod Disabling lock debugging due to kernel taint).But after insmod hello.ko, I can see “hello” is there by using lsmod.
Did I make something wrong or does it matter systemd or openSUSE?
On 2015-06-25 05:16, hyx0408 wrote:
>
> “insmod hello: module_layout: kernel tainted. rmmod Disabling lock
> debugging due to kernel taint” may be wrong.
Is your kernel tainted or not? The boot log might say, although later
actions may taint it.
Ooops~~~! You are right! The hello.ko really tainted the kernel that I consider “signature and/or required key missing” cause it. I’m working on it, now. Do you have any advise?
Thank you for your reply.
On 2015-06-26 10:26, hcvv wrote:
>
> I may be wrong, by IMHO you are trying to program something. Then why is
> this in Hardware, were other programmers will not realy look?
I would agree.
I’m interested in learning how to make kernel modules, so I can not help
someone explaining how to do it