Skip to content

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.

@nyabinary
Copy link

so whatever happened to this?

@cosinusoidally
Copy link
Author

My branch is well behind master now. In theory my https://github.com/cosinusoidally/live-bootstrap/tree/refs/heads/tcc_bootstrap_alt-refactor_nov24 branch will still work, but it's not in a mergeable state (actually it's not working https://github.com/cosinusoidally/live-bootstrap/actions/runs/18311814155/job/52141979882 I think https://files.bootstrapping.world/ might be down atm). I did create a variant of #524 which is much shorter simpler than the earlier approach I took in this PR, but my variant of the pnut PR is also not in a mergeable state. I may eventually create a new PR with my updated approach, but I might not get to that for a while.

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.

2 participants