From 63624488e9f993ccbc0b4fa54ae32832bd684506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Tue, 3 Jul 2018 17:49:56 +0200 Subject: [PATCH] os.bat is now a triple chameleon: MS-DOS .bat, Unix .sh and x86 bootable floppy disk image --- example-os/os.asm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/example-os/os.asm b/example-os/os.asm index e69cebf..5c045e2 100644 --- a/example-os/os.asm +++ b/example-os/os.asm @@ -3,6 +3,7 @@ db `#!/usr/bin/env sh\n` db `: <<'EOF'\n` +db `GOTO msdos\n` times 0x7c78-0x7c00-($-$$) db 0 @@ -50,7 +51,15 @@ db 0xaa db `\n` db `EOF\n` db `echo Hello world from sh!\n` +db `while sleep 10; do :; done\n` db `exit\n` +;; end of the SH section, everything until this point is skipped by MS-DOS batch due to the GOTO' +db `:msdos\n` +db `@cls\n` +db `@echo "hello world" from MS-DOS\n` +db `:loop\n` +db `GOTO loop\n` + ;; Fill up to 1.44M with 0 times (1440*1024)-($-$$) db 0