table of contents
memtool(1) | General Commands Manual | memtool(1) |
NAME¶
memtool - display and modify memory
SYNOPSIS¶
memtool -V
memtool md [-b|-w|-l|-q] [-x]
[-s filename] region
memtool mw [-b|-w|-l|-q] [-d
filename] start data...
DESCRIPTION¶
memtool allows one to read and write regions of files. When applied to /dev/mem (which is the default file) the regions represent memory mapped registers.
There are currently two subcommands: mw to write to memory/a file; and md to read from memory/a file.
Usually memtool operates on files (regular or devices) using mmap(2). If filename is of the form mdio:ethname.id with ethname being the name of an ethernet device and id being an MDIO address, the phy with address id on the MDIO bus related to the ethernet device ethname is accessed instead. To prevent ambiguities when using the mmap access method, use mmap:filename as parameter.
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.
OPTIONS¶
- -V
- Dump memtool version and exit
COMMON OPTIONS FOR SUBCOMMANDS¶
- -b
- Use byte wise (8-bit) access
- -w
- Use word wise (16-bit) access
- -l
- Use long wise (32-bit) access
- -q
- Use quad wise (64-bit) access
- -d filename
- Write to filename.
- -s filename
- Read from filename.
- -x
- Swap bytes at output
REGIONS¶
Memory regions can be specified in two different forms:
- start[+size]
- start-end
start specifies the byte offset of the region's beginning, i.e. the first included address. size specifies the size of the region in bytes and defaults to 0x100. Alternatively 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 G, M, and k, which multiply by 1024^3, 1024^2, and 1024 respectively.
December 2015 | memtool - display and modify memory |