I am taking an OS class and we have an upcoming assignment involving Kernel modules. I'm reading Wiley OS text to prepare and they have the below code. I keep on getting an error that the header files are not found. I'm using arch linux and I tried pacman -S linux-headers to install them so I know they are there.I also tried including direct path to init.h but the modules reference other modules from linux/.. directory. How can solve this? I am thinking that maybe I have to edit the ycm_extra_conf.py file but I don't know what to do.
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
/* This function is called when the module is loaded. */
int simple init(void) {
printk(KERN INFO "Loading Kernel Module∖n");
return 0;
}
/* This function is called when the module is removed. */
void simple exit(void) {
printk(KERN INFO "Removing Kernel Module∖n");
}
/* Macros for registering module entry and exit points. */
module init(simple init);
module exit(simple exit);
MODULE LICENSE("GPL");
MODULE DESCRIPTION("Simple Module");
MODULE AUTHOR("SGG");
set path+=/usr/src/linux-5.2.14.arch2/include
, maybe from your Vimrc? See `:help 'path' for more details.