From c053056b8effb5c35454f8e90548f43be0ce1ef0 Mon Sep 17 00:00:00 2001 From: Uko Kokņevičs Date: Sat, 24 Feb 2024 18:01:09 +0200 Subject: Initial Commit --- .gitignore | 2 ++ README.org | 18 ++++++++++++++++++ boot.asm | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ boot.bin | Bin 0 -> 512 bytes screenshot.png | Bin 0 -> 389422 bytes 5 files changed, 69 insertions(+) create mode 100644 .gitignore create mode 100644 README.org create mode 100644 boot.asm create mode 100644 boot.bin create mode 100644 screenshot.png diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c730676 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.html +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 @@ +#+TITLE: MBR Trans Flag +#+OPTIONS: author:nil num:nil timestamp:nil toc:nil +#+HTML_DOCTYPE: html5 +#+HTML_LINK_HOME: / +#+HTML_LINK_UP: / +What it says on the tin. +* Source code download +[[./boot.asm]], compilation and launch instructions included in file. +* Binary pre-compiled file +[[./boot.bin]] (maybe not a 1-to-1 compiled version). +#+BEGIN_SRC sh + $ qemu-system-i386 -fda ./boot.bin +#+END_SRC +* Screenshat +#+ATTR_HTML: :width 80% +[[./screenshot.png]] +* Source code listing +#+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 @@ +;; This thing is licensed under Creative Commons Zero v1.0 Universal, which essentially means +;; "Public Domain". (You can do anything you want without asking for permission). +;; +;; SPDX-License-Identifier: CC0-1.0 +;; +;; To compile +;; $ nasm -f bin -o boot.bin boot.asm +;; +;; To run +;; $ qemu-system-i386 -fda boot.bin +;; +;; You can also run this by burning it to a floppy or a hard drive but I am not to be held +;; responsible for any lost partitions, filesystems, or bootloaders. + +BITS 16 + + mov ax, 0xB800 + mov es, ax + xor di, di + + mov ax, 0xBB20 + mov cx, 80*5 + rep stosw + + mov ah, 0xDD + mov cx, 80*5 + rep stosw + + mov ah, 0xFF + mov cx, 80*5 + rep stosw + + mov ah, 0xDD + mov cx, 80*5 + rep stosw + + mov ah, 0xBB + mov cx, 80*5 + rep stosw + +halt: + cli + hlt + jmp halt + + ; There's still ~463 bytes free here + + times 510-($-$$) db 0 + dw 0xAA55 diff --git a/boot.bin b/boot.bin new file mode 100644 index 0000000..00982f3 Binary files /dev/null and b/boot.bin differ diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..b632270 Binary files /dev/null and b/screenshot.png differ -- cgit v1.2.3