From 64971229f349a50ad58feb40cd374d016eae7bb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Tue, 3 Jul 2018 17:20:24 +0200 Subject: [PATCH] Made the os.sh a chameleon: it is now an x86 bootsector and a shell script at the same time. --- example-os/os.asm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/example-os/os.asm b/example-os/os.asm index 520ed2a..e69cebf 100644 --- a/example-os/os.asm +++ b/example-os/os.asm @@ -1,6 +1,11 @@ [BITS 16] [ORG 0x7c00] +db `#!/usr/bin/env sh\n` +db `: <<'EOF'\n` + +times 0x7c78-0x7c00-($-$$) db 0 + ;; Switch to 320x200x256 VGA mode mov ax, 0x0013 int 10h @@ -41,5 +46,11 @@ times 512-2-($-$$) db 0 db 0x55 db 0xaa +;; end of the bootsector, close the sh here-document skipped via : <<'EOF' +db `\n` +db `EOF\n` +db `echo Hello world from sh!\n` +db `exit\n` + ;; Fill up to 1.44M with 0 times (1440*1024)-($-$$) db 0