User Tools

Site Tools


reverse_engineering:ghidra:memory_map

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
reverse_engineering:ghidra:memory_map [2022/03/13 15:50]
kitor
reverse_engineering:ghidra:memory_map [2022/03/13 19:47] (current)
kitor [QEMU]
Line 14: Line 14:
  
 Visual explanation may make more sense. Image below contains a complete memory map for EOS R 1.8.0 (7.3.9) ROM. Visual explanation may make more sense. Image below contains a complete memory map for EOS R 1.8.0 (7.3.9) ROM.
-Cacheable RAM mirror on this model is available between ''0x40000000'' and ''0xBFFFFFFF''.+Uncacheable RAM mirror on this model is available between ''0x40000000'' and ''0xBFFFFFFF''.
  
 Because DryOS loads some chunks into locations inside that region (see ''0x40100000'' and ''40700000''), those were added to a memory map first. Because DryOS loads some chunks into locations inside that region (see ''0x40100000'' and ''40700000''), those were added to a memory map first.
Line 54: Line 54:
   * ''count='' is the length of copied data ''0x400''   * ''count='' is the length of copied data ''0x400''
  
-Thus in this example, data from ''0x400'' bytes from ''0xE00088F0'' (''0xE0000000 + 0x88F0'') was copied to ''0xDF001000''+Thus in this example, ''0x400'' data bytes from ''0xE00088F0'' (''0xE0000000 + 0x88F0'') was copied to ''0xDF001000''
  
 === Extracting chunks === === Extracting chunks ===
Line 99: Line 99:
 | -              | <del>''0xdf00339c''</del> | <del>''0xdf0033a8''</del> | <del>ram erase</del>     | | -              | <del>''0xdf00339c''</del> | <del>''0xdf0033a8''</del> | <del>ram erase</del>     |
  
 +===== Adding ROMCOPY regions to Memory Map =====
  
 +As mentioned before, there are two methods to add a ROMCOPY region to memory map.
 +
 +Both methods are equally good, so select which one is easier for you.
 +
 +You will need to repeat this step for each ROMCOPY region.
 +
 +==== via Memory map: ====
 +
 +In ''Window -> Memory Map'' click green "+" symbol. This will open ''Add Memory Block'' panel.
 +
 +  * Block Types: select "Byte mapped"
 +  * Source address: self explanatory
 +  * Start address: start of "destination" block"
 +  * Length: length of a block (note: it will accept input as decimal if you don't use ''0x'' prefix
 +  * Block name: Something meaningful, like a memory address
 +  * Select Read,Write,Execute flags.
 +
 +==== via "Add to program": ====
 +
 +Go to ''File -> Add to program''. Select file extracted from ROM (eg with ''romcpy.sh''). Proceed like in case of adding 2nd ROM.
 +
 +===== Defining rest of the memory map =====
 +
 +As explained before, ther regions (notably: RAM) will overlap with ROMCOPY regions defined in previous steps.
 +
 +==== Source of data ====
 +
 +As a rule of thumb:
 +  * RAM starts at ''0x40000000''
 +  * There's a mirror of RAM available at ''0x00000000''
 +  * Size of RAM depends on model.
 +  * ''0xCxxxxxxx'' and ''0xDxxxxxxx'' are ranges where most devices live
 +
 +Memory map for [[https://www.magiclantern.fm/forum/index.php?topic=19737.msg212603#msg212603|Digic 7]] [[https://www.magiclantern.fm/forum/index.php?topic=22770.msg212090#msg212090|Digic 8]] [[https://www.magiclantern.fm/forum/index.php?topic=24827.msg230859#msg230859|Digic X]]
 +
 +==== Adding regions ====
 +
 +As a reminder: Regions (mostly RAM) will overlap with ROMCOPY regions defined earlier. Unfortunately that is not possible ("overlay" option does not apply for that case), so you will need to split continuous blocks to fill around already defined ROMCOPY chunks.
 +
 +In ''Window -> Memory Map'' click green "+" symbol. This will open ''Add Memory Block'' panel.
 +
 +  * Block Types: leave "Default"
 +  * Start address: start of memory block
 +  * Length: length of a block (note: it will accept input as decimal if you don't use ''0x'' prefix
 +  * Block name: Something meaningful, like a memory address
 +  * Select Read,Write flags
 +  * Leave "Uninitialized"
  
reverse_engineering/ghidra/memory_map.1647183014.txt.gz ยท Last modified: 2022/03/13 15:50 by kitor