hexdumping /dev/mem

Matías Perret Cantoni perretcantonim at gmail.com
Mon Mar 16 22:58:11 UTC 2015


2015-03-16 18:42 GMT-03:00 Thomas Skibo <thomasskibo at sbcglobal.net>:
>
>> On Mar 16, 2015, at 1:00 PM, Matías Perret Cantoni <perretcantonim at gmail.com> wrote:
>>
>> Hello!
>>
>> I'm trying to read a 32 bit register of the System Level Control
>> Registers of the ZedBoard (Zynq-7000 SoC) from a running FreeBSD. I
>> thought that I could simply do it with hexdump(1) to avoid writing a
>> driver since I only need to read it once. I've tried:
>>
>>
>> #hexdump -s 0xF8000910 -n 4 /dev/mem
>>
>>
>> and I get this message:
>>
>> hexdump: /dev/mem: Invalid argument
>>
>>
>> Reading some archives in this mailing list I've found that "the arm
>> version of /dev/mem is not functionally equivalent to that of amd64 or
>> i386.  Arm disallows access to non-DRAM addresses through /dev/mem”.
>
> That’s correct.  /dev/mem only reads from memory not devices.
>
> I always use kdb to peek/dump registers.  You have to translate the device addresses (use “show devmap” to see the mappings).
>

Looks like kdb is what I needed :). I don't even need hexdump. I guess
I'm learning pretty basic stuff here.

> But, once you know the kernel virtual addresses of the registers, you might be able to hexdump them through /dev/kmem.  (I don’t have a Zedboard in front of me to try that.)
>

I couldn't find any man page for "kdb" or "db", and the help command
of db didn't help much.

ddb(4) and the section "On-Line Kernel Debugging Using DDB" of the
developers-handbook were useful, but there's no clue about the show
devmap there. Is there any other documentation source that I can read
to find more about this?

And last, once I entered kdb, is there any way to go back to the
system without rebooting?

Thank you!

>>
>> Is there any other way of doing this? Maybe the whole idea of using
>> hexdump for this isn't really good.
>>
>>
>>
>> Thanks in advance.
>> Regards,
>> Matias.
>> _______________________________________________
>> freebsd-arm at freebsd.org mailing list
>> http://lists.freebsd.org/mailman/listinfo/freebsd-arm
>> To unsubscribe, send any mail to "freebsd-arm-unsubscribe at freebsd.org"
>
> -------
> Thomas Skibo
> thomasskibo at sbcglobal.net
>
>
>
>


More information about the freebsd-arm mailing list