3 ms·
A lot depends on where "first stage" actually is, but if we look at grub for example: https://github.com/coreos/grub/tree/2.02-coreos/grub-core/boot/i386/pc htt
by pjc50 8y ago
A lot depends on where "first stage" actually is, but if we look at grub for example: https://github.com/coreos/grub/tree/2.02-coreos/grub-core/boot/i386/pc https://github.com/coreos/grub/tree/2.02-coreos/grub-core/bo...
The assembler isn't interleaved with C, it runs first; once the setup is complete, control is transferred to C. I think this is the pattern that should be followed as much as possible: small platform-specific bits, then switch to higher-level language runtime. Certainly as soon as you're parsing input or doing cryptography a high level language becomes an advantage (with the requirement to call back to low-level occasionally). Rust seems to be the closest match here.