You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The -C relocation-model=pie option for rustc will produce an executable where code and data are designed to be in the same region (i.e. RAM) and can be located anywhere provided their relative offsets remain the same.
This means we should be able to load a TSR if it has been compiled as pie. It could occupy the top part of RAM and hook itself into the OS, perhap by replacing one of the OS API functions with itself. This would require the OS API table to be in RAM, but that's plausible - it's not too large and we do have 4K of OS reserved RAM. It would also allow the loading of multiple programs simultaneously (e.g. running a linker during a compilation) without moving the first program out of the way so the second can have access to the usual start address (0x2000_1000).
The text was updated successfully, but these errors were encountered:
This is distinct from the "ropi-rwpi" model, where the RW data can be relocated separately to the RO code/data, and register R9 is used to tell the RO code where the RW data has been located. That doesn't apply here because we have the usual (for a microcontroller) case of code + data being together in RAM.
The
-C relocation-model=pie
option forrustc
will produce an executable where code and data are designed to be in the same region (i.e. RAM) and can be located anywhere provided their relative offsets remain the same.This means we should be able to load a TSR if it has been compiled as
pie
. It could occupy the top part of RAM and hook itself into the OS, perhap by replacing one of the OS API functions with itself. This would require the OS API table to be in RAM, but that's plausible - it's not too large and we do have 4K of OS reserved RAM. It would also allow the loading of multiple programs simultaneously (e.g. running a linker during a compilation) without moving the first program out of the way so the second can have access to the usual start address (0x2000_1000
).The text was updated successfully, but these errors were encountered: