Review your favorite Linux distribution.
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 07-26-2013, 03:48 AM   #1
LQ Newbie
Registered: Aug 2011
Location: Shanghai,China
Posts: 9

Rep: Reputation: Disabled
How tot read registers in terminal

Hi, there
I want to known if there is a way to read registers through hexdump&/dev/mem,
Thank you very much.
Old 07-27-2013, 02:39 AM   #2
Registered: Mar 2006
Distribution: Debian
Posts: 105

Rep: Reputation: 26
You mean CPU registers? /dev/mem is an image of the computer's main memory, so that's not what you're looking for. You can read the contents of CPU registers using a debugger such as gdb, or you can write a program in assembly that will output register contents on the terminal.
1 members found this post helpful.
Old 07-27-2013, 01:23 PM   #3
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,397
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
It would really be pointless to look at CPU registers from the shell level. By the time you saw the values, they would have changed a gzillion times. If you are talking about seeing the values of memory mapped IO registers, or IO-space registers of x86 CPUs, then you should be able to write a simple program that uses the /dev/mem or /dev/port facility, and call it from a shell commandline. That would require root privileges.
A debugger such as gdb will expose such data as moo-cow has already pointed out.
--- rod.
1 members found this post helpful.


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
Dump SDIO commands (Buffers/blocks and registers Read/Write) lightydo Linux - Hardware 0 11-06-2012 08:42 AM
how to read cpu registers values from shell? yossibs Linux - Newbie 3 12-27-2009 07:19 AM
Convert e2fs tot e3fs mijohnst Linux - Software 1 12-01-2005 01:05 AM
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 05:32 AM.

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