Hello
I have linux red hat8 installed.
I want to add a system call to the kernel and recompile the kernel.
What I did is I added My.c inside linux-2.4.18-14custom/kernel
The code for My.c is:
Code:
#include <linux/kernel.h>
#include <linux/sched.h>
#include <errno.h>
//#include <current.h>
int sys_getpath (int pid, int * array, int size)
{
task_struct * pTask;
printk ("This is get path V0P02\n");
// pTask = current;
printk ("%d", pTask->pid);
while (pTask->pid!=1)
{
pTask = pTask->p_pptr;
printk ("%d", pTask->pid);
}
return 0;
}
The problem I have as when I add #include <linux/sched.h> I get all sort of errors on sched.h when compiling with gcc -c My.c or gcc My.c -c
I also tried to compile user.c in the kernel, because it also has an include to sched.h, and I got about the same errors on sched.h
So how am I suppose to create My.o from My.c?
Is there something I am missing?
Thanks in advance.