about summary refs log tree commit diff stats
path: root/baremetal/ex1.subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-12-29 17:34:43 -0800
committerKartik Agaram <vc@akkartik.com>2020-12-29 17:46:04 -0800
commitc1b1d1f4e67b0badfef3473121220d34a5b4b418 (patch)
tree54f50eeaba645d2c243cad8f4ac4469a519bc344 /baremetal/ex1.subx
parent3618118c8df8032d0c8f969cd9c82864cdcf11c4 (diff)
downloadmu-c1b1d1f4e67b0badfef3473121220d34a5b4b418.tar.gz
7460 - baremetal backend for SubX
Diffstat (limited to 'baremetal/ex1.subx')
-rw-r--r--baremetal/ex1.subx23
1 files changed, 23 insertions, 0 deletions
diff --git a/baremetal/ex1.subx b/baremetal/ex1.subx
new file mode 100644
index 00000000..196b4104
--- /dev/null
+++ b/baremetal/ex1.subx
@@ -0,0 +1,23 @@
+# The simplest possible program: just an infinite loop.
+# All is well if your computer clears screen and hangs without restarting.
+# On an emulator the window may get bigger to accomodate the higher-resolution
+# graphics mode.
+#
+# To convert to a disk image, first prepare a realistically sized disk image:
+#   dd if=/dev/zero of=disk.img count=20160          # 512-byte sectors, so 10MB
+# Load the program on the disk image:
+#   ./translate_subx_baremetal baremetal/ex1.subx    # emits a.bin
+#   apps/hex < baremetal/boot.hex  > boot.bin
+#   cat boot.bin a.bin > disk.bin
+#   dd if=disk.bin of=disk.img conv=notrunc
+# To run:
+#   qemu-system-i386 disk.img
+# Or:
+#   bochs -f baremetal/boot.bochsrc  # boot.bochsrc loads disk.img
+
+== code
+
+$loop:
+e9/jump $loop/disp32
+
+# vim:ft=subx