Hello
I wrote aind compile little module only for tests:
#include <linux/module.h>
#include <linux/sched.h>
static int errval = 0;
//module_param(errval,int,S_IRWXU);
module_param(errval,int,S_IWUSR|S_IRUSR|S_IWGRP|S_IRGRP);
MODULE_PARM_DESC(errval,"Value to return from init function");
int my_init_module(void)
{
printk("errval=%d\n",errval);
return errval;
}
void my_cleanup_module(void)
{
printk("The module is now unloaded\n");
}
module_init(my_init_module);
module_exit(my_cleanup_module);
MODULE_LICENSE("GPL");
compile by:
make -C /lib/modules/6.6.75-current-sunxi64/build M=$(PWD) modules
And it cause segmentation fault
onlyme@orangepizero3:~/modules/errors$ sudo insmod errs.ko
[sudo] password for onlyme:
Message from syslogd@orangepizero3 at Mar 10 13:35:33 ...
kernel:[ 331.593726] Internal error: Oops: 0000000096000004 [#1] SMP
Message from syslogd@orangepizero3 at Mar 10 13:35:33 ...
kernel:[ 331.798432] Code: 540005a0 f9401680 aa1a03e2 aa1703e1 (f9406400)
Segmentation fault
On Ubuntu x86 and raspbian (raspbery pi 3) it works, on orangepi zero 3 dosnet. Why?