Problemer med at compile HelloModule eksempel på linux
Jeg forsøger at compile følgende eksempel modul:#include <linux/init.h>
#include <linux/module.h>
MODULE_LICENSE("GPL");
static int __init driver_init(void)
{
printk("Driver eksempel - Init");
return 0;
}
static void __exit driver_exit(void)
{
printk("Driver eksempel - Exit");
}
module_init(driver_init);
module_exit(driver_exit);
MODULE_AUTHOR("THR");
MODULE_DESCRIPTION("Et simpelt eksempel");
Og compiler filen med: gcc -o ExMod Eksempel.c
men får en masse fejl fra kode jeg ikke har skrevet.
Hvor kan fejlen stamme fra?
Udklip af fejlene:
[root@udvikling src]# gcc -o driver Eksempel_Driver.c
In file included from /usr/include/linux/sched.h:11,
from /usr/include/linux/module.h:9,
from Eksempel_Driver.c:5:
/usr/include/linux/jiffies.h:81: error: expected ‘,’ or ‘;’ before ‘jiffies_64’
/usr/include/linux/jiffies.h:85: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘get_jiffies_64’
In file included from /usr/include/linux/sched.h:11,
from /usr/include/linux/module.h:9,
from Eksempel_Driver.c:5:
/usr/include/linux/jiffies.h:256:47: error: division by zero in #if
/usr/include/linux/jiffies.h: In function ‘jiffies_to_msecs’:
/usr/include/linux/jiffies.h:259: error: ‘MSEC_PER_SEC’ undeclared (first use in this function)