about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--bochsrc2
-rw-r--r--bochsrc.2disks4
-rwxr-xr-xtranslate_subx10
3 files changed, 12 insertions, 4 deletions
diff --git a/bochsrc b/bochsrc
index 7a74312e..e31b1718 100644
--- a/bochsrc
+++ b/bochsrc
@@ -9,7 +9,7 @@
 
 display_library: sdl2
 
-ata0-master: type=disk, path="code.img", mode=flat, cylinders=20, heads=16, spt=63  # 10MB, 512 bytes per sector
+ata0-master: type=disk, path="code.img", mode=flat, cylinders=20, heads=16, spt=63  # 512 bytes per sector = almost 10MB
 boot: disk
 mouse: enabled=1, toggle=ctrl+f10
 log: -
diff --git a/bochsrc.2disks b/bochsrc.2disks
index a9550a9d..0956bdda 100644
--- a/bochsrc.2disks
+++ b/bochsrc.2disks
@@ -9,8 +9,8 @@
 
 display_library: sdl2
 
-ata0-master: type=disk, path="code.img", mode=flat, cylinders=20, heads=16, spt=63  # 10MB, 512 bytes per sector
-ata0-slave: type=disk, path="data.img", mode=flat, cylinders=20, heads=16, spt=63  # 10MB, 512 bytes per sector
+ata0-master: type=disk, path="code.img", mode=flat, cylinders=20, heads=16, spt=63  # 512 bytes per sector = almost 10MB
+ata0-slave: type=disk, path="data.img", mode=flat, cylinders=20, heads=16, spt=63  # 512 bytes per sector = almost 10MB
 boot: disk
 mouse: enabled=1, toggle=ctrl+f10
 log: -
diff --git a/translate_subx b/translate_subx
index 70400f45..5e2db997 100755
--- a/translate_subx
+++ b/translate_subx
@@ -32,7 +32,7 @@ cat a.pack      |linux/labels_baremetal     labels              > a.survey
 cat a.survey    |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)
@@ -40,3 +40,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 516096 ]  # 16 tracks * 63 sectors per track * 512 bytes per sector (keep this sync'd with boot.subx)
+then
+  echo "a.bin won't all be loaded on boot"
+  exit 1
+fi