mu/linux/bootstrap
Kartik K. Agaram d8d9dfa855 some hacky checks for common errors
They're not really baked into the regular compilation process; I have to
remember to run them if I see strange behavior.
2021-03-31 23:16:01 -07:00
..
tools 7842 - new directory organization 2021-03-03 22:21:03 -08:00
000organization.cc 7842 - new directory organization 2021-03-03 22:21:03 -08:00
001help.cc 7842 - new directory organization 2021-03-03 22:21:03 -08:00
002test.cc 7842 - new directory organization 2021-03-03 22:21:03 -08:00
003trace.cc 7842 - new directory organization 2021-03-03 22:21:03 -08:00
003trace.cc.filter 7842 - new directory organization 2021-03-03 22:21:03 -08:00
003trace.cc.rotate 7842 - new directory organization 2021-03-03 22:21:03 -08:00
003trace.test.cc 7842 - new directory organization 2021-03-03 22:21:03 -08:00
010vm.cc 7842 - new directory organization 2021-03-03 22:21:03 -08:00
011run.cc . 2021-03-29 18:47:52 -07:00
012elf.cc 7842 - new directory organization 2021-03-03 22:21:03 -08:00
013direct_addressing.cc 7842 - new directory organization 2021-03-03 22:21:03 -08:00
014indirect_addressing.cc 7842 - new directory organization 2021-03-03 22:21:03 -08:00
015immediate_addressing.cc 7842 - new directory organization 2021-03-03 22:21:03 -08:00
016index_addressing.cc 7842 - new directory organization 2021-03-03 22:21:03 -08:00
017jump_disp8.cc 7842 - new directory organization 2021-03-03 22:21:03 -08:00
018jump_disp32.cc 7842 - new directory organization 2021-03-03 22:21:03 -08:00
019functions.cc 7842 - new directory organization 2021-03-03 22:21:03 -08:00
020byte_addressing.cc 7842 - new directory organization 2021-03-03 22:21:03 -08:00
021div.cc 7842 - new directory organization 2021-03-03 22:21:03 -08:00
022float.cc 7842 - new directory organization 2021-03-03 22:21:03 -08:00
029syscalls.cc 7842 - new directory organization 2021-03-03 22:21:03 -08:00
030translate.cc 7842 - new directory organization 2021-03-03 22:21:03 -08:00
031transforms.cc 7842 - new directory organization 2021-03-03 22:21:03 -08:00
032operands.cc 7842 - new directory organization 2021-03-03 22:21:03 -08:00
033check_operands.cc some hacky checks for common errors 2021-03-31 23:16:01 -07:00
034check_operand_bounds.cc 7842 - new directory organization 2021-03-03 22:21:03 -08:00
035compute_segment_address.cc 7842 - new directory organization 2021-03-03 22:21:03 -08:00
036labels.cc 7842 - new directory organization 2021-03-03 22:21:03 -08:00
037global_variables.cc 7842 - new directory organization 2021-03-03 22:21:03 -08:00
038literal_strings.cc 7842 - new directory organization 2021-03-03 22:21:03 -08:00
039debug.cc 7842 - new directory organization 2021-03-03 22:21:03 -08:00
040tests.cc 7842 - new directory organization 2021-03-03 22:21:03 -08:00
README.md . 2021-03-09 00:43:59 -08:00
bootstrap some tweaks while updating mu-normie 2021-03-12 10:14:59 -08:00
build 7842 - new directory organization 2021-03-03 22:21:03 -08:00
build_and_test_until 7842 - new directory organization 2021-03-03 22:21:03 -08:00
clean 7842 - new directory organization 2021-03-03 22:21:03 -08:00
test_layers 7842 - new directory organization 2021-03-03 22:21:03 -08:00

README.md

This tool is 2 things:

a) An emulator for SubX, the subset of the 32-bit x86 instruction set used by Mu.

b) A second translator for SubX programs that emits identical binaries to the self-hosting versions in the parent directory. Having two diverse compilers (one in a familiar language, one with minimal syscall surface area) that emit identical binaries should help gain confidence in Mu.

Running

bootstrap currently has the following sub-commands:

  • bootstrap help: some helpful documentation to have at your fingertips.

  • bootstrap test: runs all automated tests.

  • bootstrap translate <input files> -o <output ELF binary>: translates .subx files into an executable ELF binary.

  • bootstrap run <ELF binary> <args>: simulates running the ELF binaries emitted by bootstrap translate. Useful for testing and debugging.

    Remember, not all 32-bit Linux binaries are guaranteed to run. I'm not building general infrastructure here for all of the x86 instruction set. SubX is about programming with a small, regular subset of 32-bit x86.