Hi Monobrata, I'm not sure how other OSes do it, but for Linux the kernel usually uses the same thread context as the main process. For instance, when executing a system call the user process switches to ring 0 then executes the system call code before switching back to ring 3. Interrupts are a little different, but there isn't a dedicated "thread" to the OS (as far as I know).
If you want to detect whether or not the OS is running you can check the current supervisor level of the core. In the gem5 CPU models you should be able to use code something like the following. TheISA::inUserMode(thread[0]->getTC()) Jason On Wed, Jun 14, 2017 at 4:51 PM Monobrata Debnath <[email protected]> wrote: > > Hello, > > What would be the most efficient way to distinct the kernel process and > application process on the CPU? By which I meant without adding any > additional identification at the OS level during the process generation. > > Thank you, > Monobrata > _______________________________________________ > gem5-users mailing list > [email protected] > http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
_______________________________________________ gem5-users mailing list [email protected] http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
