DEV Community

Discussion on: How to add system call (syscall) to the kernel, compile and test it?

Collapse
 
omergulen profile image
Ömer Gülen

I'm a college student and taking the Operating Systems course. As a programming assignment, our lecturer wanted us to add syscall which prints out the time elapsed since the start of a process with given PID.

So while I was doing my homework I used many tutorials and read many source and header files. As a result, I wanted to simplify it to other people, that's all I guess.

I'm sure there are many alternatives methods which people would prefer to syscalls but still, I just wanted to share :)

Thanks for your feedback!

Collapse
 
phlash profile image
Phil Ashby

Ah cool, thanks for helping others along, and sending me down a rabbit hole looking for ways to do this dynamically with loadable modules: TIL officially you cannot as the sys_call_table[] in the kernel is a fixed size, defined at build time; unofficially there are usually unused entries you can usurp..caveat hacker :)