From: Pratyush Yadav
Date: Thu, 4 Feb 2021 23:57:56 +0530
Subject: [PATCH v3 4/9] doc: Add a note about how to produce 'md' output
using hexdump
In-Reply-To: <20210204175551.2818757-5-sjg@chromium.org>
References: <20210204175551.2818757-1-sjg@chromium.org>
<20210204175551.2818757-5-sjg@chromium.org>
Message-ID: <20210204182754.xaq2iliyzgor4p57@ti.com>
List-Id:
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
To: u-boot@lists.denx.de
On 04/02/21 10:55AM, Simon Glass wrote:
> Comparing a hex dump on the U-Boot command line with the contents of a
> file on the host system is fairly easy and convenient to do manually if
> it is small. But the format used hexdump by default differs from that
> shown by U-Boot. Add a note about how to make them the same.
>
> (For large dumps, writing the data to the network with tftpput, or to a
> USB stick with ext4save is easiest.)
>
> Signed-off-by: Simon Glass
> ---
>
> Changes in v3:
> - Add this to the docs for the md command
>
> doc/usage/md.rst | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/doc/usage/md.rst b/doc/usage/md.rst
> index 3951b0d58f5..e9ea798f5fc 100644
> --- a/doc/usage/md.rst
> +++ b/doc/usage/md.rst
> @@ -39,6 +39,10 @@ length
> number of values to dump. Defaults to 40 (0d64). Note that this is not
> the same as the number of bytes, unless .b is used.
>
> +Note that the format of 'md' can be emulated from linux with::
s/md/md.b/
It won't emulate the output for md.w or md.l or md.q.
> +
> + hexdump -v -e '"%08.8_ax: " 16/1 "%02x " " "' -e '16/1 "%_p" "\n" '
This does not produce the _exact_ output. md.b sets offsets based on the
memory address being read from. For example, if I read from 0x80000000,
it will output something like:
80000000: 00 00 00 00 00 ...
Hexdump obviously does not know this address so it will produce
something like:
00000000: 00 00 00 00 00 ...
Dunno what to do about this though. Just figured I'd point it out.
> +
>
> Example
> -------
--
Regards,
Pratyush Yadav
Texas Instruments Inc.