Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-26-2009, 10:59 AM   #1
LQ Newbie
Registered: Dec 2009
Posts: 5

Rep: Reputation: 0
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.

Old 12-26-2009, 06:11 PM   #2
Registered: Sep 2003
Location: Germany/BW
Distribution: My own
Posts: 235

Rep: Reputation: 22
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.
Old 12-27-2009, 04:04 AM   #3
LQ Newbie
Registered: Dec 2009
Posts: 5

Original Poster
Rep: Reputation: 0

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.

Old 12-27-2009, 07:19 AM   #4
Registered: Sep 2003
Location: Germany/BW
Distribution: My own
Posts: 235

Rep: Reputation: 22
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:
This is not much information. Maybe you can find more with the words:
intel semiconductor

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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to read values in trace files amna Linux - Newbie 1 03-06-2008 04:54 AM
Nice values of 0 and 19 get same amount of CPU frenk Linux - General 2 02-01-2006 04:51 AM
New cpu values in /proc/stat? eldonz Linux - General 1 10-19-2005 01:16 PM
How to read contents of CPU registers? irfanhab Programming 1 12-28-2004 09:04 AM
The RealTek chip appears to be active, so some registers will not be read. thep Linux - Networking 0 02-10-2003 12:41 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:54 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration