treat boot.hex as a SubX file
This commit is contained in:
parent
43e8194435
commit
da438fa9f5
4
ex1.subx
4
ex1.subx
|
@ -4,11 +4,11 @@
|
||||||
# graphics mode.
|
# graphics mode.
|
||||||
#
|
#
|
||||||
# To build a disk image:
|
# To build a disk image:
|
||||||
# ./translate_subx ex2.subx # emits disk.img
|
# ./translate_subx boot.hex ex2.subx # emits disk.img
|
||||||
# To run:
|
# To run:
|
||||||
# qemu-system-i386 disk.img
|
# qemu-system-i386 disk.img
|
||||||
# Or:
|
# Or:
|
||||||
# bochs -f baremetal/boot.bochsrc # boot.bochsrc loads disk.img
|
# bochs -f baremetal/boot.bochsrc # boot.bochsrc loads disk.img
|
||||||
|
|
||||||
== code
|
== code
|
||||||
|
|
||||||
|
|
4
ex2.subx
4
ex2.subx
|
@ -1,11 +1,11 @@
|
||||||
# Test out the video mode by filling in the screen with pixels.
|
# Test out the video mode by filling in the screen with pixels.
|
||||||
#
|
#
|
||||||
# To build a disk image:
|
# To build a disk image:
|
||||||
# ./translate_subx ex2.subx # emits disk.img
|
# ./translate_subx boot.hex ex2.subx # emits disk.img
|
||||||
# To run:
|
# To run:
|
||||||
# qemu-system-i386 disk.img
|
# qemu-system-i386 disk.img
|
||||||
# Or:
|
# Or:
|
||||||
# bochs -f baremetal/boot.bochsrc # boot.bochsrc loads disk.img
|
# bochs -f baremetal/boot.bochsrc # boot.bochsrc loads disk.img
|
||||||
|
|
||||||
== code
|
== code
|
||||||
|
|
||||||
|
|
Binary file not shown.
|
@ -8,7 +8,7 @@
|
||||||
# The expected input is a stream of bytes and some interspersed labels.
|
# The expected input is a stream of bytes and some interspersed labels.
|
||||||
# Comments and '==' segment headers are allowed, but names are ignored. The
|
# Comments and '==' segment headers are allowed, but names are ignored. The
|
||||||
# emitted code will all lie in a single contiguous address range starting at
|
# emitted code will all lie in a single contiguous address range starting at
|
||||||
# address 0x9400. Addresses in segment headers are optional. If provided, this
|
# address 0x7c00. Addresses in segment headers are optional. If provided, this
|
||||||
# program will insert padding in the output until the desired address is
|
# program will insert padding in the output until the desired address is
|
||||||
# reached.
|
# reached.
|
||||||
#
|
#
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
# cc dd l2/disp32
|
# cc dd l2/disp32
|
||||||
# l2:
|
# l2:
|
||||||
# ee foo/imm32
|
# ee foo/imm32
|
||||||
# == data 0x9410
|
# == data 0x7c10
|
||||||
# foo:
|
# foo:
|
||||||
# 34
|
# 34
|
||||||
#
|
#
|
||||||
|
@ -27,13 +27,13 @@
|
||||||
# and with label references replaced with numeric values/displacements.
|
# and with label references replaced with numeric values/displacements.
|
||||||
#
|
#
|
||||||
# $ cat x |bootstrap/bootstrap run survey_baremetal
|
# $ cat x |bootstrap/bootstrap run survey_baremetal
|
||||||
# # 0x9400
|
# # 0x7c00
|
||||||
# aa bb nn # some computed address
|
# aa bb nn # some computed address
|
||||||
# cc dd nn nn nn nn # some computed displacement
|
# cc dd nn nn nn nn # some computed displacement
|
||||||
# ee nn nn nn nn # address right after this instruction
|
# ee nn nn nn nn # address right after this instruction
|
||||||
# # 0x940e
|
# # 0x7c0e
|
||||||
# 00 00 # padding
|
# 00 00 # padding
|
||||||
# # 0x9410
|
# # 0x7c10
|
||||||
# 34 # data segment interleaved with code
|
# 34 # data segment interleaved with code
|
||||||
|
|
||||||
== code
|
== code
|
||||||
|
@ -204,7 +204,7 @@ test-subx-survey-computes-addresses:
|
||||||
# 01
|
# 01
|
||||||
#
|
#
|
||||||
# trace contains (in any order):
|
# trace contains (in any order):
|
||||||
# label x is at address 0x9405
|
# label x is at address 0x7c05
|
||||||
#
|
#
|
||||||
# . prologue
|
# . prologue
|
||||||
55/push-ebp
|
55/push-ebp
|
||||||
|
@ -314,10 +314,10 @@ test-subx-survey-computes-addresses:
|
||||||
#? # . . discard args
|
#? # . . discard args
|
||||||
#? 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp
|
#? 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp
|
||||||
#? # }}}
|
#? # }}}
|
||||||
# . check-trace-contains("label 'x' is at address 0x00009405.", msg)
|
# . check-trace-contains("label 'x' is at address 0x00007c05.", msg)
|
||||||
# . . push args
|
# . . push args
|
||||||
68/push "F - test-subx-survey-computes-addresses/0"/imm32
|
68/push "F - test-subx-survey-computes-addresses/0"/imm32
|
||||||
68/push "label 'x' is at address 0x00009405."/imm32
|
68/push "label 'x' is at address 0x00007c05."/imm32
|
||||||
# . . call
|
# . . call
|
||||||
e8/call check-trace-contains/disp32
|
e8/call check-trace-contains/disp32
|
||||||
# . . discard args
|
# . . discard args
|
||||||
|
@ -331,12 +331,12 @@ test-subx-survey-computes-addresses-with-padding:
|
||||||
# input:
|
# input:
|
||||||
# == code
|
# == code
|
||||||
# ab x/imm32
|
# ab x/imm32
|
||||||
# == data 0x9410
|
# == data 0x7c10
|
||||||
# x:
|
# x:
|
||||||
# 01
|
# 01
|
||||||
#
|
#
|
||||||
# trace contains (in any order):
|
# trace contains (in any order):
|
||||||
# label x is at address 0x9410
|
# label x is at address 0x7c10
|
||||||
#
|
#
|
||||||
# . prologue
|
# . prologue
|
||||||
55/push-ebp
|
55/push-ebp
|
||||||
|
@ -389,7 +389,7 @@ test-subx-survey-computes-addresses-with-padding:
|
||||||
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp
|
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp
|
||||||
# . write(_test-input-stream, "== data\n")
|
# . write(_test-input-stream, "== data\n")
|
||||||
# . . push args
|
# . . push args
|
||||||
68/push "== data 0x9410\n"/imm32
|
68/push "== data 0x7c10\n"/imm32
|
||||||
68/push _test-input-stream/imm32
|
68/push _test-input-stream/imm32
|
||||||
# . . call
|
# . . call
|
||||||
e8/call write/disp32
|
e8/call write/disp32
|
||||||
|
@ -446,10 +446,10 @@ test-subx-survey-computes-addresses-with-padding:
|
||||||
#? # . . discard args
|
#? # . . discard args
|
||||||
#? 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp
|
#? 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp
|
||||||
#? # }}}
|
#? # }}}
|
||||||
# . check-trace-contains("label 'x' is at address 0x00009410.", msg)
|
# . check-trace-contains("label 'x' is at address 0x00007c10.", msg)
|
||||||
# . . push args
|
# . . push args
|
||||||
68/push "F - test-subx-survey-computes-addresses-with-padding/0"/imm32
|
68/push "F - test-subx-survey-computes-addresses-with-padding/0"/imm32
|
||||||
68/push "label 'x' is at address 0x00009410."/imm32
|
68/push "label 'x' is at address 0x00007c10."/imm32
|
||||||
# . . call
|
# . . call
|
||||||
e8/call check-trace-contains/disp32
|
e8/call check-trace-contains/disp32
|
||||||
# . . discard args
|
# . . discard args
|
||||||
|
@ -461,7 +461,7 @@ test-subx-survey-computes-addresses-with-padding:
|
||||||
|
|
||||||
compute-offsets: # in: (addr stream byte), labels: (addr stream {(handle array byte), address})
|
compute-offsets: # in: (addr stream byte), labels: (addr stream {(handle array byte), address})
|
||||||
# pseudocode:
|
# pseudocode:
|
||||||
# var current-address = 0x9400
|
# var current-address = 0x7c00
|
||||||
# var line: (stream byte 512)
|
# var line: (stream byte 512)
|
||||||
# while true # line loop
|
# while true # line loop
|
||||||
# clear-stream(line)
|
# clear-stream(line)
|
||||||
|
@ -502,8 +502,8 @@ compute-offsets: # in: (addr stream byte), labels: (addr stream {(handle array
|
||||||
53/push-ebx
|
53/push-ebx
|
||||||
56/push-esi
|
56/push-esi
|
||||||
57/push-edi
|
57/push-edi
|
||||||
# var current-address/esi: int = 0x9400
|
# var current-address/esi: int = 0x7c00
|
||||||
be/copy-to-esi 0x9400/imm32
|
be/copy-to-esi 0x7c00/imm32
|
||||||
# var line/ecx: (stream byte 512)
|
# var line/ecx: (stream byte 512)
|
||||||
81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0x200/imm32 # subtract from esp
|
81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0x200/imm32 # subtract from esp
|
||||||
68/push 0x200/imm32/size
|
68/push 0x200/imm32/size
|
||||||
|
@ -809,7 +809,7 @@ test-compute-offsets:
|
||||||
# 34
|
# 34
|
||||||
#
|
#
|
||||||
# trace contains (in any order):
|
# trace contains (in any order):
|
||||||
# label 'x' is at address 0x9406.
|
# label 'x' is at address 0x7c06.
|
||||||
#
|
#
|
||||||
# . prologue
|
# . prologue
|
||||||
55/push-ebp
|
55/push-ebp
|
||||||
|
@ -911,10 +911,10 @@ test-compute-offsets:
|
||||||
#? # . . discard args
|
#? # . . discard args
|
||||||
#? 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp
|
#? 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp
|
||||||
#? # }}}
|
#? # }}}
|
||||||
# . check-trace-contains("label 'x' is at address 0x00009406.", msg)
|
# . check-trace-contains("label 'x' is at address 0x00007c06.", msg)
|
||||||
# . . push args
|
# . . push args
|
||||||
68/push "F - test-compute-offsets"/imm32
|
68/push "F - test-compute-offsets"/imm32
|
||||||
68/push "label 'x' is at address 0x00009406."/imm32
|
68/push "label 'x' is at address 0x00007c06."/imm32
|
||||||
# . . call
|
# . . call
|
||||||
e8/call check-trace-contains/disp32
|
e8/call check-trace-contains/disp32
|
||||||
# . . discard args
|
# . . discard args
|
||||||
|
@ -946,7 +946,7 @@ emit-output:datum: # slice
|
||||||
|
|
||||||
emit-output: # in: (addr stream byte), out: (addr buffered-file), labels: (addr stream {(handle array byte), address})
|
emit-output: # in: (addr stream byte), out: (addr buffered-file), labels: (addr stream {(handle array byte), address})
|
||||||
# pseudocode:
|
# pseudocode:
|
||||||
# var address-of-next-instruction = 0x9400
|
# var address-of-next-instruction = 0x7c00
|
||||||
# var line: (stream byte 512)
|
# var line: (stream byte 512)
|
||||||
# line-loop:
|
# line-loop:
|
||||||
# while true
|
# while true
|
||||||
|
@ -1026,8 +1026,8 @@ emit-output: # in: (addr stream byte), out: (addr buffered-file), labels: (addr
|
||||||
68/push 0/imm32/end
|
68/push 0/imm32/end
|
||||||
68/push 0/imm32/start
|
68/push 0/imm32/start
|
||||||
89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . . # copy esp to edx
|
89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . . # copy esp to edx
|
||||||
# var address-of-next-instruction/ebx = 0x9400
|
# var address-of-next-instruction/ebx = 0x7c00
|
||||||
bb/copy-to-ebx 0x9400/imm32
|
bb/copy-to-ebx 0x7c00/imm32
|
||||||
$emit-output:line-loop:
|
$emit-output:line-loop:
|
||||||
# clear-stream(line)
|
# clear-stream(line)
|
||||||
# . . push args
|
# . . push args
|
||||||
|
@ -1803,10 +1803,10 @@ test-emit-output-non-far-control-flow:
|
||||||
#? # . . discard args
|
#? # . . discard args
|
||||||
#? 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp
|
#? 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp
|
||||||
#? # }}}
|
#? # }}}
|
||||||
# . check-next-stream-line-equal(_test-output-stream, "# 0x00009400", msg)
|
# . check-next-stream-line-equal(_test-output-stream, "# 0x00007c00", msg)
|
||||||
# . . push args
|
# . . push args
|
||||||
68/push "F - test-emit-output-non-far-control-flow/0"/imm32
|
68/push "F - test-emit-output-non-far-control-flow/0"/imm32
|
||||||
68/push "# 0x00009400"/imm32
|
68/push "# 0x00007c00"/imm32
|
||||||
68/push _test-output-stream/imm32
|
68/push _test-output-stream/imm32
|
||||||
# . . call
|
# . . call
|
||||||
e8/call check-next-stream-line-equal/disp32
|
e8/call check-next-stream-line-equal/disp32
|
||||||
|
@ -1830,10 +1830,10 @@ test-emit-output-non-far-control-flow:
|
||||||
e8/call check-next-stream-line-equal/disp32
|
e8/call check-next-stream-line-equal/disp32
|
||||||
# . . discard args
|
# . . discard args
|
||||||
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp
|
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp
|
||||||
# . check-next-stream-line-equal(_test-output-stream, "# 0x00009409", msg)
|
# . check-next-stream-line-equal(_test-output-stream, "# 0x00007c09", msg)
|
||||||
# . . push args
|
# . . push args
|
||||||
68/push "F - test-emit-output-non-far-control-flow/3"/imm32
|
68/push "F - test-emit-output-non-far-control-flow/3"/imm32
|
||||||
68/push "# 0x00009409"/imm32
|
68/push "# 0x00007c09"/imm32
|
||||||
68/push _test-output-stream/imm32
|
68/push _test-output-stream/imm32
|
||||||
# . . call
|
# . . call
|
||||||
e8/call check-next-stream-line-equal/disp32
|
e8/call check-next-stream-line-equal/disp32
|
||||||
|
@ -1869,15 +1869,15 @@ test-emit-output-with-padding:
|
||||||
# in:
|
# in:
|
||||||
# == code
|
# == code
|
||||||
# ab cd ef gh
|
# ab cd ef gh
|
||||||
# == data 0x9410
|
# == data 0x7c10
|
||||||
# 34
|
# 34
|
||||||
#
|
#
|
||||||
# output:
|
# output:
|
||||||
# ab cd ef gh
|
# ab cd ef gh
|
||||||
# # 0x9404
|
# # 0x7c04
|
||||||
# 00 00 00 00
|
# 00 00 00 00
|
||||||
# 00 00 00 00 00 00 00 00
|
# 00 00 00 00 00 00 00 00
|
||||||
# # 0x9410
|
# # 0x7c10
|
||||||
# 34
|
# 34
|
||||||
#
|
#
|
||||||
# . prologue
|
# . prologue
|
||||||
|
@ -1932,9 +1932,9 @@ test-emit-output-with-padding:
|
||||||
e8/call write/disp32
|
e8/call write/disp32
|
||||||
# . . discard args
|
# . . discard args
|
||||||
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp
|
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp
|
||||||
# . write(_test-input-stream, "== data 0x9410\n")
|
# . write(_test-input-stream, "== data 0x7c10\n")
|
||||||
# . . push args
|
# . . push args
|
||||||
68/push "== data 0x9410\n"/imm32
|
68/push "== data 0x7c10\n"/imm32
|
||||||
68/push _test-input-stream/imm32
|
68/push _test-input-stream/imm32
|
||||||
# . . call
|
# . . call
|
||||||
e8/call write/disp32
|
e8/call write/disp32
|
||||||
|
@ -1999,10 +1999,10 @@ test-emit-output-with-padding:
|
||||||
#? # . . discard args
|
#? # . . discard args
|
||||||
#? 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp
|
#? 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp
|
||||||
#? # }}}
|
#? # }}}
|
||||||
# . check-next-stream-line-equal(_test-output-stream, "# 0x00009400", msg)
|
# . check-next-stream-line-equal(_test-output-stream, "# 0x00007c00", msg)
|
||||||
# . . push args
|
# . . push args
|
||||||
68/push "F - test-emit-output-with-padding/0"/imm32
|
68/push "F - test-emit-output-with-padding/0"/imm32
|
||||||
68/push "# 0x00009400"/imm32
|
68/push "# 0x00007c00"/imm32
|
||||||
68/push _test-output-stream/imm32
|
68/push _test-output-stream/imm32
|
||||||
# . . call
|
# . . call
|
||||||
e8/call check-next-stream-line-equal/disp32
|
e8/call check-next-stream-line-equal/disp32
|
||||||
|
@ -2017,10 +2017,10 @@ test-emit-output-with-padding:
|
||||||
e8/call check-next-stream-line-equal/disp32
|
e8/call check-next-stream-line-equal/disp32
|
||||||
# . . discard args
|
# . . discard args
|
||||||
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp
|
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp
|
||||||
# . check-next-stream-line-equal(_test-output-stream, "# 0x00009404", msg)
|
# . check-next-stream-line-equal(_test-output-stream, "# 0x00007c04", msg)
|
||||||
# . . push args
|
# . . push args
|
||||||
68/push "F - test-emit-output-with-padding/0"/imm32
|
68/push "F - test-emit-output-with-padding/0"/imm32
|
||||||
68/push "# 0x00009404"/imm32
|
68/push "# 0x00007c04"/imm32
|
||||||
68/push _test-output-stream/imm32
|
68/push _test-output-stream/imm32
|
||||||
# . . call
|
# . . call
|
||||||
e8/call check-next-stream-line-equal/disp32
|
e8/call check-next-stream-line-equal/disp32
|
||||||
|
@ -2044,10 +2044,10 @@ test-emit-output-with-padding:
|
||||||
e8/call check-next-stream-line-equal/disp32
|
e8/call check-next-stream-line-equal/disp32
|
||||||
# . . discard args
|
# . . discard args
|
||||||
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp
|
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp
|
||||||
# . check-next-stream-line-equal(_test-output-stream, "# 0x00009410", msg)
|
# . check-next-stream-line-equal(_test-output-stream, "# 0x00007c10", msg)
|
||||||
# . . push args
|
# . . push args
|
||||||
68/push "F - test-emit-output-with-padding/0"/imm32
|
68/push "F - test-emit-output-with-padding/0"/imm32
|
||||||
68/push "# 0x00009410"/imm32
|
68/push "# 0x00007c10"/imm32
|
||||||
68/push _test-output-stream/imm32
|
68/push _test-output-stream/imm32
|
||||||
# . . call
|
# . . call
|
||||||
e8/call check-next-stream-line-equal/disp32
|
e8/call check-next-stream-line-equal/disp32
|
||||||
|
@ -2077,12 +2077,12 @@ test-emit-output-code-label:
|
||||||
# ef gh
|
# ef gh
|
||||||
# e8 l1/disp32
|
# e8 l1/disp32
|
||||||
# labels:
|
# labels:
|
||||||
# - 'l1': 0x9410
|
# - 'l1': 0x7c10
|
||||||
#
|
#
|
||||||
# output:
|
# output:
|
||||||
# ab cd
|
# ab cd
|
||||||
# ef gh
|
# ef gh
|
||||||
# e8 07 00 00 00 # 0x9410 - 0x9409 = 7
|
# e8 07 00 00 00 # 0x7c10 - 0x7c09 = 7
|
||||||
#
|
#
|
||||||
# . prologue
|
# . prologue
|
||||||
55/push-ebp
|
55/push-ebp
|
||||||
|
@ -2152,8 +2152,8 @@ test-emit-output-code-label:
|
||||||
e8/call write/disp32
|
e8/call write/disp32
|
||||||
# . . discard args
|
# . . discard args
|
||||||
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp
|
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp
|
||||||
# . stream-add2(labels, "l1", 0x9410)
|
# . stream-add2(labels, "l1", 0x7c10)
|
||||||
68/push 0x9410/imm32/label-address
|
68/push 0x7c10/imm32/label-address
|
||||||
# . . push handle for "l1"
|
# . . push handle for "l1"
|
||||||
53/push-ebx
|
53/push-ebx
|
||||||
68/push "l1"/imm32
|
68/push "l1"/imm32
|
||||||
|
@ -2219,10 +2219,10 @@ test-emit-output-code-label:
|
||||||
#? # . . discard args
|
#? # . . discard args
|
||||||
#? 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp
|
#? 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp
|
||||||
#? # }}}
|
#? # }}}
|
||||||
# . check-next-stream-line-equal(_test-output-stream, "# 0x00009400", msg)
|
# . check-next-stream-line-equal(_test-output-stream, "# 0x00007c00", msg)
|
||||||
# . . push args
|
# . . push args
|
||||||
68/push "F - test-emit-output-code-label/0"/imm32
|
68/push "F - test-emit-output-code-label/0"/imm32
|
||||||
68/push "# 0x00009400"/imm32
|
68/push "# 0x00007c00"/imm32
|
||||||
68/push _test-output-stream/imm32
|
68/push _test-output-stream/imm32
|
||||||
# . . call
|
# . . call
|
||||||
e8/call check-next-stream-line-equal/disp32
|
e8/call check-next-stream-line-equal/disp32
|
||||||
|
@ -2412,10 +2412,10 @@ test-emit-output-code-label-absolute:
|
||||||
#? # . . discard args
|
#? # . . discard args
|
||||||
#? 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp
|
#? 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp
|
||||||
#? # }}}
|
#? # }}}
|
||||||
# . check-next-stream-line-equal(_test-output-stream, "# 0x00009400", msg)
|
# . check-next-stream-line-equal(_test-output-stream, "# 0x00007c00", msg)
|
||||||
# . . push args
|
# . . push args
|
||||||
68/push "F - test-emit-output-code-label-absolute/0"/imm32
|
68/push "F - test-emit-output-code-label-absolute/0"/imm32
|
||||||
68/push "# 0x00009400"/imm32
|
68/push "# 0x00007c00"/imm32
|
||||||
68/push _test-output-stream/imm32
|
68/push _test-output-stream/imm32
|
||||||
# . . call
|
# . . call
|
||||||
e8/call check-next-stream-line-equal/disp32
|
e8/call check-next-stream-line-equal/disp32
|
||||||
|
|
|
@ -5,4 +5,4 @@ set -e
|
||||||
|
|
||||||
cat $* [0-9]*.mu |linux/mu > a.subx
|
cat $* [0-9]*.mu |linux/mu > a.subx
|
||||||
|
|
||||||
./translate_subx mu-init.subx [0-9]*.subx a.subx
|
./translate_subx boot.hex mu-init.subx [0-9]*.subx a.subx
|
||||||
|
|
|
@ -9,4 +9,4 @@ set -v
|
||||||
|
|
||||||
cat $* [0-9]*.mu |linux/bootstrap/bootstrap run linux/mu > a.subx
|
cat $* [0-9]*.mu |linux/bootstrap/bootstrap run linux/mu > a.subx
|
||||||
|
|
||||||
./translate_subx_emulated mu-init.subx [0-9]*.subx a.subx
|
./translate_subx_emulated boot.hex mu-init.subx [0-9]*.subx a.subx
|
||||||
|
|
|
@ -30,14 +30,12 @@ cat a.pack |linux/survey_baremetal > a.survey
|
||||||
|
|
||||||
cat a.survey |linux/hex > a.bin
|
cat a.survey |linux/hex > a.bin
|
||||||
|
|
||||||
# Create disk.img containing baremetal/boot.hex and a.bin
|
# Create disk.img containing a.bin
|
||||||
dd if=/dev/zero of=disk.img count=20160 # 512-byte sectors, so 10MB
|
dd if=/dev/zero of=disk.img count=20160 # 512-byte sectors, so 10MB
|
||||||
linux/hex < boot.hex > boot.bin
|
dd if=a.bin of=disk.img conv=notrunc
|
||||||
cat boot.bin a.bin > disk.bin
|
|
||||||
dd if=disk.bin of=disk.img conv=notrunc
|
|
||||||
|
|
||||||
if [ `stat --printf="%s" disk.bin` -ge 193536 ] # 6 tracks * 63 sectors per track * 512 bytes per sector (keep this sync'd with boot.hex)
|
if [ `stat --printf="%s" a.bin` -ge 193536 ] # 6 tracks * 63 sectors per track * 512 bytes per sector (keep this sync'd with boot.hex)
|
||||||
then
|
then
|
||||||
echo "disk.bin won't all be loaded on boot"
|
echo "a.bin won't all be loaded on boot"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -25,14 +25,12 @@ cat a.pack |linux/bootstrap/bootstrap run linux/survey_baremetal > a.su
|
||||||
|
|
||||||
cat a.survey |linux/bootstrap/bootstrap run linux/hex > a.bin
|
cat a.survey |linux/bootstrap/bootstrap run linux/hex > a.bin
|
||||||
|
|
||||||
# Create disk.img containing boot.hex and a.bin
|
# Create disk.img containing a.bin
|
||||||
dd if=/dev/zero of=disk.img count=20160 # 512-byte sectors, so 10MB
|
dd if=/dev/zero of=disk.img count=20160 # 512-byte sectors, so 10MB
|
||||||
linux/bootstrap/bootstrap run linux/hex < boot.hex > boot.bin
|
dd if=a.bin of=disk.img conv=notrunc
|
||||||
cat boot.bin a.bin > disk.bin
|
|
||||||
dd if=disk.bin of=disk.img conv=notrunc
|
|
||||||
|
|
||||||
if [ `stat --printf="%s" disk.bin` -ge 193536 ] # 6 tracks * 63 sectors per track * 512 bytes per sector (keep this sync'd with boot.hex)
|
if [ `stat --printf="%s" a.bin` -ge 193536 ] # 6 tracks * 63 sectors per track * 512 bytes per sector (keep this sync'd with boot.hex)
|
||||||
then
|
then
|
||||||
echo "disk.bin won't all be loaded on boot"
|
echo "a.bin won't all be loaded on boot"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue