Comment by ValdikSS

2 days ago

Bootstapping is so complex, here's 181-step document to compile Linux: from "commented opcodes" in hex0 to assembler with labels, from simple C compiler to ~c89 compiler to tinycc ~c99 compiler, from simple shell to scheme interpreter to Fiwix unix-like kernel.

https://github.com/fosslinux/live-bootstrap/blob/master/part...

I have been reviewing stage0 and gave a presentation, 'reviewing live-bootstrap' about it at WHY2025, in which I also made some suggestions about improving stage0. I am now working on this.

What I refer to as stage0 is the first 19 steps of the mentioned description, which actually involves the execution of over 700 executables. (See presenration for T-diagran.) I believe that number can reduced by at least a half.

  • Please share me the youtube video regarding the presentation for bootstrapping as I find the idea of bootstrapping really pleasant and like I am most likely sure that although I am more an arch(cachy) personal user/debian for servers users. I feel like even these are adding reproducibility and I am sure that nixos can be reproducible https://news.ycombinator.com/item?id=38057591

    Guix can definitely be bootstrapped but there are comments on this post where someone tries to reproduce nix with tcc etc.

    Imagining the ability that nix can be completely bootstrapped makes me feel like it can be really good for these purposes

    Like if this is reproducible and bootstrappble, then I am satisfied with the hash because other people can test it out to verify they get the same hash and I can download the iso's and then verify the hash myself to find complete safety.

    Although I might still be trusting my linux iso but maybe we will have risc-v hardware where I can plug in an sd card or data or similar and it can give the hash of it for the extremely paranoid (maybe universities or very secure companies perhaps?)

    After that (or quite frankly just the hash part for 99% people), I can then flash the iso to any and every hardware with complete verification

    Although I feel like this still won't help if the firmware or the hardware itself can't be trusted. I mean even in corebooted chromebooks, the intel TPM only stops the ability of sending the bytecode over wire but it itself really can't be stopped. Maybe we will have risc-v machines but they would rather be really expensive.

    I think tho librebooted thinkpads + nixos/guix can be really great for privacy perhaps. But what are your reasons why bootstrappability fascinates you (for me its this stacking aspect and then finally we get some useful os without having to trust anything but source which we can read/heck even audit ourselves or have the shared faith that the source code is audited by security people since its completely readable)

Are they gonna keep doing this with Rust etc.?

  • The idea of bootstrapping is that you start with nothing, or at least with almost nothing. In case of stage0 (the first stage of live-bootstrap) this a small program that converts a file with hexadecimal characters (in pairs) to a binary file. From there you have to build everything. To compile Rust, you need a Rust or C compiler, I understand. I have no idea how hard it would be to build a minimal Rust compiler that could compile itself, one that not necessary performs all the checks that the (full) Rust compiler would do.

    I think that Rust is build as part of live-bootstrap, but at a much later stage when the latest version of the GNU C compiler has been build.