2
Hello I’m studying about operating systems, through the book: fundamentals of operating systems. La in cap. 2 talks about kernel modules and shows an example: simple. c
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
int simples_init(void) {
printk(KERN_INFO,"Mod. Init");
return 0;
}
void simples_exit(void) {
printk(KERN_INFO,"Mod. Exit");
}
module_init(simples_init);
module_exit(simples_exit);
That’s the code so how do I compile it?
Your question is, "How to compile a simple code written in C". The command will depend on the compiler you are using, in Linux you have the
gcc
. I believe that the book should presuppose a basic knowledge in C to accompany the codes presented, if it does not presuppose should.– Piovezan