Compress firmware and self-extract on boot#604
Open
danngreen wants to merge 46 commits into
Open
Conversation
- newlib wrapper functions for free/free_r/realloc/realloc_r that check ptr and route
…a instead TLSF cannot easily be forced to align to > sizeof(void*), so instead we just force alignment in plugin arena
…(do not demangle)
Catches OOM in plugin's init() and also in loading the metadata. OOM in allocating space for the assets and/or the .so code are caught elsewhere
They are just printed to console, so a fatal error could cause a crash.
…llModule standin)
Because the preview buffer is shared between pages
-AbortRescue holds the jmp_buf, activates it when a context calls "arm()" -One AbortRescue can be active per context (previous one is swapped back in when one is destructed) -Disabled if malloc or tslf arena lock is held (hard crash if exception throws inside malloc/tslf alloc) -
If the module crashes/oom in its constructor, then we'll catch the abort()
Firmware uiimg is built normally, and then compressed with l4z. Then a small stub is prepended which contains the basic start code to launch a decompressor. This whole package is then given a uimg header and released. MP1-boot will load the compressed uimg to 0xCC000040 and run the stub, which decompressed to 0xD0000000. Then the uimg headers are walked and copied to the right places
Prevents blanking the splash image out when proper firmware starts up
… screen (don't reset bus if it ran)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Firmware uimg file is built normally, and then a separate project compresses it with LZ4 and tacks on a small stub that decompresses it. The whole package is then given a uimg header so the mp1-boot bootloader recognizes it and loads it as an executable. At that point the startup stub decompresses the image to a high address in RAM, and then walks the uimg headers just as mp1-boot would do, copying the images to the right place.
While the MMU is used, the state of the MMU and caches is restored after it's done, but before it jumps to the actual firmware entry point.
This is required now because the internal NOR flash chip only has 9.5MB allocated for firmware. We have been > 9.0MB for several versions now.