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

add alternative tcc bootstrap path #407

Draft
wants to merge 53 commits into
base: master
Choose a base branch
from

Conversation

cosinusoidally
Copy link

This is a draft PR that adds my alternative bootstrap path for tcc #355 . I've marked this as a draft as it is probably not yet in a state suitable for merging (eg I updated the ci to unconditionally enable the flag --tcc_bootstrap_alt but probably both the mes and tcc_bootstrap_alt path need testing automatically via ci). I also had some issues with nested conditionals in kaem that meant I needed to add some awkward combined conditionals (which also currently have bug that will break architectures other than x86/riscv). There may be a better way of doing that.

@cosinusoidally
Copy link
Author

cosinusoidally commented Jan 11, 2024

I think the ci job on the pr is testing the --tcc_bootstrap_alt route. I've kicked off a run of the mes route on my fork just to check I've not broken the standard path https://github.com/cosinusoidally/live-bootstrap/actions/runs/7489674266 (I have already tested a partial run of the standard path, but only up to tcc-0.9.27).

@cosinusoidally
Copy link
Author

Just pushed an updated version that computes sha sums as per our discussion on matrix. I had to split the tcc-0.9.26 hashes as some of them are only relevant to tcc-mes. I rebuilt the final version of tcc-0.9.26 a second time which caused the sha256sum to converge to the same value as the standard mes based bootstrap path. I couldn't get the same rebuild trick to work for tcc-boot0 and tcc-boot1 so I just ignore these hashes when the alt bootstrap path is enabled.

I've also added a separate ci step that tests my alt bootstrap path.

I've just noticed that my branch seems to break in qemu. It gets as far as the first call to cdrun here https://github.com/cosinusoidally/tcc_bootstrap_alt/blob/0.1/after.kaem#L20 and then crashes. I think it's failing around here https://github.com/cosinusoidally/tcc_bootstrap_alt/blob/0.1/tcc_js/cdrun.c#L48-L54 (based on the last thing printed to the terminal) . I'm guessing I may be hitting some issue in the chdir or execve syscall in builder-hex0

The command I used to generate my qemu image was something along the lines of:

./rootfs.py --bare-metal --target /tmp/build --tcc_bootstrap_alt

I used bare-metal as I was running the rootfs.py command inside a vm. I then grabbed the init.img file from /tmp/build and ran it inside a qemu vm on the host.

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