magiclantern_simplified icon indicating copy to clipboard operation
magiclantern_simplified copied to clipboard

Rename away from ROMBASEADDR

Open reticulatedpines opened this issue 11 months ago • 0 comments

ROMBASEADDR is deceptive; it's not a base address, and it's definitely not the base address of the rom. This causes many people to locate their rom dumps at e.g. 0xe004_0000 on Digic 7 cams, when the actual base address is 0xe000_0000.

Currently we label the function at 0xe004_0000 as firmware_entry(). This is not terrible, but also a little deceptive, it's not truly an entry point. On Digic 7 cams the earliest code we know that runs is at 0xe000_0000, which jumps to bootloader like code, which if early checks succeed, jumps to firmware_entry(). We know 0xe004_0000 is the start of a block, it's packaged this way in FIR files.

Rename both of these to be less deceptive, and consistent. Proposal is firmware_start and dryos_start, as 0xe000_0000 and 0xe004_0000 respectively. This differs per cam model, 0xff0c_0000 on D45 would be dryos_start, 0xffff_0000 is firmware_start.

Refactor a bunch of stuff in code, but also docs and comments. Hopefully, ROMBASEADDR can be retired entirely, since we don't tend to care about where the rom itself is loaded.

reticulatedpines avatar Mar 04 '24 12:03 reticulatedpines