diff options
| author | 2024-02-24 18:01:09 +0200 | |
|---|---|---|
| committer | 2024-02-24 18:01:09 +0200 | |
| commit | c053056b8effb5c35454f8e90548f43be0ce1ef0 (patch) | |
| tree | c4195f1e6f41729e3de4c5b52fd70e1c77afa71d | |
| download | mbr-trans-flag-main.tar.gz mbr-trans-flag-main.tar.xz mbr-trans-flag-main.zip | |
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | README.org | 18 | ||||
| -rw-r--r-- | boot.asm | 49 | ||||
| -rw-r--r-- | boot.bin | bin | 0 -> 512 bytes | |||
| -rw-r--r-- | screenshot.png | bin | 0 -> 389422 bytes |
5 files changed, 69 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c730676 --- /dev/null +++ b/.gitignore | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | *.html | ||
| 2 | tmp/ | ||
diff --git a/README.org b/README.org new file mode 100644 index 0000000..998831f --- /dev/null +++ b/README.org | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | #+TITLE: MBR Trans Flag | ||
| 2 | #+OPTIONS: author:nil num:nil timestamp:nil toc:nil | ||
| 3 | #+HTML_DOCTYPE: html5 | ||
| 4 | #+HTML_LINK_HOME: / | ||
| 5 | #+HTML_LINK_UP: / | ||
| 6 | What it says on the tin. | ||
| 7 | * Source code download | ||
| 8 | [[./boot.asm]], compilation and launch instructions included in file. | ||
| 9 | * Binary pre-compiled file | ||
| 10 | [[./boot.bin]] (maybe not a 1-to-1 compiled version). | ||
| 11 | #+BEGIN_SRC sh | ||
| 12 | $ qemu-system-i386 -fda ./boot.bin | ||
| 13 | #+END_SRC | ||
| 14 | * Screenshat | ||
| 15 | #+ATTR_HTML: :width 80% | ||
| 16 | [[./screenshot.png]] | ||
| 17 | * Source code listing | ||
| 18 | #+INCLUDE: "./boot.asm" src nasm | ||
diff --git a/boot.asm b/boot.asm new file mode 100644 index 0000000..f80ba16 --- /dev/null +++ b/boot.asm | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | ;; This thing is licensed under Creative Commons Zero v1.0 Universal, which essentially means | ||
| 2 | ;; "Public Domain". (You can do anything you want without asking for permission). | ||
| 3 | ;; | ||
| 4 | ;; SPDX-License-Identifier: CC0-1.0 | ||
| 5 | ;; | ||
| 6 | ;; To compile | ||
| 7 | ;; $ nasm -f bin -o boot.bin boot.asm | ||
| 8 | ;; | ||
| 9 | ;; To run | ||
| 10 | ;; $ qemu-system-i386 -fda boot.bin | ||
| 11 | ;; | ||
| 12 | ;; You can also run this by burning it to a floppy or a hard drive but I am not to be held | ||
| 13 | ;; responsible for any lost partitions, filesystems, or bootloaders. | ||
| 14 | |||
| 15 | BITS 16 | ||
| 16 | |||
| 17 | mov ax, 0xB800 | ||
| 18 | mov es, ax | ||
| 19 | xor di, di | ||
| 20 | |||
| 21 | mov ax, 0xBB20 | ||
| 22 | mov cx, 80*5 | ||
| 23 | rep stosw | ||
| 24 | |||
| 25 | mov ah, 0xDD | ||
| 26 | mov cx, 80*5 | ||
| 27 | rep stosw | ||
| 28 | |||
| 29 | mov ah, 0xFF | ||
| 30 | mov cx, 80*5 | ||
| 31 | rep stosw | ||
| 32 | |||
| 33 | mov ah, 0xDD | ||
| 34 | mov cx, 80*5 | ||
| 35 | rep stosw | ||
| 36 | |||
| 37 | mov ah, 0xBB | ||
| 38 | mov cx, 80*5 | ||
| 39 | rep stosw | ||
| 40 | |||
| 41 | halt: | ||
| 42 | cli | ||
| 43 | hlt | ||
| 44 | jmp halt | ||
| 45 | |||
| 46 | ; There's still ~463 bytes free here | ||
| 47 | |||
| 48 | times 510-($-$$) db 0 | ||
| 49 | dw 0xAA55 | ||
diff --git a/boot.bin b/boot.bin new file mode 100644 index 0000000..00982f3 --- /dev/null +++ b/boot.bin | |||
| Binary files differ | |||
diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..b632270 --- /dev/null +++ b/screenshot.png | |||
| Binary files differ | |||