summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2015-12-08 09:48:37 +0100
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2015-12-08 21:22:10 +0100
commit48d557419521ce8f17815ad141636d308db951c0 (patch)
tree7240700a0f488b5578b4302626f68618d0368f0c
parente25550c6ac020ceca26a09e6b874f04a51df83dd (diff)
downloadmemtool-48d557419521ce8f17815ad141636d308db951c0.tar.gz
memtool-48d557419521ce8f17815ad141636d308db951c0.tar.xz
Provide a manpage
Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-rw-r--r--Makefile.am2
-rw-r--r--memtool.878
2 files changed, 80 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index d6e720e..778d241 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,3 +3,5 @@ EXTRA_DIST = README.devel
sbin_PROGRAMS = memtool
memtool_SOURCES = memtool.c
+
+dist_man_MANS = memtool.8
diff --git a/memtool.8 b/memtool.8
new file mode 100644
index 0000000..c79d3cd
--- /dev/null
+++ b/memtool.8
@@ -0,0 +1,78 @@
+.TH memtool "8" "December 2015" "memtool - display and modify memory"
+.SH NAME
+memtool \- display and modify memory
+.SH SYNOPSIS
+.B memtool md
+.RB [\| \-b \||\| \-w \||\| \-l \||\| \-q \|]
+.RB [\| \-x \|]
+.RB [\| \-s
+.IR filename \|]
+.I region
+.br
+.B memtool mw
+.RB [\| \-b \||\| \-w \||\| \-l \||\| \-q \|]
+.RB [\| \-d
+.IR filename \|]
+.I start
+.I data...
+
+.SH DESCRIPTION
+memtool allows one to read and write regions of files. When applied to
+.I /dev/mem
+(which is the default file) the regions represent memory mapped registers.
+.PP
+There are currently two subcommands:
+.B mw
+to write to memory/a file; and
+.B md
+to read from memory/a file.
+
+Note that on some machines there are alignment restrictions that forbid for
+example to read a word from an address that is not word aligned. memtool
+doesn't try to be smart here but simply tries what is requested by the caller.
+This might result in all kind of errors which are not considered to be a bug of
+the tool, but either the machine or the caller.
+
+.SH OPTIONS
+.TP
+.B \-b
+Use byte wise (8-bit) access
+.TP
+.B \-w
+Use word wise (16-bit) access
+.TP
+.B \-l
+Use long wise (32-bit) access
+.TP
+.BR \-q
+Use quad wise (64-bit) access
+.TP
+\fB\-d \fIfilename
+Write to
+.IR filename .
+.TP
+\fB\-s \fIfilename
+Read from
+.IR filename .
+.TP
+.B \-x
+Swap bytes at output
+
+.SH REGIONS
+Memory regions can be specified in two different forms:
+.TP
+\fIstart\fR[\fB+\fIsize\fR]
+.TP
+.IB start \- end
+.PP
+.I start
+specifies the byte offset of the region's beginning, i.e. the first included
+address.
+.I size
+specifies the size of the region in bytes and defaults to 0x100. Alternatively
+.I end
+specifies the offset of the last included address.
+Offsets can be specified in decimal or hexadecimal with a prefix 0x.
+Additionally you can use suffixes
+.BR G ", " M ", and " k ,
+which multiply by 1024^3, 1024^2, and 1024 respectively.