From c83e3bf27fdc7086a7f8c93a8ca63ef976c758e5 Mon Sep 17 00:00:00 2001 From: manzerbredes Date: Fri, 17 Jul 2015 17:14:42 +0400 Subject: [PATCH] Create a simple bootloader with nasm --- bootloader/Makefile | 8 ++++++++ bootloader/bootloader.asm | 14 ++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 bootloader/Makefile create mode 100644 bootloader/bootloader.asm diff --git a/bootloader/Makefile b/bootloader/Makefile new file mode 100644 index 0000000..9cb2ec5 --- /dev/null +++ b/bootloader/Makefile @@ -0,0 +1,8 @@ + + + +bootloader.bin: bootloader.asm + nasm -f bin -o $@ $^ + +clean: + rm bootloader.bin diff --git a/bootloader/bootloader.asm b/bootloader/bootloader.asm new file mode 100644 index 0000000..8009ff0 --- /dev/null +++ b/bootloader/bootloader.asm @@ -0,0 +1,14 @@ +[BITS 16] + +;Save the first adress in with start label +start: + +;Init CPU registers +mov ax, 0x0C70 +mov ds, ax ;Init data segment + +;Complete the MBR with nothing +times 510 - ($ - start) db 0x0 + +;Declare magic number +dw 0xAA55