about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2021-01-27 20:46:19 -0800
committerKartik Agaram <vc@akkartik.com>2021-01-27 20:53:50 -0800
commit9ebc8ad439cdceb766cb707918ddc9e05cb4de3d (patch)
treee6d1f982471fe096fcfb4938b5e60f937fd93853
parentc98476aa0960d64ad4fc259945ad22bcd27cb5a7 (diff)
downloadmu-9ebc8ad439cdceb766cb707918ddc9e05cb4de3d.tar.gz
7569
-rw-r--r--baremetal/boot.hex12
1 files changed, 10 insertions, 2 deletions
diff --git a/baremetal/boot.hex b/baremetal/boot.hex
index ef14651a..9ae9a7c8 100644
--- a/baremetal/boot.hex
+++ b/baremetal/boot.hex
@@ -21,8 +21,8 @@
 #
 # Since we start out in 16-bit mode, we need instructions SubX doesn't
 # support.
-# This file contains just lowercase hex bytes and comments. Zero
-# error-checking. Make liberal use of:
+# This file contains just lowercase hex bytes and comments. It makes liberal
+# use of:
 #   - comments documenting expected offsets
 #   - size checks on the emitted file (currently: 6144 bytes)
 #   - xxd to eyeball that offsets contain expected bytes
@@ -32,6 +32,14 @@
 #   - can't print text to video memory (past these boot sectors)
 #   - must only print raw pixels (256 colors) to video memory (resolution 1024x768)
 #   - must start executing immediately after this file (see outline below)
+#
+# Don't panic! This file doesn't contain any loops or function calls. 80% of
+# it is data. One pass through less than 1KB of code (there's lots of
+# padding), and then we jump into a better notation. The rest of the stack
+# (really only in a couple of slightly higher-level places) only needs to know
+# a few magic constants:
+#   Video memory: start is stored at 0x7f28
+#   Keyboard buffer: starts at 0x7ee0
 
 # Outline of this file with offsets and the addresses they map to at run-time:
 # -- 16-bit mode code