diff options
author | Kartik Agaram <vc@akkartik.com> | 2021-01-24 19:38:10 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2021-01-24 20:16:27 -0800 |
commit | 3844651e49258a400ed81273f7cd620a14264386 (patch) | |
tree | ec050e286314f49945dd0b3f97e4aa839b1a67f5 /apps | |
parent | 1c77be68d75d8134bea72305057eb9ce523e9748 (diff) | |
download | mu-3844651e49258a400ed81273f7cd620a14264386.tar.gz |
7559 - reorganize sectors built in raw hex
This was tedious for three reasons beyond the usual one of having to track and update offsets several time while I debug: - The Bochs troubles of the previous commit kept polluting my brain even though they were irrelevant. - I had to keep some changes locally to allow myself to use Bochs, which polluted my working directory. - I had to travel the long way to the realization that I'm not actually initializing the stack anywhere. BIOS was starting my stack off at 0x10000, which was promptly clobbered by my second read from disk. The good news: while I'm here I grow the interrupt descriptor table. So I don't have to go through this exercise when I get back to supporting the mouse.
Diffstat (limited to 'apps')
-rwxr-xr-x | apps/survey_baremetal | bin | 51197 -> 51197 bytes | |||
-rw-r--r-- | apps/survey_baremetal.subx | 34 |
2 files changed, 17 insertions, 17 deletions
diff --git a/apps/survey_baremetal b/apps/survey_baremetal index 6c254711..3bddb653 100755 --- a/apps/survey_baremetal +++ b/apps/survey_baremetal Binary files differdiff --git a/apps/survey_baremetal.subx b/apps/survey_baremetal.subx index 7b0815ba..c42cd900 100644 --- a/apps/survey_baremetal.subx +++ b/apps/survey_baremetal.subx @@ -7,7 +7,7 @@ # # The expected input is a stream of bytes and some interspersed labels. # Comments and '==' segment headers are allowed, but ignored. The emitted code -# will all lie in a single header, and start at address 0x9000. +# will all lie in a single header, and start at address 0x9400. # $ cat x # == code # l1: @@ -197,7 +197,7 @@ test-subx-survey-computes-addresses: # 01 # # trace contains (in any order): - # label x is at address 0x9005 + # label x is at address 0x9405 # # . prologue 55/push-ebp @@ -315,10 +315,10 @@ test-subx-survey-computes-addresses: #? # . . discard args #? 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp #? # }}} - # . check-trace-contains("label 'x' is at address 0x00009005.", msg) + # . check-trace-contains("label 'x' is at address 0x00009405.", msg) # . . push args 68/push "F - test-subx-survey-computes-addresses/0"/imm32 - 68/push "label 'x' is at address 0x00009005."/imm32 + 68/push "label 'x' is at address 0x00009405."/imm32 # . . call e8/call check-trace-contains/disp32 # . . discard args @@ -330,7 +330,7 @@ test-subx-survey-computes-addresses: compute-offsets: # in: (addr stream byte), labels: (addr stream {(handle array byte), address}) # pseudocode: - # var current-address = 0x9000 + # var current-address = 0x9400 # var line: (stream byte 512) # while true # line loop # clear-stream(line) @@ -362,8 +362,8 @@ compute-offsets: # in: (addr stream byte), labels: (addr stream {(handle array 53/push-ebx 56/push-esi 57/push-edi - # var current-address/esi: int = 0x9000 - be/copy-to-esi 0x9000/imm32 + # var current-address/esi: int = 0x9400 + be/copy-to-esi 0x9400/imm32 # var line/ecx: (stream byte 512) 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0x200/imm32 # subtract from esp 68/push 0x200/imm32/size @@ -595,7 +595,7 @@ test-compute-offsets: # 34 # # trace contains (in any order): - # label 'x' is at address 0x9006. + # label 'x' is at address 0x9406. # # . prologue 55/push-ebp @@ -697,10 +697,10 @@ test-compute-offsets: #? # . . discard args #? 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp #? # }}} - # . check-trace-contains("label 'x' is at address 0x00009006.", msg) + # . check-trace-contains("label 'x' is at address 0x00009406.", msg) # . . push args 68/push "F - test-compute-offsets"/imm32 - 68/push "label 'x' is at address 0x00009006."/imm32 + 68/push "label 'x' is at address 0x00009406."/imm32 # . . call e8/call check-trace-contains/disp32 # . . discard args @@ -732,7 +732,7 @@ emit-output:datum: # slice emit-output: # in: (addr stream byte), out: (addr buffered-file), labels: (addr stream {(handle array byte), address}) # pseudocode: - # var address-of-next-instruction = 0x9000 + # var address-of-next-instruction = 0x9400 # var line: (stream byte 512) # line-loop: # while true @@ -803,8 +803,8 @@ emit-output: # in: (addr stream byte), out: (addr buffered-file), labels: (addr 68/push 0/imm32/end 68/push 0/imm32/start 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . . # copy esp to edx - # var address-of-next-instruction/ebx = 0x9000 - bb/copy-to-ebx 0x9000/imm32 + # var address-of-next-instruction/ebx = 0x9400 + bb/copy-to-ebx 0x9400/imm32 $emit-output:line-loop: # clear-stream(line) # . . push args @@ -1491,12 +1491,12 @@ test-emit-output-code-label: # ef gh # e8 l1/disp32 # labels: - # - 'l1': 0x9010 + # - 'l1': 0x9410 # # output: # ab cd # ef gh - # e8 07 00 00 00 # 0x9010 - 0x9009 = 7 + # e8 07 00 00 00 # 0x9410 - 0x9409 = 7 # # . prologue 55/push-ebp @@ -1566,8 +1566,8 @@ test-emit-output-code-label: e8/call write/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp - # . stream-add2(labels, "l1", 0x9010) - 68/push 0x9010/imm32/label-address + # . stream-add2(labels, "l1", 0x9410) + 68/push 0x9410/imm32/label-address # . . push handle for "l1" 53/push-ebx 68/push "l1"/imm32 |