1

My operating systems course's project requires me to implement a system call which gets two arguments, device's name and desired detail, cpu and cpu's frequency as an example. Then the system call must somehow retrieve this desired detail and pass it to a user program.

I have been surfing the net a lot and I came across several linux commands that do something similar, like "lspci". I searched where lspci gets its information and it looks like it retrieves it from a filesystem called "proc" in linux kernel. Apparently, the proc filesystem doesn't contain any data and only holds data structures which are used to access information. The first problem is that, I don't know if this is the right place to look for such an information and the second one is, how to retrieve data from this filesystem inside a system call?

2
  • You mean you have to implement a new linux system call (as opposed to a system call in a completely different OS used for teaching your course)? If yes, you can get the information from the internal kernel structures (which is what is made visible in /proc and /sys). And it all depends on what kind of information you want, it may be all over the place.
    – dirkt
    Commented Oct 16, 2016 at 16:54
  • Oh, and the point of /proc is that it allows processes to access information otherwise hidden in kernel structures without needing additional system calls. Commented Oct 16, 2016 at 22:34

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.