Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootrom challenge #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

scintill
Copy link

@scintill scintill commented Sep 14, 2018

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.

Using this toolchain:
riscv-collab/riscv-gnu-toolchain@c7fb153

SHA256 f9353bab5e826e937783c9ace7411375af9733c454d3d5f9f365509f2f7a4cdb.
`make bootrom.bin` verifies the shasum.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant