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?
/proc
and /sys
). And it all depends on what kind of information you want, it may be all over the place./proc
is that it allows processes to access information otherwise hidden in kernel structures without needing additional system calls.