I have an ARM Samsung Chromebook running Ubuntu (chrUbuntu 12.04).

What is the easiest way to run some code in ARM 'privileged' state? I'm not looking for sudo, I'm looking for ARM processor mode of Supervisor, IRQ, FIQ, etc. Someplace I can probe/modify the coprocessor registers.

It's easy to get to priv mode: just do an SVC call. The question is, what is the easiest way to get some of my own code plugged into the OS so it gets called on a certain SVC call?

I'm not much of a Linux hacker. Mostly I'm looking for general pointers on the easiest general direction (rebuild the kernel? grab some driver source and hook in a modified driver? some easy command line option to run something priv?), then I'll go from there.


In case my above approach makes no sense and there is an easier way, my overall goal is:

  • write some low level assembly routines
  • see how they perform with various hardware configurations of the Cortex-A15 core

Thanks in advance,

Paul

有帮助吗?

解决方案

Easiest way to access coprocessors registers in case they are not allowed from user land is running some initialization code in kernel boot up sequence like board-init or write a kernel module to do what you want. See this answer. Also if interested, this question.

其他提示

For the second version of your question: Sound to me like you want the perf tools, rather than trying to implement your own performance measurements: https://perf.wiki.kernel.org/index.php/Tutorial

The other way would be through implementing a loadable kernel module. If you create a module, as a driver or as something accessed through /proc or /sys, that module will execute in Supervisor mode.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top