I'm trying to build some kernel modules on RPI, the ismond work fine for some times, now the insmod command crash each time I try to insert a simple module. the kernel module compile without any error or warnings, and I'm not using any pointers. I used modprobe instedd of insmod and still getting same error
I got always this message, not matter what the kernel module contain
root@raspberrypi:/home/pi/test_gpio_driver# insmod gpio.ko
Segmentation fault
root@raspberrypi:/home/pi/test_gpio_driver#
Message from syslogd@raspberrypi at Jan 5 17:22:03 ...
kernel:[ 312.961379] Internal error: Oops: 5 [#1] PREEMPT ARM
Message from syslogd@raspberrypi at Jan 5 17:22:03 ...
kernel:[ 313.071855] Process insmod (pid: 2306, stack limit = 0xdb1d81b0)
Message from syslogd@raspberrypi at Jan 5 17:22:03 ...
kernel:[ 313.079360] Stack: (0xdb1d9e90 to 0xdb1da000)
Message from syslogd@raspberrypi at Jan 5 17:22:03 ...
kernel:[ 313.085167] 9e80: bf0c413c c006d420 bf0c413c 00007fff
Message from syslogd@raspberrypi at Jan 5 17:22:03 ...
kernel:[ 313.096194] 9ea0: c006a6e4 dc803000 00000000 c006a7b0 00000000 bf0c4278 bf0c413c db1d8018
Message from syslogd@raspberrypi at Jan 5 17:22:03 ...
kernel:[ 313.107386] 9ec0: ddef4b40 bf0c4130 db1d9f60 db1d9f8c ffffffff db1d9f14 00000000 00000000
my kernel module
#include <linux/module.h>
#include <linux/init.h>
static int __init mymodule_init(void)
{
printk ("My module worked!\n");
return 0;
}
static void __exit mymodule_exit(void)
{
printk ("Unloading my module.\n");
return;
}
module_init(mymodule_init);
module_exit(mymodule_exit);
MODULE_LICENSE("GPL");