LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How tot read registers in terminal (https://www.linuxquestions.org/questions/linux-newbie-8/how-tot-read-registers-in-terminal-4175470972/)

jinxin16897123 07-26-2013 02:48 AM

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.

moo-cow 07-27-2013 01:39 AM

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.

theNbomr 07-27-2013 12:23 PM

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.


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