Am learning to write LKMs and wrote this program :
#include<linux/init.h>
#include<linux/module.h>
static int module_entry(void){
printk(KERN_ALERT "Hello World !!\n");
return 0;
}
static void exit_module(void){
printk(KERN_ALERT "Bye World .... \n");
}
module_init(module_entry);
module_exit(exit_module);
In this program if I change return value of function module_entry from 0 to something negative, the module fails to load. The error message is :#include<linux/init.h>
#include<linux/module.h>
static int module_entry(void){
printk(KERN_ALERT "Hello World !!\n");
return 0;
}
static void exit_module(void){
printk(KERN_ALERT "Bye World .... \n");
}
module_init(module_entry);
module_exit(exit_module);
"insmod: ERROR: could not insert module test.ko: Operation not permitted"
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@xxxxxxxxxxxxxxxxx http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies