i was trying to compile the simplest self-made module (pasted form the book "Linux Device Drivers") and i've got plenty of errors.
the code of the 'module' is
#define MODULE
#include <linux/module.h>
int init_module(void){printk("<1>Hello,world \n");return 0;}
void cleanup_module(void){printk("<1>Goodbye cruel world \n");}
and errors are:
In file included from /usr/include/linux/timex.h:58,
from /usr/include/linux/sched.h:11,
from /usr/include/linux/module.h:10,
from hello.c:3:
/usr/include/linux/time.h:13: error: syntax error before "time_t"
/usr/include/linux/time.h:15: error: syntax error before '}' token
/usr/include/linux/time.h:19: error: syntax error before "time_t"
/usr/include/linux/time.h:143: error: field `it_interval' has incomplete type
/usr/include/linux/time.h:144: error: field `it_value' has incomplete type
/usr/include/linux/time.h:148: error: field `it_interval' has incomplete type
/usr/include/linux/time.h:149: error: field `it_value' has incomplete type
In file included from /usr/include/linux/sched.h:11,
from /usr/include/linux/module.h:10,
from hello.c:3:
/usr/include/linux/timex.h:147: error: field `time' has incomplete type
In file included from /usr/include/linux/sched.h:12,
from /usr/include/linux/module.h:10,
from hello.c:3:
/usr/include/linux/jiffies.h:84: error: syntax error before "jiffies_64"
...
and lots of so sort of lines...
Intel Xeon E3-1270 v6 3.80GHz 4 Cores SR326 LGA1151 CPU Processor
$46.00
Intel - Core i9-12900K Desktop Processor 16 (8P+8E) Cores up to 5.2 GHz Unloc...
$619.99
Intel - Core i7-12700K Desktop Processor 12 (8P+4E) Cores up to 5.0 GHz Unloc...
$419.99
Intel Xeon E5-2697A V4 2.6GHz CPU Processor 16-Core Socket LGA2011 SR2K1
$39.99
Intel Core i5-8500 3 GHz 8 GT/s LGA 1151 Desktop CPU Processor SR3XE
$49.99
E5-2697V4 INTEL XOEN SR2JV 18 CORE 2.30 GHz 45M 9.6 GT/s 145W PROCESSOR CPU
$49.99
AMD Ryzen 9 5950X 16-core 32-thread Desktop Processor
$319.99
Intel - Core i9-14900K 14th Gen 24-Core 32-Thread - 4.4GHz (6.0GHz Turbo) Soc...
$619.99
Intel Core i5-12400 Desktop Processor With HeatSink
$140.00
Intel Core i5-8500T SR3XD 2.10GHz Processor | Grade A
$55.00