i am not new into C Programming, but i am new into programming or modifying the linux kernel. For my study I have to write a little program now that reads every processes in the PCB and extracts the cpu-time from them. If the process exceeds a given time-limit i have to kill it. Sounds like a stupid task, but I didn't made it up
What we arent allowed to do is simply writing a bash script that uses "ps" or writing a c-program that reads the /proc directory.
My question now is: Where do I start?
What I have done so far is: I thought i could make a kernel module, I read a module programming guide and my kernel module compiles so far and i can insmod it into my kernel. We aren't allowed to write a normal userspace program, we have to modify the kernel or write a kernel module that does the work.
I hope you can help, thanks a lot!