1/1

|
how to read PID of the current process
by fardin1368 on Jul 19, 2012 |
fardin1368
Posts: 3 Joined: Jul 19, 2012 Last seen: Aug 1, 2012 |
||
|
Hi everybody,
I am new to softcores and I need to use a softcore for a research project purpose. I need to have access to the Program Counter register, currently being executed process ID but I don't want to use operating system to provide these information for me. basically, I want the hardware to directly provide this information for me. I wonder if there is a register in which the PID of the current process is being saved? Can I modify the architecture and show the PID on one of the output ports? In addition, maybe I am totaly wrong and I am not doing this in a right way. Do u have another better suggestion for me? an alternative way? Thanks a lot, Fardin |
|||
|
RE: how to read PID of the current process
by richard_vlamynck on Jul 20, 2012 |
richard_vlamynck
Posts: 31 Joined: Sep 15, 2008 Last seen: Jan 24, 2016 |
||
|
If by sayng "PID" you are referring to "Process ID," you might note that the algorithm for selecting and context switching the PID is provided by the operating system software, and generally speaking, is unique to each operating system.
But, if you were to add a "PID Register" to an OpenRISC SoC and were also to add some lines of code to the operating systems context switching software, then you could output the current PID from some hardware port. The PID register in this case is not really a OpenRISC register, in reality it's just another peripheral address, similar to a realtime clock that's constantly outputting clock tics in some arbitrary data format. Another way of saying the above is to "connect the PID to a GPIO port and hack the OS context switching software to constantly update GPIO with PID." If you're asking how to move the PID selection algorithm into hardware, that is a different "can of worms." I hope that helps.... |
|||
|
RE: how to read PID of the current process
by fardin1368 on Jul 23, 2012 |
fardin1368
Posts: 3 Joined: Jul 19, 2012 Last seen: Aug 1, 2012 |
||
|
Yes, by PID I meant "Process ID". Now I think you are right because PID is a OS related parameter. Since the goal of my research is a to design a security technique, I don't want to trust OS or any other software in any way.
Thanks a lot for your great answer. |
|||
1/1

