reticulatedpines / magiclantern_simplified

A Git based version of Magic Lantern, for those unwilling or unable to work using Mercurial. The vast majority of branches have been removed, with those thought to be important brought in individually and merged.
GNU General Public License v2.0
142 stars 47 forks source link

Rename away from ROMBASEADDR #136

Open reticulatedpines opened 4 months ago

reticulatedpines commented 4 months ago

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.