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.
Using this toolchain:
riscv-collab/riscv-gnu-toolchain@c7fb153
SHA256 f9353bab5e826e937783c9ace7411375af9733c454d3d5f9f365509f2f7a4cdb.
make bootrom.bin
verifies the shasum.The toolchain given by @tmagik does seem to be close. The relaxation and general compilation is good, but there are a few differences in optimization and codegen. My goal was to make a few small patches that are easy to audit. I've almost succeeded with C tweaks and patching asm, but unfortunately
ux00boot_load_gpt_partition()
comes out wildly different so I've just embedded asm. (I'm bummed to not have a better solution, but at ~20 hours it's starting to not be fun, and I have other responsibilities...)ux00boot_ordered.c is made so I can re-order the code to match the image, without actually moving text in a way that would be hard to understand and audit.
Thanks to @SirCmpwn for the dts file, @esmil for misc things like some disassembly and segment alignment, and @tmagik for the pointer to a similar toolchain.
Edit: riscvarchive/riscv-gcc@07b59d4 looks related to the code I see in the shipped image, but using its parent commit or it, I can't seem to get a gcc that compiles the switch() like the ROM does.