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 --- boot.asm | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 boot.asm (limited to 'boot.asm') 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 -- cgit v1.2.3