From b964fa586faee7d1c8e3e9ed7f52e08f3ab2d267 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 4 Mar 2021 00:24:24 -0800 Subject: [PATCH] 7847 --- README.md | 3 +-- boot.hex | 2 +- boot0.hex | 2 +- ex1.hex | 2 +- ex2.hex | 2 +- ex3.hex | 2 +- linux/103kernel-string-equal.subx | 4 ++-- linux/assort.subx | 4 ++-- linux/crenshaw2-1.subx | 12 ++++++------ linux/crenshaw2-1b.subx | 12 ++++++------ linux/dquotes.subx | 4 ++-- linux/ex1.subx | 4 ++-- linux/ex10.subx | 4 ++-- linux/ex11.subx | 4 ++-- linux/ex12.subx | 4 ++-- linux/ex13.subx | 4 ++-- linux/ex14.subx | 4 ++-- linux/ex2.subx | 4 ++-- linux/ex3.subx | 4 ++-- linux/ex4.subx | 4 ++-- linux/ex5.subx | 4 ++-- linux/ex6.subx | 4 ++-- linux/ex7.subx | 4 ++-- linux/ex8.subx | 4 ++-- linux/ex9.subx | 4 ++-- linux/factorial.subx | 6 +++--- linux/factorial2.subx | 4 ++-- linux/factorial3.subx | 4 ++-- linux/factorial4.subx | 4 ++-- linux/hex.subx | 4 ++-- linux/pack.subx | 4 ++-- linux/random.subx | 4 ++-- linux/sigils.subx | 16 ++++++++-------- linux/subx_debugging.md | 2 +- linux/survey_baremetal.subx | 4 ++-- linux/survey_elf.subx | 4 ++-- linux/tests.subx | 2 +- 37 files changed, 81 insertions(+), 82 deletions(-) diff --git a/README.md b/README.md index 9bbf91df..834cb158 100644 --- a/README.md +++ b/README.md @@ -200,8 +200,7 @@ If you're still reading, here are some more things to check out: - [Commandline reference for the bootstrap C++ program.](bootstrap.md) -- The [list of x86 opcodes](subx_opcodes) supported in SubX: `./bootstrap - help opcodes`. +- The [list of x86 opcodes](subx_opcodes) supported in SubX: `linux/bootstrap/bootstrap help opcodes`. - [Some details on the unconventional organization of this project.](http://akkartik.name/post/four-repos) diff --git a/boot.hex b/boot.hex index 6fa874c2..af730b94 100644 --- a/boot.hex +++ b/boot.hex @@ -9,7 +9,7 @@ # To convert to a disk image, first prepare a realistically sized disk image: # dd if=/dev/zero of=disk.img count=20160 # 512-byte sectors, so 10MB # Create initial sectors from this file: -# ./bootstrap run apps/hex < baremetal/boot.hex > boot.bin +# bootstrap/bootstrap run hex < baremetal/boot.hex > boot.bin # Translate other sectors into a file called a.img # Load all sectors into the disk image: # cat boot.bin a.img > disk.bin diff --git a/boot0.hex b/boot0.hex index adb320d1..197be1e7 100644 --- a/boot0.hex +++ b/boot0.hex @@ -11,7 +11,7 @@ # To convert to a disk image, first prepare a realistically sized disk image: # dd if=/dev/zero of=disk.img count=20160 # 512-byte sectors, so 10MB # Now fill in sectors: -# ./bootstrap run apps/hex < baremetal/boot0.hex > boot.bin +# bootstrap/bootstrap run hex < baremetal/boot0.hex > boot.bin # dd if=boot.bin of=disk.img conv=notrunc # To run: # qemu-system-i386 disk.img diff --git a/ex1.hex b/ex1.hex index 6f969f90..cb5f7e25 100644 --- a/ex1.hex +++ b/ex1.hex @@ -6,7 +6,7 @@ # To convert to a disk image, first prepare a realistically sized disk image: # dd if=/dev/zero of=disk.img count=20160 # 512-byte sectors, so 10MB # Load the program on the disk image: -# cat baremetal/boot.hex baremetal/ex1.hex |./bootstrap run apps/hex > a.bin +# cat baremetal/boot.hex baremetal/ex1.hex |bootstrap/bootstrap run hex > a.bin # dd if=a.bin of=disk.img conv=notrunc # To run: # qemu-system-i386 disk.img diff --git a/ex2.hex b/ex2.hex index 6c06565f..fb9cb971 100644 --- a/ex2.hex +++ b/ex2.hex @@ -3,7 +3,7 @@ # To run, first prepare a realistically sized disk image: # dd if=/dev/zero of=disk.img count=20160 # 512-byte sectors, so 10MB # Load the program on the disk image: -# cat baremetal/boot.hex baremetal/ex2.hex |./bootstrap run apps/hex > a.bin +# cat baremetal/boot.hex baremetal/ex2.hex |bootstrap/bootstrap run hex > a.bin # dd if=a.bin of=disk.img conv=notrunc # To run: # qemu-system-i386 disk.img diff --git a/ex3.hex b/ex3.hex index d3639948..58ccbffa 100644 --- a/ex3.hex +++ b/ex3.hex @@ -4,7 +4,7 @@ # To run, first prepare a realistically sized disk image: # dd if=/dev/zero of=disk.img count=20160 # 512-byte sectors, so 10MB # Load the program on the disk image: -# cat baremetal/boot.hex baremetal/ex3.hex |./bootstrap run apps/hex > a.bin +# cat baremetal/boot.hex baremetal/ex3.hex |bootstrap/bootstrap run hex > a.bin # dd if=a.bin of=disk.img conv=notrunc # To run: # qemu-system-i386 disk.img diff --git a/linux/103kernel-string-equal.subx b/linux/103kernel-string-equal.subx index 7e1b9d6f..842bf671 100644 --- a/linux/103kernel-string-equal.subx +++ b/linux/103kernel-string-equal.subx @@ -9,8 +9,8 @@ # string'. # # To run (from the subx directory): -# $ ./bootstrap translate 05[0-2]*.subx -o /tmp/tmp52 -# $ ./bootstrap run /tmp/tmp52 # runs a series of tests +# $ bootstrap/bootstrap translate 10[0-3]*.subx -o a.elf +# $ bootstrap/bootstrap run a.elf # runs a series of tests # ...... # all tests pass # # (We can't yet run the tests when given a "test" commandline argument, diff --git a/linux/assort.subx b/linux/assort.subx index c4a38410..96130ded 100644 --- a/linux/assort.subx +++ b/linux/assort.subx @@ -7,13 +7,13 @@ # because we don't know if they refer to the line above or the line below. # # To run: -# $ ./bootstrap translate init.linux [01]*.subx apps/subx-params.subx apps/assort.subx -o apps/assort +# $ bootstrap/bootstrap translate [01]*.subx apps/subx-params.subx apps/assort.subx -o apps/assort # $ cat x # == code # abc # == code # def -# $ cat x |./bootstrap run apps/assort +# $ cat x |bootstrap/bootstrap run assort # == code # abc # def diff --git a/linux/crenshaw2-1.subx b/linux/crenshaw2-1.subx index f52c9b64..5b70e53f 100644 --- a/linux/crenshaw2-1.subx +++ b/linux/crenshaw2-1.subx @@ -3,8 +3,8 @@ # except that we support hex digits. # # To run: -# $ ./bootstrap translate init.linux [01]*.subx apps/crenshaw2-1.subx -o apps/crenshaw2-1 -# $ echo '3' |./bootstrap run apps/crenshaw2-1 +# $ bootstrap/bootstrap translate [01]*.subx apps/crenshaw2-1.subx -o apps/crenshaw2-1 +# $ echo '3' |bootstrap/bootstrap run crenshaw2-1 # Expected output: # # syscall(exit, 3) # bb/copy-to-ebx 3/imm32 @@ -12,14 +12,14 @@ # cd/syscall 0x80/imm8 # # To run the generated output: -# $ echo '3' |./bootstrap run apps/crenshaw2-1 > z1.subx -# $ ./bootstrap translate init.linux z1.subx -o z1 -# $ ./bootstrap run z1 +# $ echo '3' |bootstrap/bootstrap run crenshaw2-1 > z1.subx +# $ bootstrap/bootstrap translate z1.subx -o z1 +# $ bootstrap/bootstrap run z1 # $ echo $? # 3 # # Stdin must contain just a single hex digit. Other input will print an error: -# $ echo 'xyz' |./bootstrap run apps/crenshaw2-1 +# $ echo 'xyz' |bootstrap/bootstrap run crenshaw2-1 # Error: integer expected # # Names in this file sometimes follow Crenshaw's original rather than my usual diff --git a/linux/crenshaw2-1b.subx b/linux/crenshaw2-1b.subx index 03233e29..fb8fd3b4 100644 --- a/linux/crenshaw2-1b.subx +++ b/linux/crenshaw2-1b.subx @@ -3,8 +3,8 @@ # except that we support hex numbers of multiple digits. # # To run: -# $ ./bootstrap translate init.linux [01]*.subx apps/crenshaw2-1b.subx -o apps/crenshaw2-1b -# $ echo '1a' |./bootstrap run apps/crenshaw2-1b +# $ bootstrap/bootstrap translate [01]*.subx apps/crenshaw2-1b.subx -o apps/crenshaw2-1b +# $ echo '1a' |bootstrap/bootstrap run crenshaw2-1b # Expected output: # # syscall(exit, 1a) # bb/copy-to-ebx 3/imm32 @@ -12,14 +12,14 @@ # cd/syscall 0x80/imm8 # # To run the generated output: -# $ echo '1a' |./bootstrap run apps/crenshaw2-1b > z1.subx -# $ ./bootstrap translate init.linux z1.subx -o z1 -# $ ./bootstrap run z1 +# $ echo '1a' |bootstrap/bootstrap run crenshaw2-1b > z1.subx +# $ bootstrap/bootstrap translate z1.subx -o z1 +# $ bootstrap/bootstrap run z1 # $ echo $? # 26 # 0x1a in decimal # # Stdin must contain just a single hex digit. Other input will print an error: -# $ echo 'xyz' |./bootstrap run apps/crenshaw2-1b +# $ echo 'xyz' |bootstrap/bootstrap run crenshaw2-1b # Error: integer expected # # Names in this file sometimes follow Crenshaw's original rather than my usual diff --git a/linux/dquotes.subx b/linux/dquotes.subx index 54349e18..07feb0cc 100644 --- a/linux/dquotes.subx +++ b/linux/dquotes.subx @@ -2,11 +2,11 @@ # Replace them with references to new variables in the data segment. # # To run: -# $ ./bootstrap translate init.linux [01]*.subx apps/subx-params.subx apps/dquotes.subx -o apps/dquotes +# $ bootstrap/bootstrap translate [01]*.subx apps/subx-params.subx apps/dquotes.subx -o apps/dquotes # $ cat x # == code # ab "cd ef"/imm32 -# $ cat x |./bootstrap run apps/dquotes +# $ cat x |bootstrap/bootstrap run dquotes # == code # ab __string1/imm32 # == data diff --git a/linux/ex1.subx b/linux/ex1.subx index d1968415..2316e17e 100644 --- a/linux/ex1.subx +++ b/linux/ex1.subx @@ -2,8 +2,8 @@ # Just return 42. # # To run: -# $ ./bootstrap translate init.linux apps/ex1.subx -o apps/ex1 -# $ ./bootstrap run apps/ex1 +# $ bootstrap/bootstrap translate apps/ex1.subx -o apps/ex1 +# $ bootstrap/bootstrap run ex1 # Expected result: # $ echo $? # 42 diff --git a/linux/ex10.subx b/linux/ex10.subx index 7ec86202..c62b32e2 100644 --- a/linux/ex10.subx +++ b/linux/ex10.subx @@ -1,8 +1,8 @@ # String comparison: return 1 iff the two args passed in at the commandline are equal. # # To run: -# $ ./bootstrap translate init.linux apps/ex10.subx -o apps/ex10 -# $ ./bootstrap run apps/ex10 abc abd +# $ bootstrap/bootstrap translate apps/ex10.subx -o apps/ex10 +# $ bootstrap/bootstrap run ex10 abc abd # Expected result: # $ echo $? # 0 # false diff --git a/linux/ex11.subx b/linux/ex11.subx index 9ff43a73..1d6f6fc4 100644 --- a/linux/ex11.subx +++ b/linux/ex11.subx @@ -6,8 +6,8 @@ # a null-terminated 'kernel string' with a size-prefixed 'SubX string'. # # To run: -# $ ./bootstrap translate init.linux apps/ex11.subx -o apps/ex11 -# $ ./bootstrap run apps/ex11 # runs a series of tests +# $ bootstrap/bootstrap translate apps/ex11.subx -o apps/ex11 +# $ bootstrap/bootstrap run ex11 # runs a series of tests # ...... # all tests pass # # (We can't yet run the tests when given a "test" commandline argument, diff --git a/linux/ex12.subx b/linux/ex12.subx index 0c0d4315..fa9e2b28 100644 --- a/linux/ex12.subx +++ b/linux/ex12.subx @@ -2,8 +2,8 @@ # Create a new segment using mmap, save the address, write to it. # # To run: -# $ ./bootstrap translate init.linux apps/ex12.subx -o apps/ex12 -# $ ./bootstrap run apps/ex12 +# $ bootstrap/bootstrap translate apps/ex12.subx -o apps/ex12 +# $ bootstrap/bootstrap run ex12 # You shouldn't get a segmentation fault. == code diff --git a/linux/ex13.subx b/linux/ex13.subx index b7e802fd..295e9d2f 100644 --- a/linux/ex13.subx +++ b/linux/ex13.subx @@ -1,8 +1,8 @@ # Compare 3 and 3. # # To run: -# $ ./bootstrap translate init.linux apps/ex13.subx -o apps/ex13 -# $ ./bootstrap run apps/ex13 +# $ bootstrap/bootstrap translate apps/ex13.subx -o apps/ex13 +# $ bootstrap/bootstrap run ex13 # Expected result: # $ echo $? # 1 diff --git a/linux/ex14.subx b/linux/ex14.subx index 74dd3809..bcf68641 100644 --- a/linux/ex14.subx +++ b/linux/ex14.subx @@ -1,8 +1,8 @@ # Multiply 2 numbers. # # To run: -# $ ./bootstrap translate init.linux apps/ex14.subx -o apps/ex14 -# $ ./bootstrap run apps/ex14 +# $ bootstrap/bootstrap translate apps/ex14.subx -o apps/ex14 +# $ bootstrap/bootstrap run ex14 # Expected result: # $ echo $? # 6 diff --git a/linux/ex2.subx b/linux/ex2.subx index 14007329..55aadbd4 100644 --- a/linux/ex2.subx +++ b/linux/ex2.subx @@ -1,8 +1,8 @@ # Add 3 and 4, and return the result in the exit code. # # To run: -# $ ./bootstrap translate init.linux apps/ex2.subx -o apps/ex2 -# $ ./bootstrap run apps/ex2 +# $ bootstrap/bootstrap translate apps/ex2.subx -o apps/ex2 +# $ bootstrap/bootstrap run ex2 # Expected result: # $ echo $? # 2 diff --git a/linux/ex3.subx b/linux/ex3.subx index d75db65a..caf6ef26 100644 --- a/linux/ex3.subx +++ b/linux/ex3.subx @@ -1,8 +1,8 @@ # Add the first 10 numbers, and return the result in the exit code. # # To run: -# $ ./bootstrap translate init.linux apps/ex3.subx -o apps/ex3 -# $ ./bootstrap run apps/ex3 +# $ bootstrap/bootstrap translate apps/ex3.subx -o apps/ex3 +# $ bootstrap/bootstrap run ex3 # Expected result: # $ echo $? # 55 diff --git a/linux/ex4.subx b/linux/ex4.subx index 72f03254..f054b748 100644 --- a/linux/ex4.subx +++ b/linux/ex4.subx @@ -1,8 +1,8 @@ # Read a character from stdin, save it to a global, write it to stdout. # # To run: -# $ ./bootstrap translate init.linux apps/ex4.subx -o apps/ex4 -# $ ./bootstrap run apps/ex4 +# $ bootstrap/bootstrap translate apps/ex4.subx -o apps/ex4 +# $ bootstrap/bootstrap run ex4 == data diff --git a/linux/ex5.subx b/linux/ex5.subx index a2b0eeba..a3b1acfb 100644 --- a/linux/ex5.subx +++ b/linux/ex5.subx @@ -1,8 +1,8 @@ # Read a character from stdin, save it to a local on the stack, write it to stdout. # # To run: -# $ ./bootstrap translate init.linux apps/ex5.subx -o apps/ex5 -# $ ./bootstrap run apps/ex5 +# $ bootstrap/bootstrap translate apps/ex5.subx -o apps/ex5 +# $ bootstrap/bootstrap run ex5 == code # instruction effective address register displacement immediate diff --git a/linux/ex6.subx b/linux/ex6.subx index 585362f1..32f10ab3 100644 --- a/linux/ex6.subx +++ b/linux/ex6.subx @@ -1,8 +1,8 @@ # Print out a (global variable) string to stdout. # # To run: -# $ ./bootstrap translate init.linux apps/ex6.subx -o apps/ex6 -# $ ./bootstrap run apps/ex6 +# $ bootstrap/bootstrap translate apps/ex6.subx -o apps/ex6 +# $ bootstrap/bootstrap run ex6 # Hello, world! == code diff --git a/linux/ex7.subx b/linux/ex7.subx index 73cb2720..5962c5f7 100644 --- a/linux/ex7.subx +++ b/linux/ex7.subx @@ -5,8 +5,8 @@ # the character read. # # To run: -# $ ./bootstrap translate init.linux apps/ex7.subx -o apps/ex7 -# $ ./bootstrap run apps/ex7 +# $ bootstrap/bootstrap translate apps/ex7.subx -o apps/ex7 +# $ bootstrap/bootstrap run ex7 # Expected result: # $ echo $? # 97 diff --git a/linux/ex8.subx b/linux/ex8.subx index 84d27195..5a08b039 100644 --- a/linux/ex8.subx +++ b/linux/ex8.subx @@ -1,8 +1,8 @@ # Example reading commandline arguments: compute length of first arg. # # To run: -# $ ./bootstrap translate init.linux apps/ex8.subx -o apps/ex8 -# $ ./bootstrap run apps/ex8 abc de fghi +# $ bootstrap/bootstrap translate apps/ex8.subx -o apps/ex8 +# $ bootstrap/bootstrap run ex8 abc de fghi # Expected result: # $ echo $? # 3 # length of 'abc' diff --git a/linux/ex9.subx b/linux/ex9.subx index 232178a0..594c9575 100644 --- a/linux/ex9.subx +++ b/linux/ex9.subx @@ -4,8 +4,8 @@ # letter of second arg. # # To run: -# $ ./bootstrap translate init.linux apps/ex9.subx -o apps/ex9 -# $ ./bootstrap run apps/ex9 z x +# $ bootstrap/bootstrap translate apps/ex9.subx -o apps/ex9 +# $ bootstrap/bootstrap run ex9 z x # Expected result: # $ echo $? # 2 diff --git a/linux/factorial.subx b/linux/factorial.subx index b4f8888b..8dddbd4d 100644 --- a/linux/factorial.subx +++ b/linux/factorial.subx @@ -1,14 +1,14 @@ ## compute the factorial of 5, and print the result # # To run: -# $ ./bootstrap translate init.linux [01]*.subx apps/factorial.subx -o apps/factorial -# $ ./bootstrap run apps/factorial +# $ bootstrap/bootstrap translate [01]*.subx apps/factorial.subx -o apps/factorial +# $ bootstrap/bootstrap run factorial # Expected result: # $ echo $? # 120 # # You can also run the automated test suite: -# $ ./bootstrap run apps/factorial test +# $ bootstrap/bootstrap run factorial test # Expected output: # ........ # Every '.' indicates a passing test. Failing tests get a 'F'. diff --git a/linux/factorial2.subx b/linux/factorial2.subx index 22c3d5be..3ef160e1 100644 --- a/linux/factorial2.subx +++ b/linux/factorial2.subx @@ -5,13 +5,13 @@ # # To run: # $ ./translate_subx init.linux [01]*.subx apps/factorial.subx -o apps/factorial -# $ ./bootstrap run apps/factorial +# $ bootstrap/bootstrap run factorial # Expected result: # $ echo $? # 120 # # You can also run the automated test suite: -# $ ./bootstrap run apps/factorial test +# $ bootstrap/bootstrap run factorial test # Expected output: # ........ # Every '.' indicates a passing test. Failing tests get a 'F'. diff --git a/linux/factorial3.subx b/linux/factorial3.subx index 82d59b5e..5f96477d 100644 --- a/linux/factorial3.subx +++ b/linux/factorial3.subx @@ -6,13 +6,13 @@ # # To run: # $ ./translate_subx init.linux [01]*.subx apps/factorial.subx -o apps/factorial -# $ ./bootstrap run apps/factorial +# $ bootstrap/bootstrap run factorial # Expected result: # $ echo $? # 120 # # You can also run the automated test suite: -# $ ./bootstrap run apps/factorial test +# $ bootstrap/bootstrap run factorial test # Expected output: # ........ # Every '.' indicates a passing test. Failing tests get a 'F'. diff --git a/linux/factorial4.subx b/linux/factorial4.subx index a22c7246..41de8736 100644 --- a/linux/factorial4.subx +++ b/linux/factorial4.subx @@ -7,13 +7,13 @@ # # To run: # $ ./translate_subx init.linux [01]*.subx apps/factorial.subx -o apps/factorial -# $ ./bootstrap run apps/factorial +# $ bootstrap/bootstrap run factorial # Expected result: # $ echo $? # 120 # # You can also run the automated test suite: -# $ ./bootstrap run apps/factorial test +# $ bootstrap/bootstrap run factorial test # Expected output: # ........ # Every '.' indicates a passing test. Failing tests get a 'F'. diff --git a/linux/hex.subx b/linux/hex.subx index 5a86f8ec..ae80a13d 100644 --- a/linux/hex.subx +++ b/linux/hex.subx @@ -3,8 +3,8 @@ # comments between '#' and newline. # # To run: -# $ ./bootstrap translate init.linux [01]*.subx apps/subx-params.subx apps/hex.subx -o apps/hex -# $ echo '80 81 82 # comment' |./bootstrap run apps/hex |xxd - +# $ bootstrap/bootstrap translate [01]*.subx apps/subx-params.subx apps/hex.subx -o apps/hex +# $ echo '80 81 82 # comment' |bootstrap/bootstrap run hex |xxd - # Expected output: # 00000000: 8081 82 # diff --git a/linux/pack.subx b/linux/pack.subx index 39848f25..85b86511 100644 --- a/linux/pack.subx +++ b/linux/pack.subx @@ -3,8 +3,8 @@ # uses are left untouched. # # To run: -# $ ./bootstrap translate init.linux [01]*.subx apps/subx-params.subx apps/pack.subx -o apps/pack -# $ echo '05/add-to-eax 0x20/imm32' |./bootstrap run apps/pack +# $ bootstrap/bootstrap translate [01]*.subx apps/subx-params.subx apps/pack.subx -o apps/pack +# $ echo '05/add-to-eax 0x20/imm32' |bootstrap/bootstrap run pack # Expected output: # 05 20 00 00 00 # 05/add-to-eax 0x20/imm32 # The original instruction gets included as a comment at the end of each diff --git a/linux/random.subx b/linux/random.subx index 71012309..7e9c0f0e 100644 --- a/linux/random.subx +++ b/linux/random.subx @@ -1,8 +1,8 @@ # Repeatedly read 32-bit numbers from /dev/random, print them to stdout. # # To run: -# $ ./bootstrap translate init.linux [01]*.subx apps/random.subx -o apps/random -# $ ./bootstrap run apps/random +# $ bootstrap/bootstrap translate [01]*.subx apps/random.subx -o apps/random +# $ bootstrap/bootstrap run random == code 0x09000000 # instruction effective address register displacement immediate diff --git a/linux/sigils.subx b/linux/sigils.subx index 31d074af..d980b32f 100644 --- a/linux/sigils.subx +++ b/linux/sigils.subx @@ -2,36 +2,36 @@ # arguments. # # To run: -# $ ./bootstrap translate init.linux [012]*.subx apps/subx-params.subx apps/sigils.subx -o apps/sigils +# $ bootstrap/bootstrap translate [012]*.subx apps/subx-params.subx apps/sigils.subx -o apps/sigils # # We currently support the following notations: # # 1. -# $ echo '%eax' | ./bootstrap run apps/sigils +# $ echo '%eax' | bootstrap/bootstrap run sigils # 3/mod 0/rm32 # # 2. -# $ echo '*eax' | ./bootstrap run apps/sigils +# $ echo '*eax' | bootstrap/bootstrap run sigils # 0/mod 0/rm32 # # 3. -# $ echo '*(eax+4)' | ./bootstrap run apps/sigils +# $ echo '*(eax+4)' | bootstrap/bootstrap run sigils # 2/mod 0/rm32 4/disp32 # # 4. -# $ echo '*(eax+ecx)' | ./bootstrap run apps/sigils +# $ echo '*(eax+ecx)' | bootstrap/bootstrap run sigils # 0/mod 4/rm32 0/base 1/index 0/scale # # 5. -# $ echo '*(eax+ecx+4)' | ./bootstrap run apps/sigils +# $ echo '*(eax+ecx+4)' | bootstrap/bootstrap run sigils # 2/mod 4/rm32 0/base 1/index 0/scale 4/disp32 # # 6. -# $ echo '*(eax+ecx<<2+4)' | ./bootstrap run apps/sigils +# $ echo '*(eax+ecx<<2+4)' | bootstrap/bootstrap run sigils # 2/mod 4/rm32 0/base 1/index 2/scale 4/disp32 # # 7. -# $ echo '*Foo' | ./bootstrap run apps/sigils +# $ echo '*Foo' | bootstrap/bootstrap run sigils # 0/mod 5/rm32/.disp32 Foo/disp32 # # TODO: *(Foo+ecx<<2) diff --git a/linux/subx_debugging.md b/linux/subx_debugging.md index e179df54..aa2e8041 100644 --- a/linux/subx_debugging.md +++ b/linux/subx_debugging.md @@ -29,7 +29,7 @@ rudimentary but hopefully still workable toolkit: ``` $ cd linux $ ./translate_subx_debug file1.subx file2.subx ... # generating a.elf - $ ./bootstrap --trace run a.elf arg1 arg2 + $ bootstrap/bootstrap --trace run a.elf arg1 arg2 saving trace to 'last_run' ``` diff --git a/linux/survey_baremetal.subx b/linux/survey_baremetal.subx index c42cd900..a37567dc 100644 --- a/linux/survey_baremetal.subx +++ b/linux/survey_baremetal.subx @@ -3,7 +3,7 @@ # Use the addresses assigned to replace labels. # # To build: -# $ ./bootstrap translate init.linux [01]*.subx apps/subx-params.subx apps/survey_baremetal.subx -o apps/survey_baremetal +# $ bootstrap/bootstrap translate [01]*.subx apps/subx-params.subx apps/survey_baremetal.subx -o apps/survey_baremetal # # The expected input is a stream of bytes and some interspersed labels. # Comments and '==' segment headers are allowed, but ignored. The emitted code @@ -22,7 +22,7 @@ # The output is the stream of bytes without segment headers or label definitions, # and with label references replaced with numeric values/displacements. # -# $ cat x |./bootstrap run apps/survey_baremetal +# $ cat x |bootstrap/bootstrap run survey_baremetal # aa bb nn # some computed address # cc dd nn nn nn nn # some computed displacement # ee nn nn nn nn # address right after this instruction diff --git a/linux/survey_elf.subx b/linux/survey_elf.subx index ac2f05b4..dcaf6bab 100644 --- a/linux/survey_elf.subx +++ b/linux/survey_elf.subx @@ -5,7 +5,7 @@ # b) add an ELF header and segment headers with addresses and offsets correctly filled in # # To build: -# $ ./bootstrap translate init.linux [01]*.subx apps/subx-params.subx apps/survey_elf.subx -o apps/survey_elf +# $ bootstrap/bootstrap translate [01]*.subx apps/subx-params.subx apps/survey_elf.subx -o apps/survey_elf # # The expected input is a stream of bytes with '==' segment headers, comments # and some interspersed labels. @@ -23,7 +23,7 @@ # The output is the stream of bytes without segment headers or label definitions, # and with label references replaced with numeric values/displacements. # -# $ cat x |./bootstrap run apps/survey_elf +# $ cat x |bootstrap/bootstrap run survey_elf # ...ELF header bytes... # # ELF header above will specify that code segment begins at this offset # aa bb nn # some computed address diff --git a/linux/tests.subx b/linux/tests.subx index eb8eb937..543e488d 100644 --- a/linux/tests.subx +++ b/linux/tests.subx @@ -2,7 +2,7 @@ # all functions starting with 'test-'. # # To build: -# $ ./bootstrap translate init.linux [01]*.subx apps/subx-params.subx apps/tests.subx -o apps/tests +# $ bootstrap/bootstrap translate [01]*.subx apps/subx-params.subx apps/tests.subx -o apps/tests == code # instruction effective address register displacement immediate