LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to read cpu registers values from shell? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-read-cpu-registers-values-from-shell-778186/)

yossibs 12-26-2009 09:59 AM

how to read cpu registers values from shell?
 
Hi all,

Is there a way to read the values of the CPU registers from the shell?,
I thought there should be a way to do so through the /proc but can't find that.

In particular I am looking for the GPIO registers of my atom z530 processor.

Thanks,

bastl 12-26-2009 05:11 PM

Read registers from shell - why ??
GPIO are not registers that are multiuseable leads of a chip.
They work like a network switch.
They are used by the CPU, controllers, bus, FPU inside your atom z530 chip and from other chips (north- and south-bridge, and other peripheral chips on a board).
The BIOS sets up the way the GPIOs work, user space software even with root privilege can't do there anything. That software can only imagine that a GPIO was in use but can't be sure and don't know it - thats top secret for that software - no chance!
Only a module can do what a BIOS also can do. And there are also things, that can be done only in real mode and switching back from protected to real mode isn't supported on IA-family-7 and following.

So describe your problem maybe we can find a solution.

yossibs 12-27-2009 03:04 AM

Thanks,

I have my own board with a connector which provides physical HW connection to the GPIO.
Then I am connecting my own device button to it which shall change its value from 1 to 0 and vice versa.

My application whishes to be notified on changes (polling is also enough).

Either I can write a ko module or to use general available apis (as I hoped provided through the system).

please advise.

Thanks

bastl 12-27-2009 06:19 AM

Yes I think you have to write a module in assembler because GPIOs can be used different on each mainboard (NASM, is the easiest way if you don't have a lot module programming experience in C).
Then look how to reach and set up the GPIO pin you connected to.
What I could find fast is:
http://www.arcobel.com/Arcobel/datas.../15mm01-ds.pdf
http://download.intel.com/design/pro...hts/319535.pdf
http://www.intel.com/products/atom/techdocs.htm
This is not much information. Maybe you can find more with the words:
intel semiconductor
datasheet
specification
pdf

Also think about if you want to set an IRQ on your GPIO but I think a check for the pin each second or half does the work.
If you don't have experience in programming assembler or C then I guess you have to learn the next 1-8 years til you get that module to work.


All times are GMT -5. The time now is 07:36 PM.