about summary refs log tree commit diff stats
path: root/translate_subx_emulated
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-05-14 21:29:42 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-05-14 21:29:42 -0700
commit7205c2465fbefb067bfaf169f2a9c81f1feed0ae (patch)
tree8ea01c55e298897bb43abeb22a3045a1b173973c /translate_subx_emulated
parent73744d098ca59a3844987e0919b990a880ec6895 (diff)
downloadmu-7205c2465fbefb067bfaf169f2a9c81f1feed0ae.tar.gz
fixup! load debug info into code disk
Diffstat (limited to 'translate_subx_emulated')
-rwxr-xr-xtranslate_subx_emulated10
1 files changed, 9 insertions, 1 deletions
diff --git a/translate_subx_emulated b/translate_subx_emulated
index 26dd5364..aef29801 100755
--- a/translate_subx_emulated
+++ b/translate_subx_emulated
@@ -36,7 +36,7 @@ cat a.pack        |linux/bootstrap/bootstrap linux/labels_baremetal     labels
 cat a.survey      |linux/bootstrap/bootstrap run linux/hex                            > a.bin
 
 # Create code.img containing a.bin
-dd if=/dev/zero of=code.img count=20160  # 512-byte sectors, so 10MB
+dd if=/dev/zero of=code.img count=20160  # 20*16*63 512-byte sectors = almost 10MB
 dd if=a.bin of=code.img conv=notrunc
 
 if [ `stat --printf="%s" a.bin` -ge 258048 ]  # 8 tracks * 63 sectors per track * 512 bytes per sector (keep this sync'd with boot.subx)
@@ -44,3 +44,11 @@ then
   echo "a.bin won't all be loaded on boot"
   exit 1
 fi
+
+# Latter half of disk is for debug info.
+dd if=labels of=code.img seek=10080 conv=notrunc
+if [ `stat --printf="%s" labels` -ge 131072 ]  # 256 sectors * 512 bytes per sector, the most an ATA drive can read in a single command
+then
+  echo "labels won't all be loaded on abort"
+  exit 1
+fi