czvak
April 24th, 2005, 03:24 PM
Hi everyone,
recently i've been trying to compile some simple kernel modules on Hoary, but I get this error:
david@klendathu:~$ sudo insmod ./hello-2.ko
insmod: error inserting './hola-2.ko': -1 Invalid module format
or
david@klendathu:~$ sudo insmod hello-2.ko
insmod: error inserting 'hola-2.ko': -1 Invalid module format
The code of the module follows:
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
static int __init hello_2_init(void)
{
printk(KERN_ALERT "Hello world. \n");
return 0;
}
static void __exit hello_2_exit(void)
{
printk(KERN_ALERT "Goobye world. \n");
}
module_init(hello_2_init);
module_exit(hello_2_exit);
Any suggestions?, btw, i've installed modutils (of course), and the linux-restricted-modules. I don't know for sure if I need anything else.
Thanks.
recently i've been trying to compile some simple kernel modules on Hoary, but I get this error:
david@klendathu:~$ sudo insmod ./hello-2.ko
insmod: error inserting './hola-2.ko': -1 Invalid module format
or
david@klendathu:~$ sudo insmod hello-2.ko
insmod: error inserting 'hola-2.ko': -1 Invalid module format
The code of the module follows:
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
static int __init hello_2_init(void)
{
printk(KERN_ALERT "Hello world. \n");
return 0;
}
static void __exit hello_2_exit(void)
{
printk(KERN_ALERT "Goobye world. \n");
}
module_init(hello_2_init);
module_exit(hello_2_exit);
Any suggestions?, btw, i've installed modutils (of course), and the linux-restricted-modules. I don't know for sure if I need anything else.
Thanks.