about summary refs log tree commit diff stats
path: root/boot.subx
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-07-07 01:05:52 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-07-07 07:13:16 -0700
commitef73cb78f15839cf0254ead273e0d1eca1d4826c (patch)
treeb31aa6df6f31fc259af8810dcddfb09c275d5cb8 /boot.subx
parent2d3fe4e940deb0078bef80f0f56ea38852c991e7 (diff)
downloadmu-ef73cb78f15839cf0254ead273e0d1eca1d4826c.tar.gz
initial image rendering
Supports just some ASCII formats: https://en.wikipedia.org/wiki/Netpbm

Colors are messed up. That's next.
Diffstat (limited to 'boot.subx')
-rw-r--r--boot.subx7
1 files changed, 7 insertions, 0 deletions
diff --git a/boot.subx b/boot.subx
index afabc193..2c468458 100644
--- a/boot.subx
+++ b/boot.subx
@@ -972,6 +972,7 @@ Primary-bus-secondary-drive:
 
 == code
 
+# No more than 0x100 sectors
 load-sectors:  # disk: (addr disk), lba: int, n: int, out: (addr stream byte)
   # . prologue
   55/push-ebp
@@ -980,6 +981,12 @@ load-sectors:  # disk: (addr disk), lba: int, n: int, out: (addr stream byte)
   50/push-eax
   51/push-ecx
   52/push-edx
+  # check precondition
+  81 7/subop/compare *(ebp+0x10) 0x100/imm32
+  {
+    7e/jump-if-<= break/disp8
+    (abort "load-sectors: no more than 0x100 sectors")
+  }
   # check for drive
   (drive-exists? *(ebp+8))  # => eax
   3d/compare-eax-and 0/imm32/false