Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Mar 2015 14:42:04 -0700
From:      Thomas Skibo <thomasskibo@sbcglobal.net>
To:        =?utf-8?Q?Mat=C3=ADas_Perret_Cantoni?= <perretcantonim@gmail.com>
Cc:        freebsd-arm@freebsd.org
Subject:   Re: hexdumping /dev/mem
Message-ID:  <29227F8C-4A83-4C95-9CD2-BA14E797A882@sbcglobal.net>
In-Reply-To: <CADLKG01HXRf9FE0JZ3hDdr6Ap-AbLM0r3TmhfLNOfwAUUqmbdA@mail.gmail.com>
References:  <CADLKG01HXRf9FE0JZ3hDdr6Ap-AbLM0r3TmhfLNOfwAUUqmbdA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

> On Mar 16, 2015, at 1:00 PM, Mat=C3=ADas Perret Cantoni =
<perretcantonim@gmail.com> wrote:
>=20
> Hello!
>=20
> 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:
>=20
>=20
> #hexdump -s 0xF8000910 -n 4 /dev/mem
>=20
>=20
> and I get this message:
>=20
> hexdump: /dev/mem: Invalid argument
>=20
>=20
> 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=E2=80=
=9D.

That=E2=80=99s 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 =E2=80=9Cshow devmap=E2=80=9D to see the =
mappings).

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

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

-------
Thomas Skibo
thomasskibo@sbcglobal.net







Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?29227F8C-4A83-4C95-9CD2-BA14E797A882>