md.rst 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. .. SPDX-License-Identifier: GPL-2.0+:
  2. md command
  3. ==========
  4. Synopis
  5. -------
  6. ::
  7. md <address>[<data_size>] [<length>]
  8. Description
  9. -----------
  10. The md command is used to dump the contents of memory. It uses a standard
  11. format that includes the address, hex data and ASCII display. It supports
  12. various data sizes and uses the endianness of the target.
  13. The specified data_size and length become the defaults for future memory
  14. commands commands.
  15. address
  16. start address to display
  17. data_size
  18. size of each value to display (defaults to .l):
  19. ========= ===================
  20. data_size Output size
  21. ========= ===================
  22. .b byte
  23. .w word (16 bits)
  24. .l long (32 bits)
  25. .q quadword (64 bits)
  26. ========= ===================
  27. length
  28. number of values to dump. Defaults to 40 (0d64). Note that this is not
  29. the same as the number of bytes, unless .b is used.
  30. Note that the format of 'md.b' can be emulated from linux with::
  31. # This works but requires using sed to get the extra spaces
  32. # <addr> is the address, <f> is the filename
  33. xxd -o <addr> -g1 <f> |sed 's/ / /' >bad
  34. # This uses a single tool but the offset always starts at 0
  35. # <f> is the filename
  36. hexdump -v -e '"%08.8_ax: " 16/1 "%02x " " "' -e '16/1 "%_p" "\n" ' <f>
  37. Example
  38. -------
  39. ::
  40. => md 10000
  41. 00010000: 00010000 00000000 f0f30f00 00005596 .............U..
  42. 00010010: 10011010 00000000 10011010 00000000 ................
  43. 00010020: 10011050 00000000 b96d4cd8 00007fff P........Lm.....
  44. 00010030: 00000000 00000000 f0f30f18 00005596 .............U..
  45. 00010040: 10011040 00000000 10011040 00000000 @.......@.......
  46. 00010050: b96d4cd8 00007fff 10011020 00000000 .Lm..... .......
  47. 00010060: 00000003 000000c3 00000000 00000000 ................
  48. 00010070: 00000000 00000000 f0e892f3 00005596 .............U..
  49. 00010080: 00000000 000000a1 00000000 00000000 ................
  50. 00010090: 00000000 00000000 f0e38aa6 00005596 .............U..
  51. 000100a0: 00000000 000000a6 00000022 00000000 ........".......
  52. 000100b0: 00000001 00000000 f0e38aa1 00005596 .............U..
  53. 000100c0: 00000000 000000be 00000000 00000000 ................
  54. 000100d0: 00000000 00000000 00000000 00000000 ................
  55. 000100e0: 00000000 00000000 00000000 00000000 ................
  56. 000100f0: 00000000 00000000 00000000 00000000 ................
  57. => md.b 10000
  58. 00010000: 00 00 01 00 00 00 00 00 00 0f f3 f0 96 55 00 00 .............U..
  59. 00010010: 10 10 01 10 00 00 00 00 10 10 01 10 00 00 00 00 ................
  60. 00010020: 50 10 01 10 00 00 00 00 d8 4c 6d b9 ff 7f 00 00 P........Lm.....
  61. 00010030: 00 00 00 00 00 00 00 00 18 0f f3 f0 96 55 00 00 .............U..
  62. => md.b 10000 10
  63. 00010000: 00 00 01 00 00 00 00 00 00 0f f3 f0 96 55 00 00 .............U..
  64. =>
  65. 00010010: 10 10 01 10 00 00 00 00 10 10 01 10 00 00 00 00 ................
  66. =>
  67. 00010020: 50 10 01 10 00 00 00 00 d8 4c 6d b9 ff 7f 00 00 P........Lm.....
  68. =>
  69. => md.q 10000
  70. 00010000: 0000000000010000 00005596f0f30f00 .............U..
  71. 00010010: 0000000010011010 0000000010011010 ................
  72. 00010020: 0000000010011050 00007fffb96d4cd8 P........Lm.....
  73. 00010030: 0000000000000000 00005596f0f30f18 .............U..
  74. 00010040: 0000000010011040 0000000010011040 @.......@.......
  75. 00010050: 00007fffb96d4cd8 0000000010011020 .Lm..... .......
  76. 00010060: 000000c300000003 0000000000000000 ................
  77. 00010070: 0000000000000000 00005596f0e892f3 .............U..
  78. The empty commands cause a 'repeat', so that md shows the next available data
  79. in the same format as before.
  80. Return value
  81. ------------
  82. The return value $? is always 0 (true).