LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 12-26-2009, 09:59 AM   #1
yossibs
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.

Thanks,
 
Old 12-26-2009, 05:11 PM   #2
bastl
Member
 
Registered: Sep 2003
Location: Germany/BW
Distribution: My own
Posts: 237

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, 03:04 AM   #3
yossibs
LQ Newbie
 
Registered: Dec 2009
Posts: 5

Original Poster
Rep: Reputation: 0
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
 
Old 12-27-2009, 06:19 AM   #4
bastl
Member
 
Registered: Sep 2003
Location: Germany/BW
Distribution: My own
Posts: 237

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:
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.
 
  


Reply



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 03:54 AM
Nice values of 0 and 19 get same amount of CPU frenk Linux - General 2 02-01-2006 03:51 AM
New cpu values in /proc/stat? eldonz Linux - General 1 10-19-2005 12:16 PM
How to read contents of CPU registers? irfanhab Programming 1 12-28-2004 08:04 AM
The RealTek chip appears to be active, so some registers will not be read. thep Linux - Networking 0 02-09-2003 11:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:21 AM.

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