summaryrefslogtreecommitdiffstats
path: root/memedit.1
blob: 4e8429eac5fd70065fb1ceb74a20e8a60bd0b27f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
.TH "memedit" "1" "0.6.0" "Pengutronix" "Development Tools"
.SH "NAME"
.LP 
memedit \- view and edit memory patterns 
.SH "SYNTAX"
.LP 
memedit [\fIoption\fP] <\fIfilename\fP>
.br 
.SH "DESCRIPTION"
.LP 
This program allows you to quickly display and change 
memory content for testing purpose as well as for various 
other development tasks. 
.SH "OPTIONS"
.LP 
.TP 
\fB\-\-startfile | \-s\fR <\fIbatchfile\fP>
Use <\fIbatchfile\fP> as startfile. 
.br 
This will execute all commands in  <\fIbatchfile\fP>
during startup. Output is written to stdout.
.br 
You may set Variables, map memory regions, 
load files, etc. Use of comments is possible anywhere in your 
startfile: Everything starting with a "#" up to the end of 
the line is treated as a comment. E.g.:
.br 
.br 
#
.br 
# Some Register
.br 
#
.br 
SR0 = 0x0   # Some Control / Status Register
.br 
.br
.TP
\fB\-\-readback | \-r\fR
readback on write (default on)
.TP 
\fB\-\-help | \-h\fR
Output help information and exit.
.TP 
\fB\-\-verbose | \-V \fR
Generate more verbose Output.
.TP 
\fB\-\-version | \-v\fR
Output version information and exit.
.SH "COMMANDS"
.LP 
memedit was built with libreadline support. So you can 
recall commands by typing \fIshift-up\fP/\fIshift-down\fP.
See readline(3) for Details.

memedit commands: 
.TP 
\fBo, open\fR <\fIfile\fP>
open <file>

.TP 
\fBc, close\fR
close currently opened file

.TP 
\fBmap\fR <\fIstart\fP> <\fIsize\fP>
map memory starting at physical address <start>
into working buffer

.TP 
\fBunmap\fR
unmap memory from working buffer

.TP 
\fBmd\fR [[@]<start> [<length>]]
mem display from current position
or from <start> for <length>

.TP 
\fBmd.b\fR [[@]<start> [<length>]]
see md - byte access

.TP 
\fBmd.w\fR [[@]<start> [<length>]]
see md - word access

.TP 
\fBmd.l\fR [[@]<start> [<length>]]
see md - long word access

.TP 
\fBmm\fR <offset> <val1> .. <valN>  
modify from value <offset>

.TP 
\fBmm.b\fR [[@]<start> [<length>]]
see mm - byte access

.TP 
\fBmm.w\fR [[@]<start> [<length>]]
see mm - word access

.TP 
\fBmm.l\fR [[@]<start> [<length>]]
see mm - long word access

.TP 
\fBmf\fR <start> <length> <value>
fill from <start> for <length> with <len>, can also be used with .b, .w, .l

.TP 
\fBe, env, printenv\fR  
print all currently defined variables

.TP 
\fB<var> = <expr>\fR
set variable <var> to <expr>

.TP 
\fB<var>\fR
print variable <var>

.TP 
\fB<var1> add <var2>\fR  |  \fB<var1> + <var2>\fR
add variables

.TP 
\fB<var1> sub <var2>\fR  |  \fB<var1> - <var2>\fR
substract variables

.TP 
\fB<var1> mul <var2>\fR  |  \fB<var1> * <var2>\fR
multiplicate variables


.TP 
\fB<var1> div <var2>\fR  |  \fB<var1> / <var2>\fR
divide variables

.TP 
\fB<var1> mod <var2>\fR  |  \fB<var1> % <var2>\fR
divide variables and return the remainder.

.TP 
\fB<var1> rshift <var2>\fR  |  \fB<var1> >> <var2>\fR
shift right


.TP 
\fB<var1> lshift <var2>\fR  |  \fB<var1> shift <var2>\fR  |  \fB<var1> << <var2>\fR
shift left

.TP
Variables can be entered as decimals (without prefix), hex (prefixed with 0x)
oct (0o) or bin (0b). 

.TP 
\fBq, x, exit, quit\fR
Leave application

.TP 
\fBh, help\fR                            
show this help text

.SH "FILES"
.LP 
\fI$PREFIX/bin/memedit\fP 
.br 

.SH "EXAMPLES"
.LP 
To run this program the standard way type:
.LP 
memedit /dev/mem
.br
memedit /tmp/foo
.LP 
Alternativly you can run it with a startfile:
.LP 
memedit \-s pxa\-regs /dev/mem 
.SH "AUTHORS"
.LP 
Primary author: Benedikt Spranger <b.spranger@linutronix.de>
.br 
Maintainer:     Robert Schwebel <r.schwebel@pengutronix.de> 
.br 
Contributor:    Sascha Hauer <s.hauer@pengutronix.de>
.br 
Documentation:  Bjoern Buerger <b.buerger@pengutronix.de>
.SH "SEE ALSO"
.LP 
fpga\-edit(1) readline(3)