From 6fe1b4be7200fd21f3c9806a01772e8c59603383 Mon Sep 17 00:00:00 2001 From: Conzer Date: Mon, 2 Dec 2024 15:15:06 -0500 Subject: [PATCH] add basic bootloader boilerplate (does this even work???) --- README.md | 7 ++++++- build.sh | 1 + main.asm | 30 ++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100755 build.sh create mode 100644 main.asm diff --git a/README.md b/README.md index 46ef98c..8a5e62b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ # Badloader -THE WORST BOOTLOADER EVER DO NOT USE THIS PLEASE \ No newline at end of file +THE WORST BOOTLOADER EVER DO NOT USE THIS PLEASE + +# Building +install `nasm`, then run build.sh. + +i havent tested this in qemu lol \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..8371006 --- /dev/null +++ b/build.sh @@ -0,0 +1 @@ +nasm -f bin main.asm -o badloader.img \ No newline at end of file diff --git a/main.asm b/main.asm new file mode 100644 index 0000000..e10cde8 --- /dev/null +++ b/main.asm @@ -0,0 +1,30 @@ +; future note to self: WHY ARE YOU DOING THIS PLEASE STOP +; IM TELLING YOU PLS STOP +; no im not commenting this. because this is the badloader and +; its bad lol + + [BITS 16] + [ORG 0x7C00] + +start: + mov ax, 0x0600 + mov bh, 0x07 + mov cx, 0x0000 + mov dx, 0x184F + int 0x10 + + mov si, msg +print: + lodsb + cmp al, 0 + je hang + mov ah, 0x0E + int 0x10 + jmp print +hang: + jmp hang + +msg db "hi im the badloader", 0 + +times 510-($-$$) db 0 +dw 0xAA55