From dba9b7e53619e8d07e47319baaa62cd14e3f72c4 Mon Sep 17 00:00:00 2001 From: Mark Thompson <129641948+NotherNgineer@users.noreply.github.com> Date: Wed, 3 Apr 2024 14:09:27 -0500 Subject: [PATCH] Updated Building External Apps (markdown) --- Building-External-Apps.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Building-External-Apps.md b/Building-External-Apps.md index 228c5da..ad0a0ec 100644 --- a/Building-External-Apps.md +++ b/Building-External-Apps.md @@ -1,11 +1,10 @@ -# Building External Apps External apps are similar to internal apps in that they are compiled and linked with the rest of the firmware, but at the link stage a fake memory address range is specified for each external app in the "external.ld" file. After linking, the external apps are removed from the firmware image and extracted to separate files. Note that LTO optimization cannot be used when linking the external apps, to prevent the linker from attempting to share code between external apps. ## export_external_apps.py The export_external_app python script edits each external app image to (1) replace the fake memory addresses used during the linker stage with actual RAM addresses where the external app will be loaded to be executed, (2) append any needed baseband image, and (3) adds a file checksum to verify integrity during the untar process. ### External App Address Replacement -As example, if the fake address range of an app is 0xADC00000 to 0xADC07FFF, this python script will search the external app file for values in this range and replace them; it ASSUMES that they are pointers to memory addresses within this app. If the app image contains a value where the high byte is 0xAD but the next most significant byte is potentially an address within a different app, a warning message is displayed such as the following. This message implies that code within the indicated app may be attempting to use code within another app (but since the LTO optimization is disabled, it is most likely that this warning message is a false positive and the value found could just be a code instruction or raw data): +As example, if the fake address range of an app is 0xADC00000 to 0xADC07FFF, this python script will search the external app file for values in this range and replace them; it _assumes_ that they are pointers to memory addresses within this app. If the app image contains a value where the high byte is 0xAD but the next most significant byte is potentially an address within a different app, a warning message is displayed such as the following. This message implies that code within the indicated app may be attempting to use code within another app (but since the LTO optimization is disabled, it is most likely that this warning message is a false positive and the value found could just be a code instruction or raw data): ` WARNING: External code address 0xadb01234 at offset 0x1000 in tetris.himg`